Problem with MPI

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
Posts: 12
Joined: Tue 25 May 2021, 03:38

Problem with MPI

Post by Katrina » Tue 27 Jul 2021, 11:20

Hi,guys.Does openems support MPI? If so, how to use it.?How to compile it into the MPI version of openems? Is there any relevant examples for me to refer to?
Recently, I tried to compile the MPI version, but there seems to be some problems. The first problem is that the compilation log prompt is missing 'mpi. h'.

:/tmp/openEMS/openEMS/FDTD/engine_mpi.h:23:17: fatal error: mpi.h: 没有那个文件或目录
compilation terminated.
CMakeFiles/openEMS.dir/build.make:62: recipe for target 'CMakeFiles/openEMS.dir/openems.cpp.o' failed
make[5]: *** [CMakeFiles/openEMS.dir/openems.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/openEMS.dir/all' failed
make[4]: *** [CMakeFiles/openEMS.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/openEMS.dir/build.make:112: recipe for target 'openEMS-prefix/src/openEMS-stamp/openEMS-build' failed
make[2]: *** [openEMS-prefix/src/openEMS-stamp/openEMS-build] Error 2
CMakeFiles/Makefile2:216: recipe for target 'CMakeFiles/openEMS.dir/all' failed
make[1]: *** [CMakeFiles/openEMS.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

The second problem is that the version of VTK seems incompatible, but the system prompts me that VTK is the highest version at present.

:CMake Warning at CMakeLists.txt:124 (find_package):
Could not find a configuration file for package "VTK" that is compatible
with requested version "6.1".

The following configuration files were considered but not accepted:

/usr/lib/vtk-5.10/VTKConfig.cmake, version: 5.10.1

Posts: 1520
Joined: Mon 27 Jun 2011, 12:26

Re: Problem with MPI

Post by thorsten » Wed 04 Aug 2021, 21:28


MPI was/is possible. But I cannot recommend it. It really is not very useful...
So I think you should first try to run your sim without it. Usually the most speedup can be achieved from optimizing your mesh...


Posts: 12
Joined: Tue 25 May 2021, 03:38

Re: Problem with MPI

Post by Katrina » Thu 05 Aug 2021, 03:58

First of all, thank you very much for your reply. I have tried to compile open EMS without MPI version under Linux, and have run my own example, but my simulation is very large, so I want to try to compile MPI version of open EMS. So you mean, in this case, can I achieve the same acceleration effect as MPI by optimizing the grid? Or under what circumstances is it necessary to use MPI?

Posts: 32
Joined: Thu 02 Jan 2014, 23:22

Re: Problem with MPI

Post by pascal14 » Sat 07 Aug 2021, 22:54

I have already recompiled the code OPENEMS but you must first have the MPI libraries pre-installed:
(see topic :

The benefit of MPI is real on a server made up of NUMA nodes: on my Opetron server with 8 NUMA nodes I had divided by 6 the computation times compared to multithreading alone, thus optimizing the bandwidth of the server .
On a PC with only one socket, in fact, the MPI brings much less advantages.
You have to use a cluster of PCs for the MPI to be interesting.

Posts: 12
Joined: Tue 25 May 2021, 03:38

Re: Problem with MPI

Post by Katrina » Mon 13 Sep 2021, 10:40

First of all, thank you very much for your reply. After reading your post, it seems that I still can't successfully compile the MPI version of openems. If possible, can you give a compilation tutorial and usage method of openmpi. This will be of great help to me and I will be very grateful.

Post Reply