source: XIOS/trunk/extern/src_ep/ep_finalize.cpp @ 1034

Last change on this file since 1034 was 1034, checked in by yushan, 4 years ago

adding src_ep into extern folder

File size: 693 bytes
RevLine 
[1034]1#include "ep_lib.hpp"
2#include <mpi.h>
3#include "ep_declaration.hpp"
4
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      #ifdef _serialized
18      #pragma omp critical (_mpi_call)
19      #endif // _serialized
20      ::MPI_Finalize();
21    }
22    return 0;
23  }
24
25  int MPI_Abort(MPI_Comm comm, int errorcode)
26  {
27    int id = omp_get_thread_num();
28
29    if(id == 0)
30    {
31      ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm >(comm.mpi_comm);
32
33      #ifdef _serialized
34      #pragma omp critical (_mpi_call)
35      #endif // _serialized
36      ::MPI_Abort(mpi_comm, errorcode);
37    }
38    return 0;
39  }
40
41}
42
43
Note: See TracBrowser for help on using the repository browser.