Skip to content

Commit

Permalink
initialize MADWorld before TTG to have them share context + tell PaRS…
Browse files Browse the repository at this point in the history
…EC context to use full (WORLD) comm if TTG is used
  • Loading branch information
evaleev committed Nov 1, 2023
1 parent b6617fd commit 5a619b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ endif()
if(ENABLE_HIP)
include(external/hip.cmake)
endif()
include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchMADWorld.cmake)
if (TA_TTG)
include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchTTG.cmake)
endif(TA_TTG)
include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchMADWorld.cmake)
detect_MADNESS_configuration()
include(external/eigen.cmake)
# the FetchContent-based version will not work due to BLT target name conflicts
Expand Down
10 changes: 9 additions & 1 deletion src/TiledArray/tiledarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,16 @@ TiledArray::World& TiledArray::initialize(int& argc, char**& argv,
initialized_accessor() = true;
quiet_accessor() = quiet;

// if have TTG initialize it also
// if have TTG, initialize it also
#if TILEDARRAY_HAS_TTG
// MADNESS/PaRSEC creates PaRSEC context that uses MPI_COMM_SELF to avoid
// creation of a PaRSEC comm thread to be able to use TTG/PaRSEC need to
// tell PaRSEC context to use the full communicator
if (madness::ParsecRuntime::context()->nb_nodes != default_world.size()) {
auto default_world_comm = default_world.mpi.comm().Get_mpi_comm();
parsec_remote_dep_set_ctx(madness::ParsecRuntime::context(),
(intptr_t)default_world_comm);
}
ttg::initialize(argc, argv, -1, madness::ParsecRuntime::context());
#endif

Expand Down

0 comments on commit 5a619b5

Please sign in to comment.