make MPI_Init and MPI_Finalize independent of the test fixtures
Ta zmiana jest zawarta w:
%! (template.HTML=
avinashkethineedi)złożyło 2024-10-01 18:33:36 +00:00
1 rodzic
74ee25817e
złożenie
0f7dc70894
Plik 1 zmieniony
+17
-1
@@ -21,8 +21,24 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
int ret_val = RUN_ALL_TESTS();
|
||||
|
||||
int finalized{0};
|
||||
MPI_Finalized(&finalized);
|
||||
if (!finalized) {
|
||||
MPI_Finalize();
|
||||
}
|
||||
return ret_val;
|
||||
}
|
||||
Reference in new issue
Zablokuj użytkownika