mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Always have VTK-m tests enable vtkmdiy mpi environment
This commit is contained in:
parent
ced27afc4a
commit
477d225415
@ -27,7 +27,6 @@ function(vtkm_create_test_executable
|
||||
# for MPI tests, suffix test name and add MPI_Init/MPI_Finalize calls.
|
||||
if (is_mpi_test)
|
||||
set(extraArgs EXTRA_INCLUDE "vtkm/thirdparty/diy/environment.h")
|
||||
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "vtkmdiy::mpi::environment env(ac, av);")
|
||||
|
||||
if (use_mpi)
|
||||
vtkm_diy_use_mpi(ON)
|
||||
|
@ -108,6 +108,12 @@ public:
|
||||
template <class Func>
|
||||
static VTKM_CONT int Run(Func function, int& argc, char* argv[])
|
||||
{
|
||||
std::unique_ptr<vtkmdiy::mpi::environment> env_diy = nullptr;
|
||||
if (!vtkmdiy::mpi::environment::initialized())
|
||||
{
|
||||
env_diy.reset(new vtkmdiy::mpi::environment(argc, argv));
|
||||
}
|
||||
|
||||
vtkm::cont::Initialize(argc, argv);
|
||||
ParseAdditionalTestArgs(argc, argv);
|
||||
|
||||
|
@ -358,6 +358,10 @@ void TestArrayHandleSerialization()
|
||||
//-----------------------------------------------------------------------------
|
||||
int UnitTestSerializationArrayHandle(int argc, char* argv[])
|
||||
{
|
||||
// Normally VTK-m `Testing::Run` would setup the diy MPI env,
|
||||
// but since we need to access it before execution we have
|
||||
// to manually set it up
|
||||
vtkmdiy::mpi::environment env(argc, argv);
|
||||
auto comm = vtkm::cont::EnvironmentTracker::GetCommunicator();
|
||||
|
||||
decltype(generator)::result_type seed = 0;
|
||||
|
@ -330,8 +330,5 @@ void TestHistogram()
|
||||
|
||||
int UnitTestHistogramFilter(int argc, char* argv[])
|
||||
{
|
||||
// Setup MPI environment: This test is not intendent to be run in parallel
|
||||
// but filter does make some DIY/MPI calls
|
||||
vtkmdiy::mpi::environment env(argc, argv);
|
||||
return vtkm::cont::testing::Testing::Run(TestHistogram, argc, argv);
|
||||
}
|
||||
|
@ -129,8 +129,5 @@ static void TestPartitionedDataSetHistogram()
|
||||
|
||||
int UnitTestPartitionedDataSetHistogramFilter(int argc, char* argv[])
|
||||
{
|
||||
// Setup MPI environment: This test is not intendent to be run in parallel
|
||||
// but filter does make some DIY/MPI calls
|
||||
vtkmdiy::mpi::environment env(argc, argv);
|
||||
return vtkm::cont::testing::Testing::Run(TestPartitionedDataSetHistogram, argc, argv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user