Skip to content

Commit

Permalink
add 2file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
germasch committed Mar 16, 2019
1 parent adf0be8 commit d3179a8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions testing/adios2/interface/TestADIOSInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,54 @@ TEST_F(ADIOS2_CXX11_API_Put, MultiBlockPutZeroCopySync3)
}
#endif

TEST_F(ADIOS2_CXX11_API_Put, MultiBlockPutTwoFilesSync)

{
SetupDecomposition(10);

adios2::Engine reader = io.Open("multi_sync.bp", adios2::Mode::Read);
adios2::Engine writer = io.Open("multi_2f.bp", adios2::Mode::Write);
adios2::Variable<T> var = io.InquireVariable<T>("var");

MyData<T> myData(m_Selections);

for (int b = 0; b < myData.nBlocks(); ++b)
{
var.SetSelection(myData.selection(b));
reader.Get(var, &myData[b][0], adios2::Mode::Sync);
writer.Put(var, &myData[b][0], adios2::Mode::Sync);
}

reader.Close();
writer.Close();

EXPECT_TRUE(checkOutput("multi_2f.bp"));
}

TEST_F(ADIOS2_CXX11_API_Put, MultiBlockPutTwoFilesSyncDeferred)

{
SetupDecomposition(10);

adios2::Engine reader = io.Open("multi_sync.bp", adios2::Mode::Read);
adios2::Engine writer = io.Open("multi_2f.bp", adios2::Mode::Write);
adios2::Variable<T> var = io.InquireVariable<T>("var");

MyData<T> myData(m_Selections);

for (int b = 0; b < myData.nBlocks(); ++b)
{
var.SetSelection(myData.selection(b));
reader.Get(var, &myData[b][0], adios2::Mode::Sync);
writer.Put(var, &myData[b][0], adios2::Mode::Deferred);
}

reader.Close();
writer.Close();

EXPECT_TRUE(checkOutput("multi_2f.bp"));
}

int main(int argc, char **argv)
{
#ifdef ADIOS2_HAVE_MPI
Expand Down

0 comments on commit d3179a8

Please sign in to comment.