MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / exec

Method exec

src/IO/Writer/Module/AsyncWriter.cpp:21–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 // (do nothing here)
20}
21void AsyncWriter::exec(const async::ExecInfo& info, const AsyncWriterExec& params) {
22 const void* data = info.buffer(PlanId);
23 const size_t size = info.bufferSize(PlanId);
24 const char* strData = reinterpret_cast<const char*>(data);
25
26 int rank = 0;
27 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
28 if (printPlan && rank == 0) {
29 logInfo(rank) << "Printing current plan:" << std::string(strData, strData + size);
30 }
31
32 {
33 // for the Hdf5 implementations, we'll need to serialize writes
34 // (TODO: make one AsyncWriter only in total)
35 const std::lock_guard lock(globalLock);
36 writer = Writer(std::string(strData, strData + size));
37 instance = std::optional(writer.beginWrite(info));
38 // for now write synchronously
39 instance.value().close();
40 instance.reset();
41 }
42}
43void AsyncWriter::execWait(const async::ExecInfo& info) {
44 // TODO: async finalize
45}

Callers

nothing calls this directly

Calls 5

WriterClass · 0.85
beginWriteMethod · 0.80
valueMethod · 0.80
closeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected