Merge pull request #33 from avinashkethineedi/CI/CD

make MPI_Init and MPI_Finalize independent of the test fixtures

[ROCm/rocshmem commit: 64bc3c350a]
Tá an tiomantas seo le fáil i:
Avinash Kethineedi
2024-10-01 15:08:27 -05:00
tiomanta ag GitHub
tuismitheoir 4fdf238737 285ac5cab6
tiomantas 5fd890650e
+20 -1
Féach ar an gComhad
@@ -21,8 +21,27 @@
*****************************************************************************/
#include "gtest/gtest.h"
#include <mpi.h>
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
int initialized;
MPI_Initialized(&initialized);
if (!initialized) {
int provided;
MPI_Init_thread(nullptr, nullptr, MPI_THREAD_MULTIPLE, &provided);
if (provided != MPI_THREAD_MULTIPLE) {
std::cerr << "MPI_THREAD_MULTIPLE support disabled.\n";
}
}
int ret_val = RUN_ALL_TESTS();
int finalized{0};
MPI_Finalized(&finalized);
if (!finalized) {
MPI_Finalize();
}
return ret_val;
}