Open cniethammer opened 4 months ago
Based on the feedback and diving deeper into the MPI standard, I refactored this PR.
Note:
mardyn_exit()
cannot be used, because it uses the Logger internally.MPI_Init()
with MPI_Init_thread()
entirely now. The MPI standard says here 'A call to MPI_INIT has the same effect as a call to MPI_INIT_THREAD with a required = MPI_THREAD_SINGLE." (MPI 4.1 p.486)
If MPI is used in a multi-threaded environment the MPI implementation has to be aware of the calling context of MPI methods. Therefore, initialize the MPI environment with MPI_Init_thread requesting the desired thread support level. So far ls1 makes MPI calls only from the main thread, i.e., uses MPI_THREAD_FUNNELED. For details see the MPI standard.