Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ISharedMemoryMessageQueue.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* ISharedMemoryMessageQueue.h (C) 2000-2023 */
9/* */
10/* Interface d'une file de messages en mémoire partagée. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_PARALLEL_THREAD_ISHAREDMEMORYMESSAGEQUEUE_H
13#define ARCANE_PARALLEL_THREAD_ISHAREDMEMORYMESSAGEQUEUE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/MemoryView.h"
18
19#include "arcane/parallel/thread/ArcaneThread.h"
20#include "arcane/Parallel.h"
21
22#include "arcane/ArcaneTypes.h"
23
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30{
31using ByteSpan = Arccore::ByteSpan;
32using ByteConstSpan = Arccore::ByteConstSpan;
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
41class ARCANE_THREAD_EXPORT SendBufferInfo
42{
43 public:
44 SendBufferInfo() = default;
45 SendBufferInfo(ConstMemoryView memory_buffer)
46 : m_memory_buffer(memory_buffer){}
47 SendBufferInfo(const ISerializer* serializer)
48 : m_serializer(serializer){}
49 public:
50 ByteConstSpan memoryBuffer() { return m_memory_buffer.bytes(); }
51 const ISerializer* serializer() { return m_serializer; }
52 private:
53
54 ConstMemoryView m_memory_buffer;
55 const ISerializer* m_serializer = nullptr;
56};
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
65class ARCANE_THREAD_EXPORT ReceiveBufferInfo
66{
67 public:
68 ReceiveBufferInfo() = default;
70 : m_memory_buffer(memory_buffer){}
71 explicit ReceiveBufferInfo(ISerializer* serializer)
72 : m_serializer(serializer){}
73 public:
74 ByteSpan memoryBuffer() { return m_memory_buffer.bytes(); }
75 ISerializer* serializer() { return m_serializer; }
76 private:
77 MutableMemoryView m_memory_buffer;
78 ISerializer* m_serializer = nullptr;
79};
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
87class ARCANE_THREAD_EXPORT ISharedMemoryMessageQueue
88: public IRequestCreator
89{
90 public:
91
93
94 public:
95
96 virtual ~ISharedMemoryMessageQueue() = default;
97
98 public:
99
100 virtual void init(Integer nb_thread) =0;
101 virtual void waitAll(ArrayView<Request> requests) =0;
102 virtual void waitSome(Int32 rank,ArrayView<Request> requests,
104 virtual void setTraceMng(Int32 rank,ITraceMng* tm) =0;
105
106 public:
107
108 virtual Request addReceive(const PointToPointMessageInfo& message,ReceiveBufferInfo buf) =0;
109 virtual Request addSend(const PointToPointMessageInfo& message,SendBufferInfo buf) =0;
110 virtual MessageId probe(const PointToPointMessageInfo& message) =0;
111 virtual MessageSourceInfo legacyProbe(const PointToPointMessageInfo& message) =0;
112};
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117} // End namespace Arcane::MessagePassing
118
119/*---------------------------------------------------------------------------*/
120/*---------------------------------------------------------------------------*/
121
122#endif
Déclarations des types de la composante 'base' de Arccore.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Interface d'une file de messages avec les threads.
Informations des buffers de réception.
Interface du gestionnaire de traces.
Interface d'un créateur de requête.
Definition Request.h:52
Informations sur la source d'un message.
Informations pour envoyer/recevoir un message point à point.
Requête d'un message.
Definition Request.h:77
Déclarations des types et méthodes utilisés par les mécanismes d'échange de messages.
Definition Parallel.h:94
Span< const std::byte > ByteConstSpan
Equivalent C d'un tableau à une dimension de caractères.
Definition BaseTypes.h:183
Span< std::byte > ByteSpan
Equivalent C d'un tableau à une dimension de caractères.
Definition BaseTypes.h:162