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

Method syncPoint

src/ResultWriter/ReceiverWriter.cpp:157–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void ReceiverWriter::syncPoint(double /*currentTime*/) {
158 if (m_receiverClusters.empty()) {
159 return;
160 }
161
162 m_stopwatch.start();
163
164 for (auto& [layer, clusters] : m_receiverClusters) {
165 for (auto& cluster : clusters) {
166 auto ncols = cluster.ncols();
167 for (auto& receiver : cluster) {
168 assert(receiver.output.size() % ncols == 0);
169 const size_t nSamples = receiver.output.size() / ncols;
170
171 std::ofstream file;
172 file.open(fileName(receiver.pointId), std::ios::app);
173 file << std::scientific << std::setprecision(15);
174 for (size_t i = 0; i < nSamples; ++i) {
175 for (size_t q = 0; q < ncols; ++q) {
176 file << " " << receiver.output[q + i * ncols];
177 }
178 file << std::endl;
179 }
180 file.close();
181 receiver.output.clear();
182 }
183 }
184 }
185
186 auto time = m_stopwatch.stop();
187 const int rank = seissol::MPI::mpi.rank();
188 logInfo(rank) << "Wrote receivers in" << time << "seconds.";
189}
190void ReceiverWriter::init(
191 const std::string& fileNamePrefix,
192 double endTime,

Callers

nothing calls this directly

Calls 8

emptyMethod · 0.80
ncolsMethod · 0.80
stopMethod · 0.80
rankMethod · 0.80
startMethod · 0.45
sizeMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected