Error while instal G4mpi library

Hello, everyone.
I’m trying to run MPI example exMPI01 on an cluster, so at first i try to install G4mpi library onto the Geant4.10.03.p03 version.
When i’m installing this by instruction from http://www.apc.univ-paris7.fr/~franco/g4doxy4.10/html/md___volumes__work_geant_geant4_810_800_8p01_examples_extended_parallel__m_p_i__r_e_a_d_m_e.html i can see that configurating is done good, but when i’m trying to make, there is error on 71% of make, which you can see on the attached picture, or in the listning below:

[ 71%] Building CXX object CMakeFiles/G4mpi.dir/src/G4MPIscorerMerger.cc.o
/mnt/pool/4/rfibragimov/test/MPI/source/src/G4MPIscorerMerger.cc: In member function ‘void {anonymous}::MPIStatDouble::Pack(void*, int, int*, MPI::Intracomm&) const’:
/mnt/pool/4/rfibragimov/test/MPI/source/src/G4MPIscorerMerger.cc:48:65: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
MPI_Pack(&m_n,1,MPI::INT,buffer,bufferSize,position,comm);
^
/mnt/pool/4/rfibragimov/test/MPI/source/src/G4MPIscorerMerger.cc:50:69: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
MPI_Pack(&data,5,MPI::DOUBLE,buffer,bufferSize,position,comm);
^
/mnt/pool/4/rfibragimov/test/MPI/source/src/G4MPIscorerMerger.cc: In member function ‘void G4MPIscorerMerger::Pack(const G4VScoringMesh*)’:
/mnt/pool/4/rfibragimov/test/MPI/source/src/G4MPIscorerMerger.cc:342:88: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
MPI_Pack(nn,ss,MPI::CHAR,outputBuffer,outputBufferSize,&outputBufferPosition,comm);
^
make[2]: *** [CMakeFiles/G4mpi.dir/src/G4MPIscorerMerger.cc.o] Error 1
make[1]: *** [CMakeFiles/G4mpi.dir/all] Error 2
make: *** [all] Error 2

Do you have any guess what i’m doing wrong or what i can do to fix it?
Thankx in advance.

Based on the output, this looks like OpenMPI 2.1, which unfortunately isn’t supported by the example yet. Per the README for the current production release, the options for the MPI implementation are:

  • OpenMPI 1.8.1
  • MPICH 3.2
  • Intel MPI 5.0.1

so I would see if you can install one of these. If you’re on a cluster supporting MPI, it’s highly likely that one or more of these is available.

The MPI example is in need of maintenance, and longer term integration in the core toolkit. Unfortunately we don’t have the manpower to do this right now.

Thank you for advice, i will try to check it out when i get access to the cluster again, and will tell here about results.

Hi,
I am having some issues while trying to install G4mpi libraries so I thought of posting here. On our cluster, when I type “make”, I get an error message:
error: ‘MPI’ does not name a type; did you mean ‘M_PI’?
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }

On my MacBook (Monterey 12.3.1), I get a similar error:
error: use of undeclared identifier ‘MPI’
const MPI::Intracomm* GetComm() const { return &COMM_G4COMMAND_; }

I would really appreciate any help regarding this.

Which MPI implementation/version is being found/used? G4mpi is no longer actively maintained, and only works with those listed above

I am using geant4 11.0.1 with openmpi-4.1.1. Thanks.

Apologies for the delay in replying - as noted above G4mpi is only known to work with OpenMPI 1.8.1 due to the deprecation of the C++ interface. Unfortunately, we don’t have any available FTE to work on updates or further support for MPI use at the moment.

I was able to install G4mpi libraries using Intel MPI. But I cannot build an example (exMPI04). I tried using the intel MPI compiler wrapper by setting the environment as “export I_MPI_CXX=icpc” but the build fails. I tried other compilers like igxx, icxx etc without success. I am not sure what the issue is so I’m going to attach the error message below. Thank you.

Here’s the build command: cmake -DGeant4_DIR=/path to Geant4-11.0.1 -DG4mpi_DIR=/path to G4mpi-11.0.1 /path to source

– Could NOT find MPI_C (missing: MPI_C_WORKS)
– Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
CMake Error at /usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
Call Stack (most recent call first):
/usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/biotools/cmake/cmake-3.22.2/share/cmake-3.22/Modules/FindMPI.cmake:1830 (find_package_handle_standard_args)
/research/labs/radonc/beltranc/m254407/Particle/MPI/build/lib64/G4mpi-11.0.1/G4mpiConfig.cmake:36 (find_package)
CMakeLists.txt:23 (find_package)

  • You can recompile the openmpi as following:
./configure --prefix=/lustre/software/mpi/openmpi-4.1.4/install --enable-mpi-cxx
 make -j 100
 make install

And then compile the G4mpi like this:

cmake -DGeant4_DIR=/lustre/software/geant4/geant4-11.0.3/install/lib64/Geant4-11.0.3 -DCMAKE_INSTALL_PREFIX=/lustre/software/geant4/geant4-11.0.3/install/share/Geant4-11.0.3/examples/extended/parallel/MPI/install ../source/

The result is:

Hi guys:

I’m trying to compile the G4MPI library for the G4.11.1 installation. I follow the steps described in the README file of the…examples/extended/parallel/MPI/ example, the configure processes ends fine but I get the following error while building the library:

[root@mc build_mpi]# make
Scanning dependencies of target G4mpi
[ 5%] Building CXX object CMakeFiles/G4mpi.dir/src/G4MPIbatch.cc.o
/home/sw/geant4/4111/geant4-v11.1.2/examples/extended/parallel/MPI/source/src/G4MPIbatch.cc: In member function ‘G4String G4MPIbatch::ReadCommand()’:
/home/sw/geant4/4111/geant4-v11.1.2/examples/extended/parallel/MPI/source/src/G4MPIbatch.cc:104:5: error: ‘G4StrUtil’ has not been declared
104 | G4StrUtil::strip(cmdline);
| ^~~~~~~~~
/home/sw/geant4/4111/geant4-v11.1.2/examples/extended/parallel/MPI/source/src/G4MPIbatch.cc:140:3: error: ‘G4StrUtil’ has not been declared
140 | G4StrUtil::strip(cmdtotal);
| ^~~~~~~~~
make[2]: *** [CMakeFiles/G4mpi.dir/src/G4MPIbatch.cc.o] Error 1
make[1]: *** [CMakeFiles/G4mpi.dir/all] Error 2
make: *** [all] Error 2

I’m using the openmpi version 3.1.4.

I have no problem when building this library for the G4.10.7 version.

Can anyone help me to solve this problem?

Thanks in advance,
Mario

I would guess it’s missing a #include "G4String.hh" in G4MPIbatch.cc, so please try adding the in and see if it then resolves things. Let us know and we’ll patch this in.