forked from SCOREC/redev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil_support.h
31 lines (28 loc) · 1002 Bytes
/
util_support.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include <adios2.h>
#include <string>
#include <cassert>
namespace support{
void openEnginesBP4(bool isRendezvous, std::string c2sName, adios2::IO& c2sIO, adios2::Engine& c2sEngine) {
//create the engine writers at the same time - BP4 does not wait for the readers (SST does)
if(!isRendezvous) {
c2sEngine = c2sIO.Open(c2sName, adios2::Mode::Write);
assert(c2sEngine);
}
//create engines for reading
if(isRendezvous) {
c2sEngine = c2sIO.Open(c2sName, adios2::Mode::Read);
assert(c2sEngine);
}
}
void openEnginesSST(bool isRendezvous, std::string c2sName, adios2::IO& c2sIO, adios2::Engine& c2sEngine) {
//create one engine's reader and writer pair at a time - SST blocks on open(read)
if(isRendezvous) {
c2sEngine = c2sIO.Open(c2sName, adios2::Mode::Read);
assert(c2sEngine);
} else {
c2sEngine = c2sIO.Open(c2sName, adios2::Mode::Write);
assert(c2sEngine);
}
}
} //end anonymous namespace