source: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_finalize.cpp @ 1520

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

save dev. TO DO : test with xios

File size: 687 bytes
Line 
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_Finalize()
10  {
11    printf("calling EP Finalize\n");
12
13    int id = omp_get_thread_num();
14
15    if(id == 0)
16    {
17      ::MPI_Finalize();
18    }
19    return 0;
20  }
21
22  int MPI_Abort(MPI_Comm comm, int errorcode)
23  {
24    if(!comm->is_ep)
25      return MPI_Abort_mpi(comm, errorcode);
26
27    else
28    {
29      if(comm->ep_comm_ptr->size_rank_info[1].first == 0)
30      {
31        ::MPI_Abort(to_mpi_comm(comm->mpi_comm), errorcode);
32      }
33    }
34  }
35
36  int MPI_Abort_mpi(MPI_Comm comm, int errorcode)
37  {
38    return ::MPI_Abort(to_mpi_comm(comm->mpi_comm), errorcode);
39  }
40
41}
42
43
Note: See TracBrowser for help on using the repository browser.