00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef ROMIO_DATALOOP_H
00009 #define ROMIO_DATALOOP_H
00010 
00011 #include <assert.h>
00012 #include <stdlib.h>
00013 
00014 
00015 #ifdef HAVE_MPITYPEDEFS_H
00016 #include "mpitypedefs.h"
00017 #endif
00018 #ifdef HAVE_MPICHCONF_H
00019 #include "mpichconf.h"
00020 #endif
00021 #include "romioconf.h"
00022 
00023 #include <mpi.h>
00024 
00025 
00026 
00027 
00028 #define PREPEND_PREFIX(fn) MPIO_ ## fn
00029 
00030 struct MPIO_iovec {
00031     MPI_Offset base;
00032     MPI_Offset len;
00033 };
00034 
00035 
00036 
00037 
00038 #define DLOOP_Offset     MPI_Offset
00039 #define DLOOP_Count      MPI_Offset
00040 #define DLOOP_Handle     MPI_Datatype
00041 #define DLOOP_Type       MPI_Datatype
00042 #define DLOOP_Buffer     void *
00043 #define DLOOP_VECTOR     struct MPIO_iovec
00044 #define DLOOP_VECTOR_LEN len
00045 #define DLOOP_VECTOR_BUF base
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 #define DLOOP_Handle_get_loopdepth_macro(handle_,depth_,flag_) \
00063     MPIO_Datatype_get_loopdepth(handle_,&(depth_),flag_)
00064 
00065 #define DLOOP_Handle_get_loopsize_macro(handle_,size_,flag_) \
00066     MPIO_Datatype_get_loopsize(handle_,&(size_),flag_)
00067 
00068 #define DLOOP_Handle_set_loopptr_macro(handle_,lptr_,flag_) \
00069     MPIO_Datatype_set_loopptr(handle_,lptr_,flag_)
00070 
00071 #define DLOOP_Handle_set_loopdepth_macro(handle_,depth_,flag_) \
00072     MPIO_Datatype_set_loopdepth(handle_,depth_,flag_)
00073 
00074 #define DLOOP_Handle_set_loopsize_macro(handle_,size_,flag_) \
00075     MPIO_Datatype_set_loopsize(handle_,size_,flag_)
00076 
00077 #define DLOOP_Handle_get_loopptr_macro(handle_,lptr_,flag_) \
00078     MPIO_Datatype_get_loopptr(handle_,&(lptr_),flag_)
00079 
00080 #define DLOOP_Handle_get_size_macro(handle_,size_) \
00081     MPIO_Datatype_get_size(handle_,&(size_))
00082 
00083 #define DLOOP_Handle_get_basic_type_macro(handle_,eltype_) \
00084     MPIO_Datatype_get_el_type(handle_, &(eltype_), 0)
00085 
00086 #define DLOOP_Handle_get_extent_macro(handle_,extent_) \
00087     MPIO_Datatype_get_extent(handle_,&(extent_))
00088 
00089 #define DLOOP_Handle_hasloop_macro(handle_) \
00090     (MPIO_Datatype_is_nontrivial(handle_))
00091 
00092 
00093 #define DLOOP_Malloc malloc
00094 #define DLOOP_Free   free
00095 
00096 
00097 #define DLOOP_dbg_printf printf
00098 
00099 
00100 #define DLOOP_Assert assert
00101 
00102 
00103 #define MPIO_Type_access_contents MPID_Type_access_contents
00104 #define MPIO_Type_release_contents MPID_Type_release_contents
00105 
00106 
00107 
00108 
00109 #include "./dataloop_parts.h"
00110 #include "./dataloop_create.h"
00111 
00112 
00113 void MPIO_Datatype_init_dataloop(MPI_Datatype type);
00114 void MPIO_Datatype_get_size(MPI_Datatype type, MPI_Offset *size_p);
00115 void MPIO_Datatype_get_extent(MPI_Datatype type, MPI_Offset *extent_p);
00116 void MPIO_Datatype_get_block_info(MPI_Datatype type, MPI_Offset *true_lb,
00117                   MPI_Offset *count, int *n_contig);
00118 int MPIO_Datatype_is_nontrivial(MPI_Datatype type);
00119 void MPIO_Datatype_get_el_type(MPI_Datatype type, MPI_Datatype *eltype_p,
00120                    int flag);
00121 
00122 
00123 void MPIO_Datatype_get_loopptr(MPI_Datatype type, MPIO_Dataloop **ptr_p,
00124                    int flag);
00125 void MPIO_Datatype_get_loopsize(MPI_Datatype type, int *size_p, int flag);
00126 void MPIO_Datatype_get_loopdepth(MPI_Datatype type, int *depth_p, int flag);
00127 void MPIO_Datatype_set_loopptr(MPI_Datatype type, MPIO_Dataloop *ptr, int flag);
00128 void MPIO_Datatype_set_loopsize(MPI_Datatype type, int size, int flag);
00129 void MPIO_Datatype_set_loopdepth(MPI_Datatype type, int depth, int flag);
00130 
00131 
00132 void MPIO_Type_access_contents(MPI_Datatype type,
00133                    int **ints_p,
00134                    MPI_Aint **aints_p,
00135                    MPI_Datatype **types_p);
00136 void MPIO_Type_release_contents(MPI_Datatype type,
00137                 int **ints_p,
00138                 MPI_Aint **aints_p,
00139                 MPI_Datatype **types_p);
00140 
00141 
00142 
00143 
00144 
00145 #define MPID_DATALOOP_HETEROGENEOUS DLOOP_DATALOOP_HETEROGENEOUS
00146 #define MPID_DATALOOP_HOMOGENEOUS   DLOOP_DATALOOP_HOMOGENEOUS
00147 
00148 #endif