#include "ep_lib.hpp" #include #include "ep_declaration.hpp" #include "ep_mpi.hpp" namespace ep_lib { int MPI_Comm_size(MPI_Comm comm, int* size) { if(comm->is_ep) { Debug("MPI_Comm_size with EP"); return *size = comm->ep_comm_ptr->size_rank_info[0].second; } return MPI_Comm_size_mpi(comm, size); } int MPI_Comm_remote_size(MPI_Comm comm, int *size) { if(comm->is_ep) { return *size = comm->is_intercomm? comm->inter_rank_map->size() : 0; } return MPI_Comm_remote_size_mpi(comm, size); } int MPI_Comm_size_mpi(MPI_Comm comm, int* size) { Debug("MPI_Comm_size with MPI"); return ::MPI_Comm_size(to_mpi_comm(comm->mpi_comm), size); } int MPI_Comm_remote_size_mpi(MPI_Comm comm, int *size) { Debug("MPI_Comm_remote_size with MPI"); return ::MPI_Comm_remote_size(to_mpi_comm(comm->mpi_comm), size); } }