source: XIOS/dev/branch_openmp/extern/ep_dev/ep_init.cpp @ 1525

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

save dev : intercomm_create via intracomm. To do : modif related intercomm communication routines, barrier, free, rank, size...

File size: 754 bytes
Line 
1#include "ep_lib.hpp"
2#include <mpi.h>
3#include "ep_declaration.hpp"
4#include "ep_mpi.hpp"
5
6extern MPI_Group MPI_GROUP_WORLD;
7
8namespace ep_lib
9{
10
11
12
13  int MPI_Init_thread(int *argc, char*** argv, int required, int*provided)
14  {
15    Debug("MPI_Init_thread with EP/MPI\n");
16
17    if(omp_get_thread_num() == 0)
18    {
19      ::MPI_Init_thread(argc, argv, required, provided);
20      ::MPI_Comm_group(to_mpi_comm(MPI_COMM_WORLD->mpi_comm), &MPI_GROUP_WORLD);
21    }
22  }
23
24  int MPI_Init(int *argc, char ***argv)
25  {
26    Debug("MPI_Init with EP/MPI\n");
27
28    if(omp_get_thread_num() == 0)
29    {
30      ::MPI_Init(argc, argv);
31    }
32  }
33
34  int MPI_Initialized(int *flag)
35  {
36    Debug("MPI_Initialized with EP/MPI\n");
37
38    return ::MPI_Initialized(flag);
39  }
40
41
42
43}
44
45
Note: See TracBrowser for help on using the repository browser.