#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) { if(comm->is_intercomm) { Debug("MPI_Comm_remote_size with EP_intercomm"); return *size = comm->ep_comm_ptr->intercomm->intercomm_rank_map->size(); } else { Debug("MPI_Comm_remote_size with EP_intracomm"); return *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); } }