14#include "arcane/utils/MemoryView.h"
16#include "arcane/parallel/mpi/MpiParallelMng.h"
17#include "arcane/parallel/mpi/MpiAdapter.h"
18#include "arcane/parallel/mpi/MpiDatatypeList.h"
19#include "arcane/parallel/mpi/MpiDatatype.h"
20#include "arcane/parallel/mpi/MpiTimeInterval.h"
21#include "arcane/parallel/IStat.h"
23#include "arcane/impl/IDataSynchronizeBuffer.h"
24#include "arcane/impl/IDataSynchronizeImplementation.h"
47 void compute()
override {}
68 : m_mpi_parallel_mng(
mpi_pm)
95MpiDirectSendrecvVariableSynchronizerDispatcher::
96MpiDirectSendrecvVariableSynchronizerDispatcher(Factory* f)
97: m_mpi_parallel_mng(f->m_mpi_parallel_mng)
104void MpiDirectSendrecvVariableSynchronizerDispatcher::
105beginSynchronize(IDataSynchronizeBuffer* vs_buf)
107 Int32 nb_message = vs_buf->nbRank();
109 constexpr int serialize_tag = 523;
111 MpiParallelMng* pm = m_mpi_parallel_mng;
112 MpiDatatypeList* dtlist = pm->datatypes();
113 const MPI_Datatype mpi_dt = dtlist->datatype(
Byte())->datatype();
115 double sync_copy_send_time = 0.0;
116 double sync_copy_recv_time = 0.0;
117 double sync_wait_time = 0.0;
120 MpiTimeInterval tit(&sync_copy_send_time);
121 vs_buf->copyAllSend();
125 MpiTimeInterval tit(&sync_wait_time);
126 for( Integer i=0; i<nb_message; ++i ){
127 Int32 target_rank = vs_buf->targetRank(i);
128 auto rbuf = vs_buf->receiveBuffer(i).bytes().smallView();
129 auto sbuf = vs_buf->sendBuffer(i).bytes().smallView();
131 MPI_Sendrecv(sbuf.data(), sbuf.size(), mpi_dt, target_rank, serialize_tag,
132 rbuf.data(), rbuf.size(), mpi_dt, target_rank, serialize_tag,
138 MpiTimeInterval tit(&sync_copy_recv_time);
139 vs_buf->copyAllReceive();
142 pm->
stat()->add(
"SyncCopySend",sync_copy_send_time,1);
143 pm->
stat()->add(
"SyncWait",sync_wait_time,1);
144 pm->
stat()->add(
"SyncCopyRecv",sync_copy_recv_time,1);
Buffer générique pour la synchronisation de données.
Interface d'une fabrique dispatcher générique.
virtual IStat * stat()=0
Gestionnaire des statistiques.
virtual Parallel::Communicator communicator() const =0
Communicateur MPI associé à ce gestionnaire.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Implémentation de la synchronisation via MPI_Sendrecv.
Gestionnaire du parallélisme utilisant MPI.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
unsigned char Byte
Type d'un octet.