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

Macros

#define MPI_PORTABLE_PLATFORM_H
 

Functions

unsigned long long _XMP_get_on_ref_id (void)
 
void * _XMP_alloc (size_t size)
 
void _XMP_free (void *p)
 
void _XMP_fatal (char *msg)
 
void _XMP_fatal_nomsg ()
 
void _XMP_unexpected_error (void)
 
void _XMP_warning (char *msg)
 
_Bool union_triplet (int lb0, int ub0, int st0, int lb1, int ub1, int st1)
 

Macro Definition Documentation

◆ MPI_PORTABLE_PLATFORM_H

#define MPI_PORTABLE_PLATFORM_H

Function Documentation

◆ _XMP_alloc()

void* _XMP_alloc ( size_t  size)
22 {
23  void *addr;
24 #ifdef _XMP_FJRDMA
25  int error = posix_memalign(&addr, 128, size);
26  if(addr == NULL || error != 0)
27  _XMP_fatal("cannot allocate memory");
28 #else
29  addr = malloc(size);
30  if(addr == NULL)
31  _XMP_fatal("cannot allocate memory");
32 #endif
33 
34  return addr;
35 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _XMP_fatal()

void _XMP_fatal ( char *  msg)
43 {
44  fprintf(stderr, "[RANK:%d] XcalableMP runtime error: %s\n", _XMP_world_rank, msg);
45  MPI_Abort(MPI_COMM_WORLD, 1);
46 }

◆ _XMP_fatal_nomsg()

void _XMP_fatal_nomsg ( )
49 {
50  MPI_Abort(MPI_COMM_WORLD, 1);
51 }
Here is the caller graph for this function:

◆ _XMP_free()

void _XMP_free ( void *  p)
38 {
39  free(p);
40 }
Here is the caller graph for this function:

◆ _XMP_get_on_ref_id()

unsigned long long _XMP_get_on_ref_id ( void  )
14 {
15  if(_XMP_on_ref_id_count == ULLONG_MAX)
16  _XMP_fatal("cannot create a new nodes/template: too many");
17 
18  return _XMP_on_ref_id_count++;
19 }
Here is the caller graph for this function:

◆ _XMP_unexpected_error()

void _XMP_unexpected_error ( void  )
54 {
55  _XMP_fatal("unexpected error in runtime");
56 }
Here is the call graph for this function:

◆ _XMP_warning()

void _XMP_warning ( char *  msg)
58  {
59  fprintf(stderr, "[RANK:%d] XcalableMP runtime warning: %s\n", _XMP_world_rank, msg);
60 }
Here is the caller graph for this function:

◆ union_triplet()

_Bool union_triplet ( int  lb0,
int  ub0,
int  st0,
int  lb1,
int  ub1,
int  st1 
)
63 {
64  if (ub0 < lb0 || ub1 < lb0) return false;
65 
66  int lb2, ub2, st2;
67  int lb3, st3;
68 
69  if(lb0 > lb1){
70  lb2 = lb0;
71  lb3 = lb1;
72  st2 = st0;
73  st3 = st1;
74  }
75  else{
76  lb2 = lb1;
77  lb3 = lb0;
78  st2 = st1;
79  st3 = st0;
80  }
81 
82  ub2 = (ub0 > ub1)? ub1 : ub0;
83 
84  for(int i=lb2;i<= ub2;i+=st2)
85  if((i-lb3) % st3 == 0)
86  return true;
87 
88  return false;
89 }
Here is the caller graph for this function:
_XMP_world_rank
int _XMP_world_rank
Definition: xmp_world.c:9
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42