This source file includes following definitions.
- SHMEM_GENERATE_WEAK_BINDINGS
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 #include "oshmem_config.h"
  15 #include "oshmem/shmem/fortran/bindings.h"
  16 #include "oshmem/include/shmem.h"
  17 #include "oshmem/shmem/shmem_api_logger.h"
  18 #include "oshmem/runtime/runtime.h"
  19 #include "stdio.h"
  20 
  21 #if OSHMEM_PROFILING
  22 #include "oshmem/shmem/fortran/profile/pbindings.h"
  23 SHMEM_GENERATE_WEAK_BINDINGS(SHPALLOC, shpalloc)
  24 #include "oshmem/shmem/fortran/profile/defines.h"
  25 #endif
  26 
  27 SHMEM_GENERATE_FORTRAN_BINDINGS_SUB (void,
  28         SHPALLOC,
  29         shpalloc_,
  30         shpalloc__,
  31         shpalloc_f,
  32         (FORTRAN_POINTER_T *addr, MPI_Fint *length, MPI_Fint *errcode, MPI_Fint *abort),
  33         (addr,length,errcode,abort) )
  34 
  35 void shpalloc_f(FORTRAN_POINTER_T *addr, MPI_Fint *length, MPI_Fint *errcode, MPI_Fint *abort)
  36 {
  37     *errcode = 0;
  38     
  39     uint32_t *address;
  40     if (*length <= 0) {
  41         *errcode = -1;
  42     }
  43     address = shmalloc(*length*4);
  44 
  45     *addr = (FORTRAN_POINTER_T)(uintptr_t)address;
  46     if (!(*addr))
  47     {
  48         *errcode = -2;
  49         SHMEM_API_ERROR("could not allocate %i bytes in symmetric heap",*length*4);
  50         if (*abort)
  51         {
  52             SHMEM_API_ERROR("nonzero abort value, aborting..");
  53             oshmem_shmem_abort(-1);
  54         }
  55     }
  56 }
  57