Merge branch 'master' of ssh://hunt/home/hunt2/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2008-10-07 08:29:51 +01:00
5 changed files with 177 additions and 103 deletions

View File

@ -32,7 +32,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
alias _foamAddPath 'set path=(\!* $path) ; if ( ! -d \!* ) mkdir -p \!*' alias _foamAddPath 'set path=(\!* $path) ; if ( ! -d \!* ) mkdir -p \!*'
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH} ; if ( ! -d \!* ) mkdir -p \!*' alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH} ; set xx=`echo $LD_LIBRARY_PATH | sed -e "s/:.*//"`; if ( ! -d $xx ) mkdir -p $xx'
#- Add the system-specific executables path to the path #- Add the system-specific executables path to the path
@ -82,7 +82,6 @@ switch ("$WM_COMPILER_INST")
case OpenFOAM: case OpenFOAM:
switch ("$WM_COMPILER") switch ("$WM_COMPILER")
case Gcc: case Gcc:
#setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib

View File

@ -33,6 +33,15 @@
_foamAddPath() _foamAddPath()
{ {
if [ $# -eq 1 ]
then
oldIFS="$IFS"
IFS=':' # split on ':'
set -- $1
IFS="$oldIFS"
unset oldIFS
fi
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
[ -d $1 ] || mkdir -p $1 [ -d $1 ] || mkdir -p $1
@ -43,6 +52,15 @@ _foamAddPath()
_foamAddLib() _foamAddLib()
{ {
if [ $# -eq 1 ]
then
oldIFS="$IFS"
IFS=':' # split on ':'
set -- $1
IFS="$oldIFS"
unset oldIFS
fi
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
[ -d $1 ] || mkdir -p $1 [ -d $1 ] || mkdir -p $1
@ -99,7 +117,6 @@ case "$WM_COMPILER_INST" in
OpenFOAM) OpenFOAM)
case "$WM_COMPILER" in case "$WM_COMPILER" in
Gcc) Gcc)
#export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.3.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
_foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.3/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib

View File

@ -168,9 +168,27 @@ public:
List<T>& List<T>&
); );
//- Distribute data using scheduling. //- Distribute data using default commsType.
template<class T> template<class T>
void distribute(List<T>& fld) const void distribute(List<T>& fld) const
{
if
(
Pstream::defaultCommsType == Pstream::nonBlocking
&& contiguous<T>()
)
{
distribute
(
Pstream::nonBlocking,
List<labelPair>(),
constructSize_,
subMap_,
constructMap_,
fld
);
}
else if (Pstream::defaultCommsType == Pstream::scheduled)
{ {
distribute distribute
( (
@ -182,6 +200,19 @@ public:
fld fld
); );
} }
else
{
distribute
(
Pstream::blocking,
List<labelPair>(),
constructSize_,
subMap_,
constructMap_,
fld
);
}
}
//- Correct for topo change. //- Correct for topo change.
void updateMesh(const mapPolyMesh&) void updateMesh(const mapPolyMesh&)

View File

@ -86,7 +86,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
( (
IOobject IOobject
( (
this->name() + "rhoTrans" + name(i), this->name() + "rhoTrans" + Foam::name(i),
this->db().time().timeName(), this->db().time().timeName(),
this->db(), this->db(),
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -61,9 +61,10 @@ then
for slotGroup in $WM_HOSTS for slotGroup in $WM_HOSTS
do do
n=${slotGroup##*:} n=${slotGroup##*:}
if [ "$n" = "${slotGroup%%:*}" ]; then n=1; fi # missing ':' [ "$n" = "${slotGroup%%:*}" ] && n=1 # missing ':'
echo "+ ${n:-1}" echo "+ ${n:-1}"
done) done
)
exit 0 exit 0
fi fi
@ -85,15 +86,16 @@ esac
# check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/ # check ~/.$WM_PROJECT/$WM_PROJECT_VERSION/
# check ~/.$WM_PROJECT/ # check ~/.$WM_PROJECT/
# check <installedProject>/etc/ # check <installedProject>/etc/
if [ "$WM_PROJECT" ]; then if [ "$WM_PROJECT" ]
then
for i in \ for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \ $HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \ $HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \ $WM_PROJECT_DIR/etc \
; ;
do do
if [ -f "$i/$shellRc" ]; then if [ -f "$i/$shellRc" ]
then
sourceFoam="$i/$shellRc" sourceFoam="$i/$shellRc"
break break
fi fi
@ -105,7 +107,8 @@ fi
# attempt to preserve the installation directory 'FOAM_INST_DIR' # attempt to preserve the installation directory 'FOAM_INST_DIR'
case $sourceFoam in case $sourceFoam in
*/bashrc) */bashrc)
if [ "$FOAM_INST_DIR" ]; then if [ "$FOAM_INST_DIR" ]
then
sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam" sourceFoam='[ "$WM_PROJECT" ] || '"FOAM_INST_DIR=$FOAM_INST_DIR . $sourceFoam"
else else
sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam" sourceFoam='[ "$WM_PROJECT" ] || '". $sourceFoam"
@ -125,28 +128,53 @@ rcmd=$(echo $* | sed -e s/\"/\'\"\'/g)
# Convert WM_COLOURS into an array # Convert WM_COLOURS into an array
declare colours declare colourList
nColours=0 nColours=0
for col in $WM_COLOURS for col in $WM_COLOURS
do do
colours[$nColours]=$col colourList[$nColours]=$col
((nColours = $nColours + 1)) ((nColours = $nColours + 1))
done done
# Bashism: make pipe fail early. This make sure return value of compilation # Bashism: make pipe fail early.
# is returned and not of colouring pipe. # This ensures the return value of the command is returned and not of the
# colouring pipe etc.
set -o pipefail set -o pipefail
# Define function to colour output by argument 1
colourPipe(){ #
if [ "$1" ]; then # colour output by argument 1
(while read line; do setterm -foreground $1; echo "$line" ; done; setterm -foreground default) #
colourPipe()
{
if [ "$1" ]
then
(
while read line
do
setterm -foreground $1
echo "$line"
done
setterm -foreground default
)
else else
cat cat
fi fi
} }
#
# prefix message with [HOSTNAME]
#
prefixPipe()
{
while read line
do
echo "[$@] $line"
done
}
colourIndex=0 colourIndex=0
while : while :
@ -156,17 +184,21 @@ do
# split 'host:N', but catch 'host:' and 'host' too # split 'host:N', but catch 'host:' and 'host' too
host=${slotGroup%%:*} host=${slotGroup%%:*}
n=${slotGroup##*:} n=${slotGroup##*:}
if [ "$n" = "$host" ]; then n=1; fi # missing ':' [ "$n" = "$host" ] && n=1 # missing ':'
: ${n:=1} : ${n:=1}
i=0 i=0
while [ "$i" -lt "$n" ] while [ "$i" -lt "$n" ]
do do
lockFile="$lockDir/$host:$i" lockFile="$lockDir/$host:$i"
if lockfile -r0 "$lockFile" 2>/dev/null; then if lockfile -r0 "$lockFile" 2>/dev/null
if [ "$WM_COLOURS" ]; then then
# Set colour if [ "$nColours" -gt 0 ]
colour="${colours[$colourIndex]}" then
# Set colour and index to next colour
colour="${colourList[$colourIndex]}"
colourIndex=$(expr $colourIndex + 1)
[ "$colourIndex" -lt "$nColours" ] || colourIndex=0
if [ "$host" = "$HOST" ]; then if [ "$host" = "$HOST" ]; then
eval $* 2>&1 | colourPipe "$colour" eval $* 2>&1 | colourPipe "$colour"
@ -178,11 +210,11 @@ do
retval=$? retval=$?
else else
if [ "$host" = "$HOST" ]; then if [ "$host" = "$HOST" ]; then
eval $* eval $* 2>&1 | prefixPipe "$host"
elif [ -n "$JOB_ID" ]; then elif [ -n "$JOB_ID" ]; then
qrsh -inherit -v PWD $host "$rcmd" qrsh -inherit -v PWD $host "$rcmd" | prefixPipe "$host"
else else
ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" ssh $host "$sourceFoam 2>/dev/null; cd $PWD && $rcmd" 2>&1 | prefixPipe "$host"
fi fi
retval=$? retval=$?
fi fi
@ -192,19 +224,14 @@ do
exit $retval exit $retval
fi fi
i=$(expr $i + 1) i=$(expr $i + 1)
# Cycle through colours
colourIndex=$(expr $colourIndex + 1)
if (( $colourIndex >= $nColours )); then
colourIndex=0
fi
done done
done done
# Did not find any free slots. Rest a bit. # Did not find any free slots. Rest a bit.
sleep 1 sleep 1
done done
if [ "$WM_COLOURS" ]; then if [ "$nColours" -gt 0 ]
then
setterm -foreground default setterm -foreground default
fi fi