00001
00002
00003
00004 #ifndef _MBLK_H
00005 #define _MBLK_H
00006 #include "converse.h"
00007 #include "pup_c.h"
00008
00009
00010 #define MBLK_BYTE 0
00011 #define MBLK_INT 1
00012 #define MBLK_REAL 2
00013 #define MBLK_DOUBLE 3
00014
00015
00016 #define MBLK_SUM 0
00017 #define MBLK_MAX 1
00018 #define MBLK_MIN 2
00019
00020
00021 #define MBLK_SUCCESS 1
00022 #define MBLK_FAILURE 0
00023
00024
00025 #define MBLK_DONE 1
00026 #define MBLK_NOTDONE 0
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 typedef void (*MBLK_PupFn)(pup_er, void*);
00033 typedef void (*MBLK_BcFn)(void *p1,void *p2,int *start,int *end);
00034
00035
00036 void MBLK_Init(int comm);
00037 int MBLK_Read(const char *prefix,int nDimensions);
00038
00039
00040 int MBLK_Get_nblocks(int *n);
00041 int MBLK_Get_myblock(int *m);
00042 int MBLK_Get_blocksize(int *dims);
00043 int MBLK_Get_nodelocs(const int *nodedim,double *nodeloc);
00044 double MBLK_Timer(void);
00045 void MBLK_Print(const char *str);
00046 void MBLK_Print_block(void);
00047
00048
00049 int MBLK_Create_field(int *dimensions,int isVoxel,
00050 const int base_type, const int vec_len,
00051 const int offset, const int dist,
00052 int *fid);
00053
00054
00055 int MBLK_Update_field(const int fid, int ghostWidth, void *grid);
00056 int MBLK_Iupdate_field(const int fid, int ghostWidth, void *ingrid, void *outgrid);
00057 int MBLK_Test_update(int *status);
00058 int MBLK_Wait_update(void);
00059
00060
00061 int MBLK_Reduce_field(const int fid, void *grid, void *out, const int op);
00062 int MBLK_Reduce(const int fid, void *in, void *out, const int op);
00063
00064
00065 int MBLK_Register_bc(const int bcnum, int ghostWidth, const MBLK_BcFn bcfn);
00066 int MBLK_Apply_bc(const int bcnum, void *p1,void *p2);
00067 int MBLK_Apply_bc_all(void *p1,void *p2);
00068
00069
00070 int MBLK_Register(void *userData, MBLK_PupFn _pup_ud, int *rid);
00071 int MBLK_Migrate(void);
00072 int MBLK_Get_registered(int rid, void ** block);
00073
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077
00078 #endif
00079