libxmp/libxmpf in Omni Compiler  1.3.4
xmp_world.c File Reference
#include "mpi.h"
#include "xmp_internal.h"
Include dependency graph for xmp_world.c:

Macros

#define MPI_PORTABLE_PLATFORM_H
 

Functions

void _XMP_init_world (int *argc, char ***argv)
 
void _XMP_finalize_world (bool isFinalize)
 
int _XMP_split_world_by_color (int color)
 

Variables

int _XMP_world_size
 
int _XMP_world_rank
 
void * _XMP_world_nodes
 

Macro Definition Documentation

◆ MPI_PORTABLE_PLATFORM_H

#define MPI_PORTABLE_PLATFORM_H

Function Documentation

◆ _XMP_finalize_world()

void _XMP_finalize_world ( bool  isFinalize)
29  {
30  MPI_Barrier(MPI_COMM_WORLD);
31 
32  int flag = 0;
33  MPI_Finalized(&flag);
34  if (!flag) {
37  if(isFinalize)
38  MPI_Finalize();
39  }
40 }
Here is the call graph for this function:

◆ _XMP_init_world()

void _XMP_init_world ( int *  argc,
char ***  argv 
)
12  {
13  int flag = 0;
14  MPI_Initialized(&flag);
15  if (!flag) MPI_Init(argc, argv);
16 
17  MPI_Comm *comm = _XMP_alloc(sizeof(MPI_Comm));
18  MPI_Comm_dup(MPI_COMM_WORLD, comm);
23  _XMP_world_nodes = n;
24  _XMP_push_nodes(n);
25 
26  MPI_Barrier(MPI_COMM_WORLD);
27 }

◆ _XMP_split_world_by_color()

int _XMP_split_world_by_color ( int  color)
42  {
43  int new_comm_rank;
44  MPI_Comm new_comm;
45  MPI_Comm_split(MPI_COMM_WORLD, color, _XMP_world_rank, &new_comm);
46  MPI_Comm_rank(new_comm, &new_comm_rank);
47  MPI_Comm_free(&new_comm);
48 
49  return new_comm_rank;
50 }

Variable Documentation

◆ _XMP_world_nodes

void* _XMP_world_nodes

◆ _XMP_world_rank

int _XMP_world_rank

◆ _XMP_world_size

int _XMP_world_size
_XMP_nodes_type::comm_size
int comm_size
Definition: xmp_data_struct.h:48
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
_XMP_finalize_nodes
void _XMP_finalize_nodes(void *nodes)
_XMP_nodes_type::comm_rank
int comm_rank
Definition: xmp_data_struct.h:52
_XMP_ENTIRE_NODES
#define _XMP_ENTIRE_NODES
Definition: xmp_constant.h:121
_XMP_create_nodes_by_comm
_XMP_nodes_t * _XMP_create_nodes_by_comm(int is_member, _XMP_comm_t *comm)
Definition: xmp_nodes.c:1007
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_world_nodes
void * _XMP_world_nodes
Definition: xmp_world.c:10
_XMP_push_nodes
void _XMP_push_nodes(void *nodes)
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_nodes_type::attr
int attr
Definition: xmp_data_struct.h:49
_XMP_nodes_type
Definition: xmp_data_struct.h:40
_XMP_N_INT_TRUE
#define _XMP_N_INT_TRUE
Definition: xmp_constant.h:4
_XMP_get_execution_nodes
void * _XMP_get_execution_nodes(void)
Definition: xmp_nodes_stack.c:46