Two engines on one I/O
Created by: germasch
Here's an issue when using a single I/O with two engines attached. It's pretty similar to what adios2_reorganize
does (without actually changing decomposition), so I'd hope this is not a case of me using it wrong.
adios2::Engine reader = io.Open("multi_sync.bp", adios2::Mode::Read);
adios2::Engine writer = io.Open("multi_2f_syncdeferred.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();
I can make a PR if you prefer. Here's what happens:
Input
[kai@macbook build (pr/bug_2file)]$ bin/bpls -dD multi_sync.bp
double var {10}
step 0:
block 0: [0:4]
(0) 0 1 2 3 4
block 1: [5:9]
(0) 5 6 7 8 9
Output
[kai@macbook build (pr/bug_2file)]$ bin/bpls -dD multi_2f_syncdeferred.bp
double var {10}
step 0:
block 0: [5:9]
(0) 5 6 7 8 9