Multi-Node rocshmem_finalize() bug (#138)
[ROCm/rocshmem commit: 3f01d89207]
This commit is contained in:
@@ -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
|
||||
|
||||
+4
-4
@@ -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);
|
||||
}
|
||||
+13
-9
@@ -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
|
||||
Reference in New Issue
Block a user