cdslaborg / paramonte

ParaMonte: Parallel Monte Carlo and Machine Learning Library for Python, MATLAB, Fortran, C++, C.
https://www.cdslab.org/paramonte
Other
273 stars 33 forks source link

General: How to run in parallel? #10

Closed milancurcic closed 3 years ago

milancurcic commented 3 years ago

I'm playing with the example provided with the binary release (libparamonte_fortran_linux_x64_gnu_release_dynamic_heap_openmpi) and I'm not clear how to run in parallel.

In serial mode things seem okay. However, if I do:

./run.sh -n 2

I get this message in stdout (among others):

        ParaDRAM - NOTE: ParaDRAM is being used in parallel mode but with only one processor. This is computationally inefficient. 
        ParaDRAM - NOTE: Consider using the serial version of the code or provide more processes at runtime if it is beneficial.

I get the same result if I change the number of processes, or if I run the program directly, mpiexec -n 2 ./main.exe.

In reference to https://github.com/openjournals/joss-reviews/issues/2741

shahmoradi commented 3 years ago

Milan, thanks for raising this issue. The message you have copied in the above implies that you are not running the executable in parallel, rather, multiple copies of the program are being executed serially. The only other scenario that could lead to such a message being printed on the screen, is when an MPI parallelized sampler is used with only a single processor, like: ./run.sh -n 1.

Another scenario that can cause an MPI-parallelized program to not properly run in parallel is when an OpenMPI-parallelized executable is invoked via an MPICH mpiexec launcher and vice versa. Can you make confirm that you are indeed using the OpenMPI mpiexec launcher with a libparamonte_* library compiled with OpenMPI? I have tested all binaries on the release page on multiple Linux platforms and so far, not seen any problems, as long as both the mpiexec and the MPI library version and brand (MPICH / OpenMPI) match the ones used to build the binaries. The MPI library versions are mentioned on the release page. To get the MPI library version, try,

mpiexec --version

on the command line.

shahmoradi commented 3 years ago

Hi @milancurcic, since there have been no activities on this thread for a while, I assume the issue is now resolved and close it. If there are still ongoing problems relevant to this issue, feel free to reopen it and expand on it further. Thanks!

milancurcic commented 3 years ago

Thank you for the nudge @shahmoradi and sorry for not acting sooner. I will give this one more try now from a fresh start, and compare MPI versions.

milancurcic commented 3 years ago

Okay, all good, I just tried it and don't have the issue that I had before.