00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef BSP_REQTABLE_H
00028 #define BSP_REQTABLE_H
00029
00037 #include "bsp_exptable.h"
00038 #include <stdlib.h>
00039 #include <config.h>
00040
00041 void requestTable_execute (const ExpandableTable *restrict , ExpandableTable * restrict);
00042
00048 static inline void
00049 requestTable_initialize (ExpandableTable * restrict table, const unsigned int nprocs,
00050 const unsigned int rows)
00051 {
00052 union SpecInfo info;
00053 info.req.data_sizes = bsp_calloc( nprocs, sizeof(unsigned int));
00054 fixedElSizeTable_initialize (table, nprocs, rows, sizeof (ReqElement), info);
00055 }
00056
00059 static inline void
00060 requestTable_destruct (ExpandableTable *restrict table)
00061 {
00062 bsp_free(table->info.req.data_sizes);
00063 expandableTable_destruct (table);
00064 }
00065
00066 static inline void
00067 requestTable_reset(ExpandableTable *restrict table)
00068 {
00069 memset(table->info.req.data_sizes, 0, table->nprocs * sizeof(unsigned int));
00070 expandableTable_reset(table);
00071 }
00072
00073
00078 static inline void
00079 requestTable_expand (ExpandableTable *restrict table, const unsigned int rows)
00080 {
00081 expandableTable_expand (table, rows, table->info);
00082 }
00083
00084
00085 static void
00086 newReqInfoAtPush (union SpecInfo *restrict info, unsigned int rows, unsigned int bla)
00087 {
00088 }
00089
00095 static inline void
00096 requestTable_push (ExpandableTable * restrict table, const unsigned int proc, const ReqElement element)
00097 {
00098 table->info.req.data_sizes[proc] += element.size + sizeof(DelivElement);
00099 fixedElSizeTable_push (table, proc, &newReqInfoAtPush, (char *) &element);
00100 }
00101
00102 #endif