00001
00008 #ifndef INTERCOMM_H
00009 #define INTERCOMM_H
00010
00011 #define IC_BDECOMP 1
00012 #define IC_TTABLE 2
00013
00014
00015
00017 typedef struct {
00018 int nbNode;
00019 char* name;
00020 int* tid;
00021 int myPos;
00022 char* joined;
00023 } IC_Program;
00024
00025 struct leaf_node;
00026
00028 typedef struct decomp_TREE {
00029 int nDims;
00030 int num_of_partitions;
00031 struct decomp_TREE* children;
00032 int* keys;
00033 struct leaf_node* block_info;
00034 } IC_Tree;
00035
00037 typedef struct {
00038 int type;
00039 void* spec;
00040 } IC_Desc;
00041
00042 typedef enum { R_Enum, R_HPF } T_RegionType;
00043 typedef enum { R_replicated, R_distributed, R_local } T_RegionDistribution;
00044 typedef enum { Mem_Copy, Mem_Pointer } T_MemOp;
00045
00047 typedef struct {
00048 T_RegionType type;
00049 T_RegionDistribution distribution;
00050 T_MemOp mem_type;
00051 int size;
00052 } IC_Region;
00053
00054 typedef struct OneSched_ {
00055 struct OneSched_ *next;
00056 int offset;
00057 int size;
00058 } OneSched_s;
00059
00061 typedef struct {
00062 int nproc;
00063 int *size;
00064 OneSched_s **sched;
00065 OneSched_s **last;
00066 } IC_Sched;
00067
00075 IC_Program* IC_Init(char* name, int tasks, int rank);
00076
00083 IC_Program* IC_Wait(char* name, int tasks);
00084
00091 int IC_Sync(IC_Program* myprog, IC_Program* prog);
00092
00101 IC_Desc* IC_Create_bdecomp_desc(int ndims, int* blocks, int* tasks, int count);
00102
00111 IC_Desc* IC_Create_ttable_desc(int* globals, int* locals, int* tasks, int count);
00112
00117 IC_Tree* IC_Create_bdecomp_tree();
00118
00126 void IC_Section(IC_Tree* root, int dim, int count, int* indices);
00127
00137 void IC_Partition(IC_Tree* root, int dim, int* block, int count, int* indices);
00138
00148 IC_Desc* IC_Verify_bdecomp_tree(IC_Tree* root, int ndims, int* size, int* tasks, int count);
00149
00158 IC_Region* IC_Create_block_region(int ndims, int* lower, int* upper, int* stride);
00159
00166 IC_Region* IC_Create_enum_region(int* indices, int count);
00167
00177 IC_Sched* IC_Compute_schedule(IC_Program* myprog, IC_Program* prog, IC_Desc* desc,
00178 IC_Region** region_set, int set_size);
00179
00180
00181 #define TYPE void
00182
00198 int IC_Send_TYPE(IC_Program* to, IC_Sched* sched, TYPE* data, int tag);
00199
00200 int IC_Send_char(IC_Program* to, IC_Sched* sched, char* data, int tag);
00201 int IC_Send_short(IC_Program* to, IC_Sched* sched, short* data, int tag);
00202 int IC_Send_int(IC_Program* to, IC_Sched* sched, int* data, int tag);
00203 int IC_Send_long(IC_Program* to, IC_Sched* sched, long* data, int tag);
00204 int IC_Send_float(IC_Program* to, IC_Sched* sched, float* data, int tag);
00205 int IC_Send_double(IC_Program* to, IC_Sched* sched, double* data, int tag);
00206
00222 int IC_Recv_TYPE(IC_Program* from, IC_Sched* sched, TYPE* data, int tag);
00223
00224 int IC_Recv_char(IC_Program* from, IC_Sched* sched, char* data, int tag);
00225 int IC_Recv_short(IC_Program* from, IC_Sched* sched, short* data, int tag);
00226 int IC_Recv_int(IC_Program* from, IC_Sched* sched, int* data, int tag);
00227 int IC_Recv_float(IC_Program* from, IC_Sched* sched, float* data, int tag);
00228 int IC_Recv_double(IC_Program* from, IC_Sched* sched, double* data, int tag);
00229
00234 void IC_Free_sched(IC_Sched* sched);
00235
00240 void IC_Free_region(IC_Region* region);
00241
00246 void IC_Free_desc(IC_Desc* desc);
00247
00252 void IC_Free_program(IC_Program* prog);
00253
00259 void IC_Quit(IC_Program* myprog);
00260
00265 void IC_Print_error(char* msg);
00266
00267 #endif