root/oshmem/mca/scoll/mpi/scoll_mpi_dtypes.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. shmem_dtype_to_ompi_dtype
  2. shmem_op_to_ompi_op

   1 #ifndef SCOLL_MPI_DTYPES_H
   2 #define SCOLL_MPI_DTYPES_H
   3 
   4 #include "oshmem/op/op.h"
   5 #include "ompi/datatype/ompi_datatype.h"
   6 #include "ompi/op/op.h"
   7 
   8 static struct ompi_datatype_t* shmem_dtype_to_ompi_dtype(oshmem_op_t *op)
   9 {
  10     int dtype = op->dt;
  11     int dtsize = op->dt_size * 8;
  12     switch (dtype) {
  13     case OSHMEM_OP_TYPE_FLOAT:
  14         return &ompi_mpi_float.dt;
  15     case OSHMEM_OP_TYPE_DOUBLE:
  16         return &ompi_mpi_double.dt;
  17     case OSHMEM_OP_TYPE_LDOUBLE:
  18         return &ompi_mpi_long_double.dt;
  19     case OSHMEM_OP_TYPE_FCOMPLEX:
  20         return &ompi_mpi_c_float_complex.dt;
  21     case OSHMEM_OP_TYPE_DCOMPLEX:
  22         return &ompi_mpi_c_double_complex.dt;
  23     case OSHMEM_OP_TYPE_FINT4:
  24         return &ompi_mpi_integer4.dt;
  25     case OSHMEM_OP_TYPE_FINT8:
  26         return &ompi_mpi_integer8.dt;
  27     case OSHMEM_OP_TYPE_FREAL4:
  28         return &ompi_mpi_real4.dt;
  29     case OSHMEM_OP_TYPE_FREAL8:
  30         return &ompi_mpi_real8.dt;
  31     case OSHMEM_OP_TYPE_FREAL16:
  32         return &ompi_mpi_real16.dt;
  33     default:
  34         switch (dtsize) {
  35             case 64:
  36                 return &ompi_mpi_int64_t.dt;
  37             case 32:
  38                 return &ompi_mpi_int32_t.dt;
  39             case 16:
  40                 return &ompi_mpi_int16_t.dt;
  41             case 8:
  42                 return &ompi_mpi_int8_t.dt;
  43             default:
  44                 return &ompi_mpi_datatype_null.dt;
  45         }
  46     }
  47 }
  48 
  49 static struct ompi_op_t* shmem_op_to_ompi_op(int op)
  50 {
  51     switch (op) {
  52     case OSHMEM_OP_AND:
  53         return &(ompi_mpi_op_band.op);
  54     case OSHMEM_OP_OR:
  55         return &(ompi_mpi_op_bor.op);
  56     case OSHMEM_OP_XOR:
  57         return &(ompi_mpi_op_bxor.op);
  58     case OSHMEM_OP_MAX:
  59         return &(ompi_mpi_op_max.op);
  60     case OSHMEM_OP_MIN:
  61         return &(ompi_mpi_op_min.op);
  62     case OSHMEM_OP_SUM:
  63         return &(ompi_mpi_op_sum.op);
  64     case OSHMEM_OP_PROD:
  65         return &(ompi_mpi_op_prod.op);
  66     default:
  67         return &(ompi_mpi_op_null.op);
  68     }
  69 }
  70 
  71 #endif /* SCOLL_MPI_DTYPES_H */

/* [<][>][^][v][top][bottom][index][help] */