bertdupe / Matjes

MC and SD
GNU General Public License v3.0
6 stars 2 forks source link

failed to initialize MPI #66

Closed bertdupe closed 3 years ago

bertdupe commented 3 years ago

with module 1) impi/18.0.2 2) gnuplot/5.2.0 3) os/el7 4) mkl/18.0.2 5) gcc/10.2.1 6) cmake/3.13.3 7) fftw/3.3.8 8) intel/21.2.0

with intel compiler, the code does not run and the error message failed to initialize MPI with MPI_THREAD_FUNNELED

and the beginning of the dpi processes

patrick432 commented 3 years ago

Try with disabled openMP. I think that happend when the MPI Implementation does not support openMP hybrid parallelization.

bertdupe commented 3 years ago

Thanks Patrick but it does not seem to be the case.

patrick432 commented 3 years ago

Can you show me the config.cmake file?

bertdupe commented 3 years ago

module load os/el7 mkl/18.0.2 impi/18.0.2 gcc/10.2.1 cmake/3.13.3 fftw/3.3.8 intel/21.2.0

manually set compiler

set(CMAKE_CXX_COMPILER "mpiicc") set(CMAKE_Fortran_COMPILER "mpiifort")

set faster release flags

set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fno-protect-parens") set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -march=native -mtune=intel")

include_directories( /usr/lib64/ ) #FFTW directory include

set(FFTW3_INC $ENV{FFTW_HOME}) set(add_inc ${add_inc} "${FFTW3_INC}/include" )

set(USE_CUDA FALSE) set(USE_EIGEN FALSE) set(USE_MKL TRUE)

set(MKL_linker "-Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl") set(CMAKE_CUDA_ARCHITECTURES 75)

MANUALLY SET PREPROCESSOR FLAGS

add_compile_definitions(CPP_FFTW3) add_compile_definitions(CPP_MPI) add_compile_definitions(CPP_MRG) add_compile_definitions(CPP_BLAS)

add_compile_definitions(CPP_DEBUG)

patrick432 commented 3 years ago

Looking at the line MKL linker like it looks like you are trying to compile MKL with OpenMP (-lgomp) which could cause the problem as described above. You should probably set the mkl linker as descibed here with the sequential version which will have something like -mkl=sequential.

To quickly check that you could also disable mkl for testing.

Also it should no lonker be necessary to use

add_compile_definitions(CPP_FFTW3)
add_compile_definitions(CPP_BLAS)

which should be detected automatically.

bertdupe commented 3 years ago

that did not help `#module load os/el7 mkl/18.0.2 impi/18.0.2 gcc/10.2.1 cmake/3.13.3 fftw/3.3.8 intel/21.2.0

manually set compiler

set(CMAKE_CXX_COMPILER "mpiicc") set(CMAKE_Fortran_COMPILER "mpiifort")

set faster release flags

set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fno-protect-parens -mkl=sequential") set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -march=native -mtune=intel -mkl=sequential")

include_directories( /usr/lib64/ ) #FFTW directory include

set(FFTW3_INC $ENV{FFTW_HOME}) set(add_inc ${add_inc} "${FFTW3_INC}/include" )

set(USE_CUDA FALSE) set(USE_EIGEN FALSE) set(USE_MKL TRUE)

set(MKL_linker "-Wl,--no-as-needed -lmkl_sequential -lmkl_intel_lp64 -lmkl_core -lm -ldl") set(CMAKE_CUDA_ARCHITECTURES 75)

MANUALLY SET PREPROCESSOR FLAGS

add_compile_definitions(CPP_FFTW3) add_compile_definitions(CPP_MPI) add_compile_definitions(CPP_MRG) add_compile_definitions(CPP_BLAS)

add_compile_definitions(CPP_DEBUG)

`

patrick432 commented 3 years ago

Ah yes, looking at the code it at src/parallelization/mpi_start_end.f90 I see that I automatically stop if funneled is not supported, but I think that is only necessary if one has openMP parallelization.

You should be able to make the check only if the is compiler with openMP using the !$OMP pragmas and then use the usual MPI_INIT.

bertdupe commented 3 years ago

it solves the problem but it seems that you have more mpi_thread commands in there. It seems that the beast create problem... Or it is a problem of cluster.

patrick432 commented 3 years ago

I can only find that call with mpi_thread and I am not really sure what you mean with beast.

Maybe it helps if you tell me what you want to do.

bertdupe commented 3 years ago

sorry bcast not beast... This orthography corrector is annoying. Anyway, it could be because I am on a cluster as well and therefore I am not allowed to run MPI on the gate. Let see if the user manages when he runs the code via SLURM.

bertdupe commented 3 years ago

the problem is solved. Thanks