Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
JsonMessagePassingProfilingService.h
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/* JsonMessagePassingProfilingService.h (C) 2000-2019 */
9/* */
10/* Performance information for "message passing" in JSON format */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_JSONMESSAGEPASSINGPROFILINGSERVICE_H
13#define ARCANE_STD_JSONMESSAGEPASSINGPROFILINGSERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IMessagePassingProfilingService.h"
18#include "arcane/utils/String.h"
19
20#include "arcane/core/AbstractService.h"
21#include "arcane/core/ISubDomain.h"
22#include "arcane/core/ObserverPool.h"
23
24#include "arccore/message_passing/Stat.h"
25
26#include <map>
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
40class JsonMessagePassingProfilingService
41: public AbstractService
43{
44 public:
45
46 JsonMessagePassingProfilingService(const ServiceBuildInfo& sbi);
47 virtual ~JsonMessagePassingProfilingService();
48
49 public:
50
51 void startProfiling() override;
52 void stopProfiling() override;
53 void printInfos(std::ostream& output) override;
54 String implName() override;
55
56 private:
57
59 typedef std::map<String, Arccore::MessagePassing::StatData> StatDataMap;
60
61 private:
62
63 ISubDomain* m_sub_domain;
64 ObserverPool m_observer;
65 JSONWriter* m_json_writer;
66 // { entry point name, {message passing infos} }
67 StatDataMap m_ep_mpstat_col;
68 String m_impl_name;
69
70 private:
71
72 void _dumpCurrentIterationInJSON();
73
74 void _updateFromBeginEntryPointEvt();
75 void _updateFromEndEntryPointEvt();
76 void _updateFromBeginIterationEvt();
77 void _updateFromEndIterationEvt();
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88#endif
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
Interface of a profiling service dedicated to "message passing".
Interface of the subdomain manager.
Definition ISubDomain.h:75
void printInfos(std::ostream &output) override
Displays information from the profiling.
std::map< String, Arccore::MessagePassing::StatData > StatDataMap
List of statistics per entry point.
String implName() override
Gives the name of the service that implements the interface.
List of observers.
Structure containing the information to create a service.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --