Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MPI_Finalize "detouring" mechanism #765

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ add_subdirectory("src/forcing")
add_subdirectory("src/utilities/mdarray")
add_subdirectory("src/utilities/mdframe")
add_subdirectory("src/utilities/logging")
add_subdirectory("src/utilities/mpi")

if(NGEN_WITH_MPI)
target_link_libraries(ngen PUBLIC NGen::MPI_Detour)
endif()

target_link_libraries(ngen
PUBLIC
Expand Down
4 changes: 2 additions & 2 deletions src/NGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) {
} // if (mpi_rank == 0)

#if NGEN_WITH_MPI
MPI_Finalize();
PMPI_Finalize();
#endif

exit(1);
Expand Down Expand Up @@ -587,7 +587,7 @@ int main(int argc, char *argv[]) {
}

#ifdef NGEN_MPI_ACTIVE
MPI_Finalize();
PMPI_Finalize();
#endif

return 0;
Expand Down
2 changes: 2 additions & 0 deletions src/utilities/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_library(MPIDetour SHARED "${CMAKE_CURRENT_LIST_DIR}/MPIDetour.c")
add_library(NGen::MPI_Detour ALIAS MPIDetour)
3 changes: 3 additions & 0 deletions src/utilities/mpi/MPIDetour.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int MPI_Finalize() {
return 0;
}
Loading