source: XIOS/dev/branch_openmp/extern/ep_dev/ep_size.cpp @ 1515

Last change on this file since 1515 was 1515, checked in by yushan, 6 years ago

save dev

File size: 1.1 KB
RevLine 
[1381]1#include "ep_lib.hpp"
2#include <mpi.h>
3#include "ep_declaration.hpp"
4#include "ep_mpi.hpp"
5
6namespace ep_lib
7{
8
9  int MPI_Comm_size(MPI_Comm comm, int* size)
10  {
[1500]11    if(comm->is_ep)
[1381]12    {
[1515]13      Debug("MPI_Comm_size with EP");
14      return *size = comm->ep_comm_ptr->size_rank_info[0].second;
[1381]15    }
16
[1515]17    return MPI_Comm_size_mpi(comm, size);
[1381]18  }
19
20  int MPI_Comm_remote_size(MPI_Comm comm, int *size)
21  {
[1515]22    if(comm->is_ep)
[1381]23    {
[1515]24      if(comm->is_intercomm)
[1381]25      {
[1515]26        Debug("MPI_Comm_remote_size with EP_intercomm");
27        return *size = comm->ep_comm_ptr->intercomm->intercomm_rank_map->size();
[1381]28      }
29      else
30      {
[1515]31        Debug("MPI_Comm_remote_size with EP_intracomm");
32        return *size=0;
[1381]33      }
34    }
[1515]35    return MPI_Comm_remote_size_mpi(comm, size);
[1381]36  }
[1515]37
38
39  int MPI_Comm_size_mpi(MPI_Comm comm, int* size)
40  {
41    Debug("MPI_Comm_size with MPI");
42    return ::MPI_Comm_size(to_mpi_comm(comm->mpi_comm), size);
43  }
44
45  int MPI_Comm_remote_size_mpi(MPI_Comm comm, int *size)
46  {
47    Debug("MPI_Comm_remote_size with MPI");
48    return ::MPI_Comm_remote_size(to_mpi_comm(comm->mpi_comm), size);
49  }
50
51
[1381]52}
53
54
Note: See TracBrowser for help on using the repository browser.