Skip to content

Commit ca1b65e

Browse files
committed
add MPI support
Signed-off-by: Thorsten Liebig <[email protected]>
1 parent 5e48977 commit ca1b65e

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ ExternalProject_Add( CSXCAD
4040
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DFPARSER_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
4141
)
4242

43+
message(STATUS "with MPI: ${WITH_MPI}" )
4344
# build openEMS
4445
ExternalProject_Add( openEMS
4546
DEPENDS fparser CSXCAD
4647
SOURCE_DIR ${PROJECT_SOURCE_DIR}/openEMS
47-
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DFPARSER_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -DCSXCAD_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
48+
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DFPARSER_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -DCSXCAD_ROOT_DIR=${CMAKE_INSTALL_PREFIX} -DWITH_MPI=${WITH_MPI} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
4849
)
4950

5051
if (${BUILD_APPCSXCAD})

readme.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,21 @@ sudo apt-get install octave liboctave-dev
3535
sudo apt-get install gengetopt help2man groff pod2pdf bison flex libhpdf-dev libtool
3636
```
3737

38+
+ Optional: For MPI support:<br />
39+
```bash
40+
sudo apt-get install libopenmpi-dev
41+
```
42+
3843
## Clone, build and install
3944
+ Clone this repository, build openEMS and install e.g. to "~/opt/openEMS":<br />
4045
```bash
4146
git clone --recursive https://github.com/thliebig/openEMS-Project.git
4247
cd openEMS-Project
4348
./update_openEMS.sh ~/opt/openEMS
4449
```
45-
or including [hyp2mat](https://github.com/koendv/hyp2mat) and [CTB](https://github.com/thliebig/CTB):<br />
50+
or including [hyp2mat](https://github.com/koendv/hyp2mat) and [CTB](https://github.com/thliebig/CTB) and MPI:<br />
4651
```bash
47-
./update_openEMS.sh ~/opt/openEMS --with-hyp2mat --with-CTB
52+
./update_openEMS.sh ~/opt/openEMS --with-hyp2mat --with-CTB --with-MPI
4853
```
4954

5055
+ Add the given paths to your Octave/Matlab environment (e.g.):<br />

update_openEMS.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ then
1313
echo " --with-hyp2mat: enable hyp2mat build"
1414
echo " --with-CTB enable circuit toolbox"
1515
echo " --disable-GUI disable GUI build (AppCSXCAD)"
16+
echo " --with-MPI enable MPI"
1617
exit $E_BADARGS
1718
fi
1819

1920
# defaults
2021
BUILD_HYP2MAT=0
2122
BUILD_CTB=0
2223
BUILD_GUI="YES"
24+
WITH_MPI=0
2325

2426
# parse arguments
2527
for varg in ${@:2:$#}
@@ -37,6 +39,10 @@ do
3739
echo "disabling AppCSXCAD build"
3840
BUILD_GUI="NO"
3941
;;
42+
"--with-MPI")
43+
echo "enabling MPI"
44+
WITH_MPI=1
45+
;;
4046
*)
4147
echo "error, unknown argumennt: $varg"
4248
exit 1
@@ -100,7 +106,7 @@ cd ..
100106
##### build openEMS and dependencies ####
101107
tmpdir=`mktemp -d` && cd $tmpdir
102108
echo "running cmake in tmp dir: $tmpdir"
103-
cmake -DBUILD_APPCSXCAD=$BUILD_GUI -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $basedir >> $LOG_FILE
109+
cmake -DBUILD_APPCSXCAD=$BUILD_GUI -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH -DWITH_MPI=$WITH_MPI $basedir >> $LOG_FILE
104110
if [ $? -ne 0 ]; then
105111
echo "cmake failed"
106112
cd $basedir

0 commit comments

Comments
 (0)