Arcane  4.2.3.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
MessagePassingMpiGlobal.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/* MessagePassingMpiGlobal.h (C) 2000-2026 */
9/* */
10/* Définitions globales de la composante 'MessagePassingMpi' de 'Arccore'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
15
16#include "arccore/message_passing/IMessagePassingMng.h"
17#include "arccore/message_passing/Communicator.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
30{
31 MPI_Comm mpi_comm = MPI_COMM_NULL;
32 if (mpm) {
33 Communicator comm = mpm->communicator();
34 if (comm.isValid())
35 mpi_comm = static_cast<MPI_Comm>(comm);
36 }
37 return mpi_comm;
38}
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
44fillMpiCommunicatorIfValid(IMessagePassingMng* mpm, MPI_Comm* mpi_comm)
45{
46 if (!mpm)
47 return false;
48 Communicator comm = mpm->communicator();
49 if (!comm.isValid())
50 return false;
51 *mpi_comm = static_cast<MPI_Comm>(comm);
52 return true;
53}
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58} // namespace Arcane
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
Communicateur pour l'échange de message.
bool isValid() const
Indique si le communicateur est valide.
Interface du gestionnaire des échanges de messages.
virtual Communicator communicator() const
Communicateur MPI associé à cette instance.
ARCCORE_MESSAGEPASSINGMPI_EXPORT bool fillMpiCommunicatorIfValid(IMessagePassingMng *mpm, MPI_Comm *mpi_comm)
Positionne mpi_comm avec le communicateur MPI associé à mpm s'il est valide.
ARCCORE_MESSAGEPASSINGMPI_EXPORT MPI_Comm toMpiCommunicator(IMessagePassingMng *mpm)
Retourne le communicateur MPI associé à mpm.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --