bsp_reqtable.h

Go to the documentation of this file.
00001 /*
00002     BSPonMPI. This is an implementation of the BSPlib standard on top of MPI
00003     Copyright (C) 2006  Wijnand J. Suijlen
00004                                                                                 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009                                                                                 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014                                                                                 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018                                                                                 
00019     You may contact me via electronic mail:
00020       wjsuijle@users.sourceforge.net
00021     or snail mail:
00022       W.J. Suijlen
00023       Kraaiheidelaan 10
00024       2803 VP Gouda
00025       The Netherlands
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

Generated on Sat Apr 8 20:12:29 2006 for BSPonMPI by  doxygen 1.4.6