mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: non-group-local communicator for MS-MPI (mingw)
- partial revert for 13740de427 (#2158)
MS-MPI does not currently have a MPI_Comm_create_group(),
so keep using MPI_Comm_create() there.
Only affects multi-world simulations.
CONFIG: retain dummy version of libPstream.dll
- retain as libPstream.dll-dummy so that it is available for
manual replacement of the regular libPstream.dll (#2290)
Keep extra copy of libPstream.dll as libPstream.dll-msmpi
(for example) for manual replacement.
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2020 OpenCFD Ltd.
|
# Copyright (C) 2020-2021 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
@ -256,16 +256,25 @@ echo "Third-party libraries in platforms/$targetPlatform$compOptions" >| "$tmpTa
|
|||||||
echo "Copy common files" 1>&2
|
echo "Copy common files" 1>&2
|
||||||
rsync -a --exclude .gitignore COPYING META-INFO README.md bin etc "$tmpTarget"
|
rsync -a --exclude .gitignore COPYING META-INFO README.md bin etc "$tmpTarget"
|
||||||
|
|
||||||
if [ -n "$FOAM_CONFIG_ETC" ]
|
# Remove branch info (probably spurious)
|
||||||
|
if [ -f "$tmpTarget/META-INFO/build-info" ]
|
||||||
then
|
then
|
||||||
etcDir="${FOAM_CONFIG_ETC##*/}"
|
sed -i -e '/^branch=/d' "$tmpTarget/META-INFO/build-info"
|
||||||
if [ "$WM_PROJECT_DIR/$etcDir" = "$FOAM_CONFIG_ETC" ]
|
fi
|
||||||
then
|
|
||||||
echo "Copy additional config dir: $etcDir" 1>&2
|
# One-level only?
|
||||||
rsync -a "$etcDir" "$tmpTarget"
|
configEtcDir="${FOAM_CONFIG_ETC##*/}"
|
||||||
else
|
if [ -n "$configEtcDir" ]
|
||||||
|
then
|
||||||
|
case "$FOAM_CONFIG_ETC" in
|
||||||
|
("$configEtcDir" | "$WM_PROJECT_DIR/$configEtcDir")
|
||||||
|
echo "Copy config dir: $configEtcDir" 1>&2
|
||||||
|
rsync -a "$configEtcDir" "$tmpTarget"
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
echo "Do not know how to copy additional config dir: $FOAM_CONFIG_ETC" 1>&2
|
echo "Do not know how to copy additional config dir: $FOAM_CONFIG_ETC" 1>&2
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
else
|
else
|
||||||
echo "No additional config dir" 1>&2
|
echo "No additional config dir" 1>&2
|
||||||
fi
|
fi
|
||||||
@ -295,12 +304,27 @@ rsync -a "$root"/bin/*.exe "$root"/lib/*.dll "$binDir"
|
|||||||
|
|
||||||
# Pstream .dll into bin directory
|
# Pstream .dll into bin directory
|
||||||
other="$root/lib/$FOAM_MPI"
|
other="$root/lib/$FOAM_MPI"
|
||||||
if [ -d "$other" ] && [ -n "$FOAM_MPI" ]
|
if [ -d "$other" ] && [ -n "$FOAM_MPI" ] && [ "$FOAM_MPI" != dummy ]
|
||||||
then
|
then
|
||||||
echo "Copy ($FOAM_MPI) libPstream.dll -> platforms bin/" 1>&2
|
echo "Copy ($FOAM_MPI) *.dll -> platforms bin/" 1>&2
|
||||||
rsync -a "$other"/*.dll "$binDir"
|
rsync -a "$other"/*.dll "$binDir"
|
||||||
|
|
||||||
|
ending="$(echo "$FOAM_MPI" | tr '[:upper:]' '[:lower:]' | sed -e 's/[^A-Za-z].*//')"
|
||||||
|
[ -n "$ending" ] || continue
|
||||||
|
|
||||||
|
for name in libPstream.dll
|
||||||
|
do
|
||||||
|
if [ -f "$other/$name" ]
|
||||||
|
then
|
||||||
|
# Keep duplicate for manual replacement if needed
|
||||||
|
newName="$name-$ending"
|
||||||
|
echo " [copy] $FOAM_MPI/$name -> $newName" 1>&2
|
||||||
|
cp -p "$other/$name" "$binDir/$newName"
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Various dummy (stub) libraries
|
# Various dummy (stub) libraries
|
||||||
other="$root/lib/dummy"
|
other="$root/lib/dummy"
|
||||||
if [ -d "$other" ]
|
if [ -d "$other" ]
|
||||||
@ -308,16 +332,25 @@ then
|
|||||||
echo "Copy (dummy) *.dll -> platforms bin/" 1>&2
|
echo "Copy (dummy) *.dll -> platforms bin/" 1>&2
|
||||||
for fullpath in "$other"/*.dll
|
for fullpath in "$other"/*.dll
|
||||||
do
|
do
|
||||||
|
[ -f "$fullpath" ] || continue;
|
||||||
name="${fullpath##*/}"
|
name="${fullpath##*/}"
|
||||||
if [ -f "$fullpath" ]
|
|
||||||
|
if [ -f "$binDir/$name" ]
|
||||||
then
|
then
|
||||||
if [ -f "$binDir/$name" ]
|
case "$name" in
|
||||||
then
|
(libPstream*)
|
||||||
echo " [skip dummy/$name]" 1>&2
|
# Keep for manual replacement if needed
|
||||||
else
|
newName="$name-dummy"
|
||||||
echo " dummy/$name" 1>&2
|
echo " [copy] dummy/$name -> $newName" 1>&2
|
||||||
cp -p "$fullpath" "$binDir"
|
cp -p "$fullpath" "$binDir/$newName"
|
||||||
fi
|
;;
|
||||||
|
(*)
|
||||||
|
echo " [skip] dummy/$name" 1>&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo " dummy/$name" 1>&2
|
||||||
|
cp -p "$fullpath" "$binDir"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1216,6 +1216,15 @@ void Foam::UPstream::allocatePstreamCommunicator
|
|||||||
&PstreamGlobals::MPIGroups_[index]
|
&PstreamGlobals::MPIGroups_[index]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if defined(MSMPI_VER)
|
||||||
|
// ms-mpi (10.0 and others?) does not have MPI_Comm_create_group
|
||||||
|
MPI_Comm_create
|
||||||
|
(
|
||||||
|
PstreamGlobals::MPICommunicators_[parentIndex],
|
||||||
|
PstreamGlobals::MPIGroups_[index],
|
||||||
|
&PstreamGlobals::MPICommunicators_[index]
|
||||||
|
);
|
||||||
|
#else
|
||||||
// Create new communicator for this group
|
// Create new communicator for this group
|
||||||
MPI_Comm_create_group
|
MPI_Comm_create_group
|
||||||
(
|
(
|
||||||
@ -1224,6 +1233,7 @@ void Foam::UPstream::allocatePstreamCommunicator
|
|||||||
Pstream::msgType(),
|
Pstream::msgType(),
|
||||||
&PstreamGlobals::MPICommunicators_[index]
|
&PstreamGlobals::MPICommunicators_[index]
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (PstreamGlobals::MPICommunicators_[index] == MPI_COMM_NULL)
|
if (PstreamGlobals::MPICommunicators_[index] == MPI_COMM_NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user