Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Otf2LibWrapper.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Otf2LibWrapper.cc (C) 2000-2025 */
9/* */
10/* Class that encapsulates the useful functions of the Otf2 library. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/std/internal/Otf2LibWrapper.h"
15
16#include "arcane/utils/Collection.h"
17#include "arcane/utils/ITraceMng.h"
18#include "arcane/utils/FatalErrorException.h"
19
20#include "arcane/core/IDirectory.h"
21#include "arcane/core/IParallelMng.h"
22#include "arcane/core/ITimeLoopMng.h"
23#include "arcane/core/IEntryPoint.h"
24#include "arcane/core/IApplication.h"
25
26#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
27#include "arccore/message_passing_mpi/internal/MessagePassingMpiEnum.h"
28#include "arccore/base/PlatformUtils.h"
29
30#include <otf2/OTF2_MPI_Collectives.h>
31#include <numeric>
32#include <filesystem>
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37using namespace Arccore::MessagePassing::Mpi;
38
39namespace Arcane
40{
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
52Otf2LibWrapper(ISubDomain* sub_domain)
53: m_sub_domain(sub_domain)
54{
55 m_flush_callbacks.otf2_pre_flush = _preFlush;
56 m_flush_callbacks.otf2_post_flush = _postFlush;
57}
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
65{
66 // Close the archive
67 if (m_archive)
68 OTF2_Archive_Close(m_archive);
69}
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
76init(const String& archive_name)
77{
78 // Alias on the MPI comm
79 MPI_Comm* mpi_comm((MPI_Comm*)m_sub_domain->parallelMng()->getMPICommunicator());
80 if (!mpi_comm)
81 ARCANE_FATAL("Impossible d'initialiser la librairie Otf2 sans communicateur MPI");
82
83 // Initialization of the array of participants in the comm (i.e., the sub-domain IDs, etc.)
84 m_comm_members.resize(m_sub_domain->nbSubDomain());
85 std::iota(m_comm_members.begin(), m_comm_members.end(), 0);
86
87 // Check for the existence of files and delete them if necessary
88 String dir_name(m_sub_domain->listingDirectory().path() + "/" + archive_name);
89 String otf2_name(dir_name + ".otf2");
90 String def_name(dir_name + ".def");
91 if (m_sub_domain->parallelMng()->isMasterIO() && std::filesystem::exists(dir_name.localstr())) {
92 std::filesystem::remove_all(dir_name.localstr());
93 std::filesystem::remove_all(otf2_name.localstr());
94 std::filesystem::remove_all(def_name.localstr());
95 }
96 // Sync before opening
97 MPI_Barrier(*mpi_comm);
98
99 // Save the start time to synchronize the recordings of each MPI rank
101
102 // Open the archive
103 m_archive = OTF2_Archive_Open(m_sub_domain->listingDirectory().path().localstr(),
104 archive_name.localstr(), OTF2_FILEMODE_WRITE,
105 1024 * 1024 /* event chunk size */,
106 4 * 1024 * 1024 /* def chunk size */,
107 OTF2_SUBSTRATE_POSIX, OTF2_COMPRESSION_NONE);
108 if (!m_archive)
109 ARCANE_FATAL("Impossible de creer l'archive OTF2");
110
111 // Attaching the callbacks
112 OTF2_Archive_SetFlushCallbacks(m_archive, &m_flush_callbacks, NULL);
113 if (OTF2_MPI_Archive_SetCollectiveCallbacks(m_archive, *mpi_comm, MPI_COMM_NULL) != OTF2_SUCCESS)
114 ARCANE_FATAL("Probleme lors du positionnement des callbacks MPI pour la librairie OTF2");
115
116 // Initialize event files (not yet created)
117 OTF2_Archive_OpenEvtFiles(m_archive);
118
119 // Initialize the event writer
120 m_evt_writer = OTF2_Archive_GetEvtWriter(m_archive, m_sub_domain->subDomainId());
121
122 // Creation of IDs for the archive definitions
124
125 // DBG test of the set content
126 /*
127 m_sub_domain->traceMng()->info() << "===== EntryPointIdSet =====";
128 for (auto i : m_id.m_ep_id_set)
129 m_sub_domain->traceMng()->info() << "{" << i.m_name << ", " << i.m_id << "}";
130 */
131}
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
138finalize()
139{
140 // Alias on the comm
141 MPI_Comm* mpi_comm((MPI_Comm*)m_sub_domain->parallelMng()->getMPICommunicator());
142
143 // Save the end time to synchronize the recordings of each MPI rank
144 uint64_t epoch_end(getTime());
145
146 // Close what is related to events
147 OTF2_Archive_CloseEvtWriter(m_archive, m_evt_writer);
148 OTF2_Archive_CloseEvtFiles(m_archive);
149
150 // Temporary storage to retrieve global timings
151 uint64_t sync_epoch;
152
153 // Exchanges to get the global time window
154 // Smallest time for the start
155 /*
156 MPI_Reduce(&m_epoch_start, &sync_epoch, 1, OTF2_MPI_UINT64_T, MPI_MIN,
157 m_sub_domain->parallelMng()->masterIORank(), *mpi_comm);
158 std::swap(m_epoch_start, sync_epoch);
159 */
160 // Largest time for the end
161 MPI_Reduce(&epoch_end, &sync_epoch, 1, OTF2_MPI_UINT64_T, MPI_MAX,
162 m_sub_domain->parallelMng()->masterIORank(), *mpi_comm);
163 std::swap(epoch_end, sync_epoch);
164
165 // We finish creating the definitions for the archive
166 //_buildOtf2ClockAndStringDefinition(m_epoch_start, epoch_end);
171 _buildOtf2GroupAndCommDefinition(); // The effective writing happens in this method
172
173 // Sync before closing
174 MPI_Barrier(*mpi_comm);
175
176 // Close the archive file
177 OTF2_Archive_Close(m_archive);
178 m_archive = nullptr;
179}
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
183
186OTF2_EvtWriter* Otf2LibWrapper::
188{
189 ++m_evt_nb;
190 return m_evt_writer;
191}
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
198getEntryPointId(const String& ep_name) const
199{
200 auto id(m_id.m_ep_id_set.find(ep_name));
201 if (id == m_id.m_ep_id_set.end())
202 ARCANE_FATAL(String("Impossible de trouver le point d'entree ") + ep_name);
203 return id->m_id;
204}
205
206/*---------------------------------------------------------------------------*/
207/*---------------------------------------------------------------------------*/
208
211getMpiRank() const
212{
213 return m_sub_domain->subDomainId();
214}
215
216/*---------------------------------------------------------------------------*/
217/*---------------------------------------------------------------------------*/
218
221getMpiNbRank() const
222{
223 return m_sub_domain->nbSubDomain();
224}
225
226/*---------------------------------------------------------------------------*/
227/*---------------------------------------------------------------------------*/
228
232{
233 return m_id.m_app_name;
234}
235
236/*---------------------------------------------------------------------------*/
237/*---------------------------------------------------------------------------*/
238
241getSynchronizeId() const
242{
243 return m_id.m_sync_id;
244}
245
246/*---------------------------------------------------------------------------*/
247/*---------------------------------------------------------------------------*/
248
250OTF2_TimeStamp Otf2LibWrapper::
251getTime()
252{
253 // We use MPI_Wtime to get timestamps for our events but need to convert the seconds to an integral value.
254 // We use a nano second resolution.
255 double t(MPI_Wtime() * 1e9);
256 return (uint64_t)t - Otf2LibWrapper::s_epoch_start;
257}
258
259/*---------------------------------------------------------------------------*/
260/*---------------------------------------------------------------------------*/
261
263OTF2_FlushType Otf2LibWrapper::
264_preFlush([[maybe_unused]] void* user_data, [[maybe_unused]] OTF2_FileType file_type,
265 [[maybe_unused]] OTF2_LocationRef location, [[maybe_unused]] void* caller_data,
266 [[maybe_unused]] bool final)
267{
268 // The pre flush callback is triggered right before a buffer flush.
269 // It needs to return either OTF2_FLUSH to flush the recorded data to a file
270 // or OTF2_NO_FLUSH to suppress flushing data to a file
271 return OTF2_FLUSH;
272}
273
274/*---------------------------------------------------------------------------*/
275/*---------------------------------------------------------------------------*/
276
278OTF2_TimeStamp Otf2LibWrapper::
279_postFlush([[maybe_unused]] void* user_data, [[maybe_unused]] OTF2_FileType file_type,
280 [[maybe_unused]] OTF2_LocationRef location)
281{
282 // The post flush callback is triggered right after a memory buffer flush.
283 // It has to return a current timestamp which is recorded to mark the time spend in a buffer flush
284 return getTime();
285}
286
287/*---------------------------------------------------------------------------*/
288/*---------------------------------------------------------------------------*/
294{
295 // The IDs of the MPI operation names are linked to the enum value
296 // Their description is offset accordingly
297 // We use a counter to increment the identifiers
298 u_int32_t offset(static_cast<uint32_t>(eMpiName::NameOffset));
299 m_id.m_desc_offset = offset;
300
301 // We continue with the rest; I haven't found a brilliant idea for a smart index...
302 offset *= 2;
303 // Empty string: 2 x eMpiName::NameOffset
304 m_id.m_empty_id = offset++;
305 // CPU thread name mapped to the MPI process: 2 x eMpiName::NameOffset + 1
306 m_id.m_thread_id = offset++;
307 // Machine name: 2 x eMpiName::NameOffset + 2
308 m_id.m_hostname_id = offset++;
309 // Machine class... not inspired...: 2 x eMpiName::NameOffset + 3
310 m_id.m_class_id = offset++;
311 // MPI Communicator: 2 x eMpiName::NameOffset + 4
312 m_id.m_comm_world_id = offset++;
313 // MPI: 2 x eMpiName::NameOffset + 5
314 m_id.m_mpi_id = offset++;
315 // Comm ID: 2 x eMpiName::NameOffset + 6
316 m_id.m_comm_id = offset++;
317 // Win ID: 2 x eMpiName::NameOffset + 7
318 m_id.m_win_id = offset++;
319 // MPI_COMM_SELF: 2 x eMpiName::NameOffset + 8
320 m_id.m_comm_self_id = offset++;
321 // Entry Point: 2 x eMpiName::NameOffset + 9
322 m_id.m_ep_id = offset++;
323 // Synchronize: 2 x eMpiName::NameOffset + 10
324 m_id.m_sync_id = offset++;
325 // Application name: 2 x eMpiName::NameOffset + 11
326 m_id.m_app_name = offset++;
327 // We continue with the MPI rank names: starting from 2 x eMpiName::NameOffset + 12
328 m_id.m_rank_offset = offset;
329 offset += m_sub_domain->nbSubDomain();
330
331 // We finish with the entry points: starting from 2 x eMpiName::NameOffset + 12 + nbSubDomain()
332 for (auto i : m_sub_domain->timeLoopMng()->usedTimeLoopEntryPoints()) {
333 // We add the entry point reference to the table
334 // NOTE: The ID used must be identical to the one in Otf2MessagePassingProfilingService
335 m_id.m_ep_id_set.emplace(EntryPointId(i->fullName(), offset));
336 // We increment for everyone
337 offset++;
338 }
339}
340
341/*---------------------------------------------------------------------------*/
342/*---------------------------------------------------------------------------*/
343
348_buildOtf2ClockAndStringDefinition(uint64_t global_start_time, uint64_t global_end_time)
349{
350 /*
351 * Only the sub-domain responsible for I/Os will fill this OTF2 structure
352 * (because we don't know much about what's underneath, but probably too many chars*)
353 * and to be consistent with the identifiers associated with the entry point names, we communicate the start of the entry point IDs.
354 */
355
356 // Only the responsible sub-domain writes the otf2 archive
357 if (!m_sub_domain->parallelMng()->isMasterIO())
358 return;
359
360 // Retrieval of the writer
361 m_global_def_writer = OTF2_Archive_GetGlobalDefWriter(m_archive);
362
363 // Definition of temporal properties
364 // A new argument is available starting from version 3.0. It is the last argument
365 // * @param realtimeTimestamp A realtime timestamp of the `globalOffset` timestamp
366 // * in nanoseconds since 1970-01-01T00:00 UTC. Use
367 // * @eref{OTF2_UNDEFINED_TIMESTAMP} if no such
368 // * timestamp exists. Since version 3.0.
369 OTF2_GlobalDefWriter_WriteClockProperties(m_global_def_writer, 1000000000,
370 global_start_time, global_end_time - global_start_time + 1
371#if OTF2_VERSION_MAJOR >= 3
372 ,
373 OTF2_UNDEFINED_TIMESTAMP
374#endif
375 );
376
377 // Definition of all names that will appear in tools capable of reading the otf2 archive
378 // We start with the names of the MPI operations
379 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
380 static_cast<uint32_t>(eMpiName::Bcast), MpiInfo(eMpiName::Bcast).name().localstr());
381 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
382 static_cast<uint32_t>(eMpiName::Gather), MpiInfo(eMpiName::Gather).name().localstr());
383 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
384 static_cast<uint32_t>(eMpiName::Gatherv), MpiInfo(eMpiName::Gatherv).name().localstr());
385 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
386 static_cast<uint32_t>(eMpiName::Allgather), MpiInfo(eMpiName::Allgather).name().localstr());
387 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
388 static_cast<uint32_t>(eMpiName::Allgatherv), MpiInfo(eMpiName::Allgatherv).name().localstr());
389 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
390 static_cast<uint32_t>(eMpiName::Scatterv), MpiInfo(eMpiName::Scatterv).name().localstr());
391 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
392 static_cast<uint32_t>(eMpiName::Alltoall), MpiInfo(eMpiName::Alltoall).name().localstr());
393 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
394 static_cast<uint32_t>(eMpiName::Alltoallv), MpiInfo(eMpiName::Alltoallv).name().localstr());
395 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
396 static_cast<uint32_t>(eMpiName::Barrier), MpiInfo(eMpiName::Barrier).name().localstr());
397 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
398 static_cast<uint32_t>(eMpiName::Reduce), MpiInfo(eMpiName::Reduce).name().localstr());
399 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
400 static_cast<uint32_t>(eMpiName::Allreduce), MpiInfo(eMpiName::Allreduce).name().localstr());
401 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
402 static_cast<uint32_t>(eMpiName::Scan), MpiInfo(eMpiName::Scan).name().localstr());
403 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
404 static_cast<uint32_t>(eMpiName::Sendrecv), MpiInfo(eMpiName::Sendrecv).name().localstr());
405 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
406 static_cast<uint32_t>(eMpiName::Isend), MpiInfo(eMpiName::Isend).name().localstr());
407 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
408 static_cast<uint32_t>(eMpiName::Send), MpiInfo(eMpiName::Send).name().localstr());
409 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
410 static_cast<uint32_t>(eMpiName::Irecv), MpiInfo(eMpiName::Irecv).name().localstr());
411 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
412 static_cast<uint32_t>(eMpiName::Recv), MpiInfo(eMpiName::Recv).name().localstr());
413 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
414 static_cast<uint32_t>(eMpiName::Test), MpiInfo(eMpiName::Test).name().localstr());
415 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
416 static_cast<uint32_t>(eMpiName::Probe), MpiInfo(eMpiName::Probe).name().localstr());
417 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
418 static_cast<uint32_t>(eMpiName::Get_count), MpiInfo(eMpiName::Get_count).name().localstr());
419 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
420 static_cast<uint32_t>(eMpiName::Wait), MpiInfo(eMpiName::Wait).name().localstr());
421 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
422 static_cast<uint32_t>(eMpiName::Waitall), MpiInfo(eMpiName::Waitall).name().localstr());
423 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
424 static_cast<uint32_t>(eMpiName::Testsome), MpiInfo(eMpiName::Testsome).name().localstr());
425 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
426 static_cast<uint32_t>(eMpiName::Waitsome), MpiInfo(eMpiName::Waitsome).name().localstr());
427 // We use a counter to increment the identifiers
428 u_int32_t offset(static_cast<uint32_t>(eMpiName::NameOffset));
429
430 // We continue with the descriptions of these operations. We use the offset value of the enum field count.
431 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
432 static_cast<uint32_t>(eMpiName::Bcast) + offset, MpiInfo(eMpiName::Bcast).description().localstr());
433 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
434 static_cast<uint32_t>(eMpiName::Gather) + offset, MpiInfo(eMpiName::Gather).description().localstr());
435 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
436 static_cast<uint32_t>(eMpiName::Gatherv) + offset, MpiInfo(eMpiName::Gatherv).description().localstr());
437 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
438 static_cast<uint32_t>(eMpiName::Allgather) + offset, MpiInfo(eMpiName::Allgather).description().localstr());
439 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
440 static_cast<uint32_t>(eMpiName::Allgatherv) + offset, MpiInfo(eMpiName::Allgatherv).description().localstr());
441 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
442 static_cast<uint32_t>(eMpiName::Scatterv) + offset, MpiInfo(eMpiName::Scatterv).description().localstr());
443 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
444 static_cast<uint32_t>(eMpiName::Alltoall) + offset, MpiInfo(eMpiName::Alltoall).description().localstr());
445 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
446 static_cast<uint32_t>(eMpiName::Alltoallv) + offset, MpiInfo(eMpiName::Alltoallv).description().localstr());
447 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
448 static_cast<uint32_t>(eMpiName::Barrier) + offset, MpiInfo(eMpiName::Barrier).description().localstr());
449 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
450 static_cast<uint32_t>(eMpiName::Reduce) + offset, MpiInfo(eMpiName::Reduce).description().localstr());
451 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
452 static_cast<uint32_t>(eMpiName::Allreduce) + offset, MpiInfo(eMpiName::Allreduce).description().localstr());
453 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
454 static_cast<uint32_t>(eMpiName::Scan) + offset, MpiInfo(eMpiName::Scan).description().localstr());
455 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
456 static_cast<uint32_t>(eMpiName::Sendrecv) + offset, MpiInfo(eMpiName::Sendrecv).description().localstr());
457 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
458 static_cast<uint32_t>(eMpiName::Isend) + offset, MpiInfo(eMpiName::Isend).description().localstr());
459 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
460 static_cast<uint32_t>(eMpiName::Send) + offset, MpiInfo(eMpiName::Send).description().localstr());
461 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
462 static_cast<uint32_t>(eMpiName::Irecv) + offset, MpiInfo(eMpiName::Irecv).description().localstr());
463 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
464 static_cast<uint32_t>(eMpiName::Recv) + offset, MpiInfo(eMpiName::Recv).description().localstr());
465 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
466 static_cast<uint32_t>(eMpiName::Test) + offset, MpiInfo(eMpiName::Test).description().localstr());
467 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
468 static_cast<uint32_t>(eMpiName::Probe) + offset, MpiInfo(eMpiName::Probe).description().localstr());
469 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
470 static_cast<uint32_t>(eMpiName::Get_count) + offset, MpiInfo(eMpiName::Get_count).description().localstr());
471 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
472 static_cast<uint32_t>(eMpiName::Wait) + offset, MpiInfo(eMpiName::Wait).description().localstr());
473 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
474 static_cast<uint32_t>(eMpiName::Waitall) + offset, MpiInfo(eMpiName::Waitall).description().localstr());
475 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
476 static_cast<uint32_t>(eMpiName::Testsome) + offset, MpiInfo(eMpiName::Testsome).description().localstr());
477 OTF2_GlobalDefWriter_WriteString(m_global_def_writer,
478 static_cast<uint32_t>(eMpiName::Waitsome) + offset, MpiInfo(eMpiName::Waitsome).description().localstr());
479
480 // On continu avec le reste, j'ai pas trouve d'idee geniale pour avoir un indice intelligent ...
481 offset *= 2;
482 // Chaine vide : 2 x eMpiName::NameOffset
483 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "");
484 // Nom du thread CPU mappe sur le process MPI : 2 x eMpiName::NameOffset + 1
485 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Master Thread");
486 // Nom de la machine : 2 x eMpiName::NameOffset + 2
487 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, Arccore::Platform::getHostName().localstr());
488 // Classe de la machine... pas inspire... : 2 x eMpiName::NameOffset + 3
489 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Compute node");
490 // MPI Communicator : 2 x eMpiName::NameOffset + 4
491 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "MPI_COMM_WORLD");
492 // MPI : 2 x eMpiName::NameOffset + 5
493 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "MPI");
494
495 // Comm id: 2 x eMpiName::NameOffset + 6
496 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Comm ${id}");
497 // + 7
498 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Win ${id}");
499 // + 8
500 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "MPI_COMM_SELF");
501
502 // Entry Point : 2 x eMpiName::NameOffset + 9
503 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Entry Point");
504 // Synchronize : 2 x eMpiName::NameOffset + 10
505 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, "Synchronize");
506 // Application name : 2 x eMpiName::NameOffset + 11
507 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, m_sub_domain->application()->applicationName().localstr());
508 // On continu avec les noms des rangs MPI
509 for (Int32 i(0); i < m_sub_domain->nbSubDomain(); ++i) {
510 String mpi_rank_name(std::string("MPI Rank ") + std::to_string(i));
511 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, mpi_rank_name.localstr());
512 }
513 // On termine avec les points d'entree
514 for (auto i : m_sub_domain->timeLoopMng()->usedTimeLoopEntryPoints())
515 // On cree la definition otf2 pour le responsable des IOs
516 OTF2_GlobalDefWriter_WriteString(m_global_def_writer, offset++, i->fullName().localstr());
517}
518
519/*---------------------------------------------------------------------------*/
520/*---------------------------------------------------------------------------*/
521
526{
527 // Seul le sous-domaine responsable ecrit l'archive otf2
528 if (!m_sub_domain->parallelMng()->isMasterIO())
529 return;
530
531 OTF2_GlobalDefWriter_WriteParadigm(m_global_def_writer, OTF2_PARADIGM_MPI, m_id.m_mpi_id, OTF2_PARADIGM_CLASS_PROCESS);
532 OTF2_AttributeValue attr_val;
533 attr_val.stringRef = m_id.m_comm_id;
534 OTF2_GlobalDefWriter_WriteParadigmProperty(m_global_def_writer, OTF2_PARADIGM_MPI,
535 OTF2_PARADIGM_PROPERTY_COMM_NAME_TEMPLATE, OTF2_TYPE_STRING, attr_val);
536
537 attr_val.stringRef = m_id.m_win_id;
538 OTF2_GlobalDefWriter_WriteParadigmProperty(m_global_def_writer, OTF2_PARADIGM_MPI,
539 OTF2_PARADIGM_PROPERTY_RMA_WIN_NAME_TEMPLATE, OTF2_TYPE_STRING, attr_val);
540
541 // Definition du systeme
542 OTF2_GlobalDefWriter_WriteSystemTreeNode(m_global_def_writer, 0 /* id */, m_id.m_hostname_id, m_id.m_class_id,
543 OTF2_UNDEFINED_SYSTEM_TREE_NODE /* parent */);
544}
545
546/*---------------------------------------------------------------------------*/
547/*---------------------------------------------------------------------------*/
548
552{
553 // On a besoin de connaitre le nb d'evenement par sous-domaine
554 UniqueArray<Integer> recv_buffer(m_sub_domain->nbSubDomain());
555 UniqueArray<Integer> send_buffer(1, static_cast<Integer>(m_evt_nb));
556 m_sub_domain->parallelMng()->gather(send_buffer, recv_buffer, m_sub_domain->parallelMng()->masterIORank());
557
558 // Seul le sous-domaine responsable ecrit l'archive otf2
559 if (!m_sub_domain->parallelMng()->isMasterIO())
560 return;
561
562 // Location group pour tous les ranks MPI
563 for (Int32 i(0); i < m_sub_domain->nbSubDomain(); ++i) {
564 OTF2_GlobalDefWriter_WriteLocationGroup(m_global_def_writer, i /* id */,
565 m_id.m_rank_offset + i /* name */,
566 OTF2_LOCATION_GROUP_TYPE_PROCESS,
567 0 /* system tree */
568#if OTF2_VERSION_MAJOR >= 3
569 ,
570 OTF2_UNDEFINED_LOCATION_GROUP
571#endif
572 );
573 }
574 for (Int32 i(0); i < m_sub_domain->nbSubDomain(); ++i) {
575 OTF2_GlobalDefWriter_WriteLocation(m_global_def_writer, i /* id */, m_id.m_thread_id /* name */,
576 OTF2_LOCATION_TYPE_CPU_THREAD, recv_buffer.at(i) /* # events */,
577 i /* location group */);
578 }
579}
580
581/*---------------------------------------------------------------------------*/
582/*---------------------------------------------------------------------------*/
583
588{
589 // Seul le sous-domaine responsable ecrit l'archive otf2
590 if (!m_sub_domain->parallelMng()->isMasterIO())
591 return;
592
593 // Definition des regions
594 // broadcast
595 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Bcast),
596 static_cast<uint32_t>(eMpiName::Bcast), static_cast<uint32_t>(eMpiName::Bcast),
597 static_cast<uint32_t>(eMpiName::Bcast) + m_id.m_desc_offset,
598 OTF2_REGION_ROLE_COLL_ONE2ALL,
599 OTF2_PARADIGM_MPI,
600 OTF2_REGION_FLAG_NONE,
601 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
602 // gather
603 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Gather),
604 static_cast<uint32_t>(eMpiName::Gather), static_cast<uint32_t>(eMpiName::Gather),
605 static_cast<uint32_t>(eMpiName::Gather) + m_id.m_desc_offset,
606 OTF2_REGION_ROLE_COLL_ALL2ONE,
607 OTF2_PARADIGM_MPI,
608 OTF2_REGION_FLAG_NONE,
609 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
610 // gather variable
611 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Gatherv),
612 static_cast<uint32_t>(eMpiName::Gatherv), static_cast<uint32_t>(eMpiName::Gatherv),
613 static_cast<uint32_t>(eMpiName::Gatherv) + m_id.m_desc_offset,
614 OTF2_REGION_ROLE_COLL_ALL2ONE,
615 OTF2_PARADIGM_MPI,
616 OTF2_REGION_FLAG_NONE,
617 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
618 // all gather
619 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Allgather),
620 static_cast<uint32_t>(eMpiName::Allgather), static_cast<uint32_t>(eMpiName::Allgather),
621 static_cast<uint32_t>(eMpiName::Allgather) + m_id.m_desc_offset,
622 OTF2_REGION_ROLE_COLL_ALL2ALL,
623 OTF2_PARADIGM_MPI,
624 OTF2_REGION_FLAG_NONE,
625 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
626 // all gather variable
627 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Allgatherv),
628 static_cast<uint32_t>(eMpiName::Allgatherv), static_cast<uint32_t>(eMpiName::Allgatherv),
629 static_cast<uint32_t>(eMpiName::Allgatherv) + m_id.m_desc_offset,
630 OTF2_REGION_ROLE_COLL_ALL2ALL,
631 OTF2_PARADIGM_MPI,
632 OTF2_REGION_FLAG_NONE,
633 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
634 // scatter variable
635 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Scatterv),
636 static_cast<uint32_t>(eMpiName::Scatterv), static_cast<uint32_t>(eMpiName::Scatterv),
637 static_cast<uint32_t>(eMpiName::Scatterv) + m_id.m_desc_offset,
638 OTF2_REGION_ROLE_COLL_ONE2ALL,
639 OTF2_PARADIGM_MPI,
640 OTF2_REGION_FLAG_NONE,
641 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
642 // all to all
643 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Alltoall),
644 static_cast<uint32_t>(eMpiName::Alltoall), static_cast<uint32_t>(eMpiName::Alltoall),
645 static_cast<uint32_t>(eMpiName::Alltoall) + m_id.m_desc_offset,
646 OTF2_REGION_ROLE_COLL_ALL2ALL,
647 OTF2_PARADIGM_MPI,
648 OTF2_REGION_FLAG_NONE,
649 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
650 // all to all variable
651 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Alltoallv),
652 static_cast<uint32_t>(eMpiName::Alltoallv), static_cast<uint32_t>(eMpiName::Alltoallv),
653 static_cast<uint32_t>(eMpiName::Alltoallv) + m_id.m_desc_offset,
654 OTF2_REGION_ROLE_COLL_ALL2ALL,
655 OTF2_PARADIGM_MPI,
656 OTF2_REGION_FLAG_NONE,
657 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
658 // barrier
659 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Barrier),
660 static_cast<uint32_t>(eMpiName::Barrier), static_cast<uint32_t>(eMpiName::Barrier),
661 static_cast<uint32_t>(eMpiName::Barrier) + m_id.m_desc_offset,
662 OTF2_REGION_ROLE_BARRIER,
663 OTF2_PARADIGM_MPI,
664 OTF2_REGION_FLAG_NONE,
665 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
666 // reduce
667 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Reduce),
668 static_cast<uint32_t>(eMpiName::Reduce), static_cast<uint32_t>(eMpiName::Reduce),
669 static_cast<uint32_t>(eMpiName::Reduce) + m_id.m_desc_offset,
670 OTF2_REGION_ROLE_COLL_ALL2ONE,
671 OTF2_PARADIGM_MPI,
672 OTF2_REGION_FLAG_NONE,
673 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
674 // all reduce
675 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Allreduce),
676 static_cast<uint32_t>(eMpiName::Allreduce), static_cast<uint32_t>(eMpiName::Allreduce),
677 static_cast<uint32_t>(eMpiName::Allreduce) + m_id.m_desc_offset,
678 OTF2_REGION_ROLE_COLL_ALL2ALL,
679 OTF2_PARADIGM_MPI,
680 OTF2_REGION_FLAG_NONE,
681 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
682 // scan
683 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Scan),
684 static_cast<uint32_t>(eMpiName::Scan), static_cast<uint32_t>(eMpiName::Scan),
685 static_cast<uint32_t>(eMpiName::Scan) + m_id.m_desc_offset,
686 OTF2_REGION_ROLE_COLL_OTHER,
687 OTF2_PARADIGM_MPI,
688 OTF2_REGION_FLAG_NONE,
689 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
690 // sendrecv
691 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Sendrecv),
692 static_cast<uint32_t>(eMpiName::Sendrecv), static_cast<uint32_t>(eMpiName::Sendrecv),
693 static_cast<uint32_t>(eMpiName::Sendrecv) + m_id.m_desc_offset,
694 OTF2_REGION_ROLE_POINT2POINT,
695 OTF2_PARADIGM_MPI,
696 OTF2_REGION_FLAG_NONE,
697 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
698 // non blocking send
699 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Isend),
700 static_cast<uint32_t>(eMpiName::Isend), static_cast<uint32_t>(eMpiName::Isend),
701 static_cast<uint32_t>(eMpiName::Isend) + m_id.m_desc_offset,
702 OTF2_REGION_ROLE_POINT2POINT,
703 OTF2_PARADIGM_MPI,
704 OTF2_REGION_FLAG_NONE,
705 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
706 // blocking send
707 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Send),
708 static_cast<uint32_t>(eMpiName::Send), static_cast<uint32_t>(eMpiName::Send),
709 static_cast<uint32_t>(eMpiName::Send) + m_id.m_desc_offset,
710 OTF2_REGION_ROLE_POINT2POINT,
711 OTF2_PARADIGM_MPI,
712 OTF2_REGION_FLAG_NONE,
713 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
714 // non blocking recv
715 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Irecv),
716 static_cast<uint32_t>(eMpiName::Irecv), static_cast<uint32_t>(eMpiName::Irecv),
717 static_cast<uint32_t>(eMpiName::Irecv) + m_id.m_desc_offset,
718 OTF2_REGION_ROLE_POINT2POINT,
719 OTF2_PARADIGM_MPI,
720 OTF2_REGION_FLAG_NONE,
721 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
722 // blocking recv
723 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Recv),
724 static_cast<uint32_t>(eMpiName::Recv), static_cast<uint32_t>(eMpiName::Recv),
725 static_cast<uint32_t>(eMpiName::Recv) + m_id.m_desc_offset,
726 OTF2_REGION_ROLE_POINT2POINT,
727 OTF2_PARADIGM_MPI,
728 OTF2_REGION_FLAG_NONE,
729 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
730 // test
731 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Test),
732 static_cast<uint32_t>(eMpiName::Test), static_cast<uint32_t>(eMpiName::Test),
733 static_cast<uint32_t>(eMpiName::Test) + m_id.m_desc_offset,
734 OTF2_REGION_ROLE_FUNCTION,
735 OTF2_PARADIGM_MPI,
736 OTF2_REGION_FLAG_NONE,
737 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
738 // probe
739 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Probe),
740 static_cast<uint32_t>(eMpiName::Probe), static_cast<uint32_t>(eMpiName::Probe),
741 static_cast<uint32_t>(eMpiName::Probe) + m_id.m_desc_offset,
742 OTF2_REGION_ROLE_POINT2POINT,
743 OTF2_PARADIGM_MPI,
744 OTF2_REGION_FLAG_NONE,
745 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
746 // get count
747 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Get_count),
748 static_cast<uint32_t>(eMpiName::Get_count), static_cast<uint32_t>(eMpiName::Get_count),
749 static_cast<uint32_t>(eMpiName::Get_count) + m_id.m_desc_offset,
750 OTF2_REGION_ROLE_FUNCTION,
751 OTF2_PARADIGM_MPI,
752 OTF2_REGION_FLAG_NONE,
753 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
754 // wait
755 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Wait),
756 static_cast<uint32_t>(eMpiName::Wait), static_cast<uint32_t>(eMpiName::Wait),
757 static_cast<uint32_t>(eMpiName::Wait) + m_id.m_desc_offset,
758 OTF2_REGION_ROLE_FUNCTION,
759 OTF2_PARADIGM_MPI,
760 OTF2_REGION_FLAG_NONE,
761 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
762 // wait all
763 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Waitall),
764 static_cast<uint32_t>(eMpiName::Waitall), static_cast<uint32_t>(eMpiName::Waitall),
765 static_cast<uint32_t>(eMpiName::Waitall) + m_id.m_desc_offset,
766 OTF2_REGION_ROLE_FUNCTION,
767 OTF2_PARADIGM_MPI,
768 OTF2_REGION_FLAG_NONE,
769 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
770 // test some
771 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Testsome),
772 static_cast<uint32_t>(eMpiName::Testsome), static_cast<uint32_t>(eMpiName::Testsome),
773 static_cast<uint32_t>(eMpiName::Testsome) + m_id.m_desc_offset,
774 OTF2_REGION_ROLE_FUNCTION,
775 OTF2_PARADIGM_MPI,
776 OTF2_REGION_FLAG_NONE,
777 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
778 // wait some
779 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(eMpiName::Waitsome),
780 static_cast<uint32_t>(eMpiName::Waitsome), static_cast<uint32_t>(eMpiName::Waitsome),
781 static_cast<uint32_t>(eMpiName::Waitsome) + m_id.m_desc_offset,
782 OTF2_REGION_ROLE_FUNCTION,
783 OTF2_PARADIGM_MPI,
784 OTF2_REGION_FLAG_NONE,
785 m_id.m_mpi_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
786 // Pour les points d'entree
787 for (const auto& i : m_id.m_ep_id_set) {
788 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, static_cast<uint32_t>(i.m_id),
789 static_cast<uint32_t>(i.m_id), static_cast<uint32_t>(i.m_id),
790 static_cast<uint32_t>(i.m_id),
791 OTF2_REGION_ROLE_FUNCTION,
792 OTF2_PARADIGM_NONE,
793 OTF2_REGION_FLAG_NONE,
794 m_id.m_ep_id, 0, 0); // 0,0 pour les numeros de lignes des src...
795 }
796 // synchronize
797 OTF2_GlobalDefWriter_WriteRegion(m_global_def_writer, m_id.m_sync_id,
798 m_id.m_sync_id, m_id.m_sync_id, m_id.m_sync_id,
799 OTF2_REGION_ROLE_FUNCTION,
800 OTF2_PARADIGM_NONE,
801 OTF2_REGION_FLAG_NONE,
802 m_id.m_sync_id, 0, 0); // 0,0 pour les numeros de lignes du src MPI.c ...
803}
804
805/*---------------------------------------------------------------------------*/
806/*---------------------------------------------------------------------------*/
807
813{
814 // Seul le sous-domaine responsable ecrit l'archive otf2
815 if (!m_sub_domain->parallelMng()->isMasterIO())
816 return;
817
818 // Definitions des sous groupes de communication (nous n'en avons pas donc ce sont les memes)
819 OTF2_GlobalDefWriter_WriteGroup(m_global_def_writer, 0 /* id */, m_id.m_empty_id /* name */,
820 OTF2_GROUP_TYPE_COMM_LOCATIONS, OTF2_PARADIGM_MPI, OTF2_GROUP_FLAG_NONE,
821 m_sub_domain->nbSubDomain(), m_comm_members.data());
822
823 OTF2_GlobalDefWriter_WriteGroup(m_global_def_writer, 1 /* id */, m_id.m_empty_id /* name */,
824 OTF2_GROUP_TYPE_COMM_GROUP, OTF2_PARADIGM_MPI,
825 OTF2_GROUP_FLAG_NONE, m_sub_domain->nbSubDomain(), m_comm_members.data());
826
827 OTF2_GlobalDefWriter_WriteGroup(m_global_def_writer, 2 /* id */, m_id.m_empty_id /* name */,
828 OTF2_GROUP_TYPE_COMM_SELF, OTF2_PARADIGM_MPI,
829 OTF2_GROUP_FLAG_NONE, 0, NULL);
830
831 // Definition du communicateur associe au groupe des comm
832 OTF2_GlobalDefWriter_WriteComm(m_global_def_writer, 0 /* id */, m_id.m_comm_world_id, 1 /* group */,
833 OTF2_UNDEFINED_COMM /* parent */
834#if OTF2_VERSION_MAJOR >= 3
835 ,
836 0
837#endif
838 );
839
840 OTF2_GlobalDefWriter_WriteComm(m_global_def_writer, 1 /* id */, m_id.m_comm_self_id, 2 /* group */,
841 OTF2_UNDEFINED_COMM /* parent */
842#if OTF2_VERSION_MAJOR >= 3
843 ,
844 0
845#endif
846 );
847
848 // Fermeture de la definition de l'archive pour enfin ecrire tout ca
849 OTF2_Archive_CloseGlobalDefWriter(m_archive, m_global_def_writer);
850}
851
852/*---------------------------------------------------------------------------*/
853/*---------------------------------------------------------------------------*/
854
855} // namespace Arcane
856
857/*---------------------------------------------------------------------------*/
858/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
T & at(Int64 i)
Element at index i. Always checks for overflows.
Interface of the subdomain manager.
Definition ISubDomain.h:75
Informative structure linked to the enumerations for MPI operations. Provides the name associated wit...
Otf2LibWrapper(ISubDomain *sub_domain)
Constructor.
void _buildOtf2ClockAndStringDefinition(uint64_t global_start_time, uint64_t global_end_time)
static uint64_t s_epoch_start
Static member.
void init(const String &archive_name)
Initialization method. Allows defining the path where the archive will be found, as well as its name.
void _buildOtf2ParadigmAndSystemDefinition()
uint32_t getApplicationNameId() const
Helper for the application name.
OTF2_EvtWriter * getEventWriter()
int getMpiNbRank() const
Helper for the number of MPI ranks.
void _buildOtf2LocationDefinition()
Internal method to write the system definition associated with the otf2 archive.
static OTF2_TimeStamp getTime()
Internal static method to retrieve the timestamp.
void finalize()
Method to call to finalize the archive creation (i.e., we no longer want to record events).
static OTF2_TimeStamp _postFlush(void *user_data, OTF2_FileType file_type, OTF2_LocationRef location)
Internal static method to set the callback to be called after the event is recorded.
static OTF2_FlushType _preFlush(void *user_data, OTF2_FileType file_type, OTF2_LocationRef location, void *caller_data, bool final)
Internal static method to set the callback to be called before the event is recorded.
int getMpiRank() const
Helper for the MPI rank number.
uint32_t getEntryPointId(const String &ep_name) const
Helper for the ID of an entry point via its name.
uint32_t getSynchronizeId() const
Helper for the string "synchronize".
const char * localstr() const
Returns the conversion of the instance into UTF-8 encoding.
Definition String.cc:229
1D data vector with value semantics (STL style).
String getHostName()
Name of the machine running the process.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.