Skip to content

Commit

Permalink
Merge pull request #501 from ValeevGroup/asadchev/bugfix/mpi
Browse files Browse the repository at this point in the history
Fix issues wrt MPICH
  • Loading branch information
asadchev authored Mar 4, 2025
2 parents df1a8a6 + 5fbdbec commit 3b1e3af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 4 additions & 2 deletions cmake/modules/FindOrFetchMADWorld.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ if (NOT TARGET MADworld)

# look for C and MPI here to make troubleshooting easier and be able to override defaults for MADNESS
enable_language(C)
find_package(MPI REQUIRED COMPONENTS C CXX)
find_package(MPI REQUIRED COMPONENTS C)

set(FETCHCONTENT_QUIET FALSE)
include(FetchContent)
FetchContent_Declare(
MADNESS
GIT_REPOSITORY https://github.com/m-a-d-n-e-s-s/madness.git
GIT_REPOSITORY https://github.com/m-a-d-n-e-s-s/madness.git
GIT_TAG ${TA_TRACKED_MADNESS_TAG}
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(MADNESS)
FetchContent_GetProperties(MADNESS
Expand Down
9 changes: 3 additions & 6 deletions python/src/TiledArray/python/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ static World &initialize() {
// this loads MPI before TA tries to do it
int initialized = 0;
MPI_Initialized(&initialized);
MPI_Comm ta_comm;

if (!initialized) {
ta_comm = MPI_COMM_WORLD;
} else {
if (initialized) {
int thread_level;
MPI_Query_thread(&thread_level);
if (thread_level != MPI_THREAD_MULTIPLE)
Expand All @@ -58,10 +55,10 @@ static World &initialize() {
char *_argv[0];
char **argv = _argv;
if (!madness::initialized()) {
madness::initialize(argc, argv, ta_comm);
madness::initialize(argc, argv);
initialized_madness = true;
}
TiledArray::World &world = TiledArray::initialize(argc, argv, ta_comm);
TiledArray::World &world = TiledArray::initialize(argc, argv, MPI_COMM_WORLD);
TiledArray::set_default_world(world);
if (world.rank() == 0) {
std::cout << "initialized TA in a world with " << world.size() << " ranks"
Expand Down

0 comments on commit 3b1e3af

Please sign in to comment.