aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlanfer <lanfer@10716dce-81a3-4424-a2c8-48026a0d3035>2000-05-02 16:59:56 +0000
committerlanfer <lanfer@10716dce-81a3-4424-a2c8-48026a0d3035>2000-05-02 16:59:56 +0000
commit7e5a6ddb87efa8830e01841ebe1cccf1a45c0b0d (patch)
tree3c85bad4b8e6e661a737eb97317f2d66064e241f /src
parent3363fdc5acbe092423e6d6284aaaa7c8eb1259c4 (diff)
stuff compiles now, removed dsize= nlocpoints
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@8 10716dce-81a3-4424-a2c8-48026a0d3035
Diffstat (limited to 'src')
-rw-r--r--src/CollectData1D.c19
-rw-r--r--src/TestSlab.c51
2 files changed, 23 insertions, 47 deletions
diff --git a/src/CollectData1D.c b/src/CollectData1D.c
index 4d7c792..c525746 100644
--- a/src/CollectData1D.c
+++ b/src/CollectData1D.c
@@ -14,9 +14,9 @@
#define TAGBASE 1234
#define MAX_DIM 3
-int CollectData1D(cGH *GH, int vindex, int vtype, int vtypesize,int vtimelvl,
- int vdim, int *S_l, int *u_l, int ds, int len_l,
- int dsize, void **dptr)
+int CollectData1D(cGH *GH, int vindex, int vtimelvl, int vdim,
+ int *S_l, int *u_l, int ds, int len_l,
+ void **dptr, int *dsize)
{
void *loc_dptr;
@@ -27,6 +27,7 @@ int CollectData1D(cGH *GH, int vindex, int vtype, int vtypesize,int vtimelvl,
int *rem_dcount;
+ int vtype, vtypesize;
int iproc,myproc,nprocs;
int vmpi_type;
int *displs;
@@ -41,6 +42,9 @@ int CollectData1D(cGH *GH, int vindex, int vtype, int vtypesize,int vtimelvl,
nprocs = CCTK_nProcs(GH);
vmpi_type= PUGH_MPI_REAL;
+ vtype = CCTK_GroupTypeFromVarI(vindex);
+ vtypesize= CCTK_VarTypeSize(vtype);
+
rem_dcount=(CCTK_INT *) malloc (nprocs * sizeof (CCTK_INT));
ierr = CollectLocalData1D(GH, vindex, vtype, vtypesize, vtimelvl,
@@ -74,8 +78,8 @@ int CollectData1D(cGH *GH, int vindex, int vtype, int vtypesize,int vtimelvl,
}
-int CollectLocalData1D(cGH *GH, int vindex, int vtype, int vtypesize, int vtimelvl,
- int vdim, int *S_l, int *u_l, int ds, int len_l,
+int CollectLocalData1D(cGH *GH, int vindex, int vtimelvl, int vdim,
+ int *S_l, int *u_l, int ds, int len_l,
void **loc_dptr, int *dsize)
{
int *locstart, *locend, nlocpoints;
@@ -84,6 +88,7 @@ int CollectLocalData1D(cGH *GH, int vindex, int vtype, int vtypesize, int vtimel
int idim,l;
int vmpi_type;
+ int vtype, vtypesize;
void *data = CCTK_VarDataPtrI (GH, vtimelvl, vindex);
@@ -91,6 +96,8 @@ int CollectLocalData1D(cGH *GH, int vindex, int vtype, int vtypesize, int vtimel
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
+ vtype = CCTK_GroupTypeFromVarI(vindex);
+ vtypesize= CCTK_VarTypeSize(vtype);
switch (vtype) {
@@ -187,5 +194,5 @@ int CollectLocalData1D(cGH *GH, int vindex, int vtype, int vtypesize, int vtimel
}
}
- *dsize = nlocpoints;
}
+
diff --git a/src/TestSlab.c b/src/TestSlab.c
index 00a8102..c812cb3 100644
--- a/src/TestSlab.c
+++ b/src/TestSlab.c
@@ -17,14 +17,15 @@
#define ABS(a) ((a)<0 ? -(a) : (a))
int IsPointOnProc(int dim, int *gownership, int *pnt);
-int GetLocalLine(cGH *GH,
- int vardim, int *P_l, int *u_l, int *ds, int len_l,
- int *locstart, int *locend, int *nlocpoints);
-int CollectLocalData1D(cGH *GH, int vindex, int vtype, int vtypesize, int vtimelvl,
- int vdim, int *S_l, int *u_l, int ds, int len_l,
+int CollectLocalData1D(cGH *GH, int vindex, int vtimelvl, int vdim,
+ int *S_l, int *u_l, int ds, int len_l,
void **loc_dptr, int *dsize);
+int CollectData1D(cGH *GH, int vindex, int vtimelvl, int vdim,
+ int *S_l, int *u_l, int ds, int len_l,
+ void **loc_dptr, int *dsize);
+
void TestSlab(CCTK_ARGUMENTS) {
DECLARE_CCTK_ARGUMENTS
@@ -34,14 +35,11 @@ void TestSlab(CCTK_ARGUMENTS) {
int nprocs,iproc; /* number of procs */
int *c_nlocpoints; /* collected number of points per proc (size nproc) */
pGH *pughGH;
- int gindex;
- int vtype, vindex, vtypesize, vdim, vtimelvl;
+ int vindex, gindex;
+ int vdim, vtimelvl;
void *loc_dptr;
vindex = CCTK_VarIndex("grid::x");
- gindex = CCTK_GroupIndexFromVarI(vindex);
- vtype = CCTK_GroupTypeFromVarI(vindex);
- vtypesize= CCTK_VarTypeSize(vtype);
vtimelvl = CCTK_NumTimeLevelsFromVarI (vindex) - 1;
vdim = CCTK_GroupDimI(gindex);
@@ -56,37 +54,8 @@ void TestSlab(CCTK_ARGUMENTS) {
ds=1;
- CollectLocalData1D(cctkGH, vindex, vtype, vtypesize, vtimelvl,
- vdim, gs, di, ds, -1, &loc_dptr, &nlocpoints);
-
-
-}
-
-void TestGetLocalLine(CCTK_ARGUMENTS) {
- DECLARE_CCTK_ARGUMENTS
-
- int gs[3], di[3], ds[1]; /* global start/direction/downsampling*/
- int ls[3], le[3]; /* local start/end */
- int nlocpoints; /* number of points */
- int nprocs,iproc; /* number of procs */
- int *c_nlocpoints; /* collected number of points per proc (size nproc) */
- pGH *pughGH;
-
- pughGH = PUGH_pGH (cctkGH);
-
- gs[0]=1;
- gs[1]=5;
- gs[2]=9;
-
- di[0]= 0;
- di[1]=-1;
- di[2]= 2;
-
- ds[0]=1;
- printf("Calling CollectData \n");
- CollectLocalData1D(cctkGH, vindex, vtype, vtypesize, vtimelvl,
- vdim, gs, di, ds, -1, &loc_dptr, &nlocpoints);
+ CollectLocalData1D(cctkGH, vindex, vtimelvl, vdim,
+ gs, di, ds, -1, &loc_dptr, &nlocpoints);
}
-