Multi-Node rocshmem_finalize() bug (#138)

[ROCm/rocshmem commit: 3f01d89207]
This commit is contained in:
Yiltan
2025-06-04 10:02:03 -04:00
committed by GitHub
parent 032d5e5c6b
commit bceeadeb63
18 changed files with 175 additions and 237 deletions
@@ -39,11 +39,8 @@ int main(int argc, char *argv[]) {
/***
* Select a GPU
*/
int rank = rocshmem_my_pe();
int ndevices, my_device = 0;
CHECK_HIP(hipGetDeviceCount(&ndevices));
my_device = rank % ndevices;
CHECK_HIP(hipSetDevice(my_device));
char* ompi_local_rank = getenv("OMPI_COMM_WORLD_LOCAL_RANK");
CHECK_HIP(hipSetDevice(atoi(ompi_local_rank)));
/**
* Must initialize rocshmem to access arguments needed by the tester.
@@ -86,7 +86,7 @@ target_sources(
pow2_bins_gtest.cpp
dlmalloc_gtest.cpp
remote_heap_info_gtest.cpp
mpi_init_singleton_gtest.cpp
mpi_instance_gtest.cpp
abql_block_mutex_gtest.cpp
notifier_gtest.cpp
free_list_gtest.cpp
@@ -22,16 +22,16 @@
* IN THE SOFTWARE.
*****************************************************************************/
#include "mpi_init_singleton_gtest.hpp"
#include "mpi_instance_gtest.hpp"
using namespace rocshmem;
TEST_F(MPIInitSingletonTestFixture, library_initialize_destroy) {}
TEST_F(MPIInstanceTestFixture, library_initialize_destroy) {}
TEST_F(MPIInitSingletonTestFixture, rank) {
TEST_F(MPIInstanceTestFixture, rank) {
ASSERT_NO_FATAL_FAILURE(s_ptr_->get_rank());
}
TEST_F(MPIInitSingletonTestFixture, nprocs) {
TEST_F(MPIInstanceTestFixture, nprocs) {
ASSERT_EQ(s_ptr_->get_nprocs(), 4);
}
@@ -22,29 +22,33 @@
* IN THE SOFTWARE.
*****************************************************************************/
#ifndef ROCSHMEM_MPI_INIT_SINGLETON_GTEST_HPP
#define ROCSHMEM_MPI_INIT_SINGLETON_GTEST_HPP
#ifndef ROCSHMEM_MPI_INSTANCE_GTEST_HPP
#define ROCSHMEM_MPI_INSTANCE_GTEST_HPP
#include "gtest/gtest.h"
#include "../src/mpi_init_singleton.hpp"
#include "../src/mpi_instance.hpp"
namespace rocshmem {
class MPIInitSingletonTestFixture : public ::testing::Test
class MPIInstanceTestFixture : public ::testing::Test
{
public:
MPIInitSingletonTestFixture() {
s_ptr_ = s_ptr_->GetInstance();
MPIInstanceTestFixture() {
s_ptr_ = new MPIInstance(MPI_COMM_WORLD);
}
~MPIInstanceTestFixture() {
delete s_ptr_;
}
protected:
/**
* @brief A singleton object used to initialize MPI
* @brief A MPI instance object used to initialize MPI
*/
MPIInitSingleton* s_ptr_ {nullptr};
MPIInstance* s_ptr_ {nullptr};
};
} // namespace rocshmem
#endif // ROCSHMEM_MPI_INIT_SINGLETON_GTEST_HPP
#endif // ROCSHMEM_MPI_INSTANCE_GTEST_HPP