libxmp/libxmpf in Omni Compiler  1.3.4
xmp_onesided_utofu.c File Reference
#include <stdlib.h>
#include "xmp_internal.h"
Include dependency graph for xmp_onesided_utofu.c:

Macros

#define _XMP_UTOFU_EXTERN_
 

Functions

void _XMP_utofu_initialize (void)
 
void _XMP_utofu_finalize (void)
 

Macro Definition Documentation

◆ _XMP_UTOFU_EXTERN_

#define _XMP_UTOFU_EXTERN_

Function Documentation

◆ _XMP_utofu_finalize()

void _XMP_utofu_finalize ( void  )
80 {
82  utofu_free_vcq(_xmp_utofu_vcq_hdl);
83 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_utofu_initialize()

void _XMP_utofu_initialize ( void  )
6 {
7  int ret;
8  size_t num_tnis;
9  utofu_tni_id_t *tni_ids;
10 
11  // Get TNIID that can be used for one-sided comm.
12  ret = utofu_get_onesided_tnis(&tni_ids, &num_tnis);
13  if( ret != UTOFU_SUCCESS || num_tnis == 0) {
14  _XMP_fatal("utofu_get_onesided_tnis");
15  }
16 
17  _xmp_utofu_tni_id = tni_ids[0];
18  free(tni_ids);
19 
20  // Queries the TNI function related to one-sided communication.
21  ret = utofu_query_onesided_caps(_xmp_utofu_tni_id, &(_xmp_utofu_onesided_caps));
22  if( ret != UTOFU_SUCCESS ) {
23  _XMP_fatal("utofu_query_onesided_caps");
24  }
25 
26  // Create a VCQ and get the corresponding VCQ ID
27  ret = utofu_create_vcq(_xmp_utofu_tni_id, 0, &(_xmp_utofu_vcq_hdl));
28  if( ret != UTOFU_SUCCESS ) {
29  switch( ret ) {
30  case UTOFU_ERR_FULL:
31  _XMP_fatal("utofu_create_vcq : No more VCQs can be created for this TNI.");
32  break;
33  case UTOFU_ERR_NOT_AVAILABLE:
34  _XMP_fatal("utofu_create_vcq : The type of VCQ specified by the flags parameter cannot be created.");
35  break;
36  case UTOFU_ERR_NOT_SUPPORTED:
37  _XMP_fatal("utofu_create_vcq : The type of VCQ specified by the flags parameter is not supported.");
38  break;
39  default:
40  _XMP_fatal("utofu_create_vcq : other error");
41  }
42  }
43 
44  utofu_vcq_id_t vcq_ids;
45  ret = utofu_query_vcq_id(_xmp_utofu_vcq_hdl, &vcq_ids);
46  if( ret != UTOFU_SUCCESS ) {
47  _XMP_fatal("utofu_query_vcq_id");
48  }
49 
50  _xmp_utofu_vcq_ids = (utofu_vcq_id_t*)malloc(sizeof(utofu_vcq_id_t) * _XMP_world_size);
51  _xmp_utofu_vcq_ids_org = (utofu_vcq_id_t*)malloc(sizeof(utofu_vcq_id_t) * _XMP_world_size);
52 
53  // Send VCQ ID to all ranks
54  MPI_Allgather(&vcq_ids, 1, MPI_UINT64_T,
55  _xmp_utofu_vcq_ids, 1, MPI_UINT64_T,
56  MPI_COMM_WORLD);
57 
58  // Copy vcq id original
59  for( int i = 0; i < _XMP_world_size; i++ )
60  _xmp_utofu_vcq_ids_org[i] = _xmp_utofu_vcq_ids[i];
61 
62  // Set default communication path coordinates by remote VCQ ID
63  for( int i = 0; i < _XMP_world_size; i++ ) {
64  if( i != _XMP_world_rank ) {
65  utofu_set_vcq_id_path( &(_xmp_utofu_vcq_ids[i]), NULL );
66  }
67  }
68 
69  _xmp_utofu_num_of_puts = 0;
70  _xmp_utofu_num_of_gets = 0;
71 
72  _xmp_utofu_edata_flag_sync_images = ((1 << (8 * _xmp_utofu_onesided_caps->max_edata_size)) - 1);
73  _xmp_utofu_edata_flag_armw_puts = ((1 << (8 * _xmp_utofu_onesided_caps->max_edata_size)) - 1);
74  _xmp_utofu_edata_flag_armw_gets = ((1 << (8 * _xmp_utofu_onesided_caps->max_edata_size)) - 2);
75 
76  MPI_Barrier(MPI_COMM_WORLD);
77 }
Here is the call graph for this function:
Here is the caller graph for this function:
_XMP_utofu_sync_all
void _XMP_utofu_sync_all(void)
Definition: xmp_coarray_utofu.c:975
_XMP_world_size
int _XMP_world_size
Definition: xmp_world.c:8
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42