X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96e302254a70f19f236afce77529c08ad1fc9651..48d16e98696450e0dc1ae85cfb8f84b41d15b409:/src/smpi/include/private.hpp diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index 4b96a330ad..c588ce00ea 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -13,35 +13,35 @@ #include #include -#define MPI_REQ_PERSISTENT 0x1 -#define MPI_REQ_NON_PERSISTENT 0x2 -#define MPI_REQ_SEND 0x4 -#define MPI_REQ_RECV 0x8 -//#define MPI_REQ_RECV_DELETE 0x10 -#define MPI_REQ_ISEND 0x20 -#define MPI_REQ_SSEND 0x40 -#define MPI_REQ_PREPARED 0x80 -#define MPI_REQ_FINISHED 0x100 -#define MPI_REQ_RMA 0x200 -#define MPI_REQ_ACCUMULATE 0x400 +constexpr unsigned MPI_REQ_PERSISTENT = 0x1; +constexpr unsigned MPI_REQ_NON_PERSISTENT = 0x2; +constexpr unsigned MPI_REQ_SEND = 0x4; +constexpr unsigned MPI_REQ_RECV = 0x8; +// constexpr unsigned MPI_REQ_RECV_DELETE = 0x10; +constexpr unsigned MPI_REQ_ISEND = 0x20; +constexpr unsigned MPI_REQ_SSEND = 0x40; +constexpr unsigned MPI_REQ_PREPARED = 0x80; +constexpr unsigned MPI_REQ_FINISHED = 0x100; +constexpr unsigned MPI_REQ_RMA = 0x200; +constexpr unsigned MPI_REQ_ACCUMULATE = 0x400; enum class SmpiProcessState { UNINITIALIZED, INITIALIZING, INITIALIZED, FINALIZED }; -#define COLL_TAG_REDUCE -112 -#define COLL_TAG_SCATTER -223 -#define COLL_TAG_SCATTERV -334 -#define COLL_TAG_GATHER -445 -#define COLL_TAG_ALLGATHER -556 -#define COLL_TAG_ALLGATHERV -667 -#define COLL_TAG_BARRIER -778 -#define COLL_TAG_REDUCE_SCATTER -889 -#define COLL_TAG_ALLTOALLV -1000 -#define COLL_TAG_ALLTOALL -1112 -#define COLL_TAG_GATHERV -2223 -#define COLL_TAG_BCAST -3334 -#define COLL_TAG_ALLREDUCE -4445 +constexpr int COLL_TAG_REDUCE = -112; +constexpr int COLL_TAG_SCATTER = -223; +constexpr int COLL_TAG_SCATTERV = -334; +constexpr int COLL_TAG_GATHER = -445; +constexpr int COLL_TAG_ALLGATHER = -556; +constexpr int COLL_TAG_ALLGATHERV = -667; +constexpr int COLL_TAG_BARRIER = -778; +constexpr int COLL_TAG_REDUCE_SCATTER = -889; +constexpr int COLL_TAG_ALLTOALLV = -1000; +constexpr int COLL_TAG_ALLTOALL = -1112; +constexpr int COLL_TAG_GATHERV = -2223; +constexpr int COLL_TAG_BCAST = -3334; +constexpr int COLL_TAG_ALLREDUCE = -4445; // SMPI_RMA_TAG has to be the smallest one, as it will be decremented for accumulate ordering. -#define SMPI_RMA_TAG -6666 +constexpr int SMPI_RMA_TAG = -6666; /* Convert between Fortran and C */ @@ -62,15 +62,17 @@ XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process(); XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor); XBT_PRIVATE int smpi_process_count(); -XBT_PRIVATE void smpi_deployment_register_process(const std::string instance_id, int rank, +XBT_PRIVATE void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::ActorPtr actor); -XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const std::string instance_id); -XBT_PRIVATE simgrid::s4u::Barrier* smpi_deployment_finalization_barrier(const std::string instance_id); +XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id); +XBT_PRIVATE simgrid::s4u::Barrier* smpi_deployment_finalization_barrier(const std::string& instance_id); XBT_PRIVATE void smpi_deployment_cleanup_instances(); -XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_activity_t comm, void* buff, size_t buff_size); +XBT_PRIVATE void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, + size_t buff_size); -XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void* buff, size_t buff_size); +XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, + size_t buff_size); XBT_PRIVATE int smpi_enabled(); XBT_PRIVATE void smpi_global_init();