aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2000-06-30 11:20:02 +0000
committertradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2000-06-30 11:20:02 +0000
commit952415f9aea62964c739add0010a3dc1d8f9726a (patch)
treec131138cb6e43e2106a835b135ae1f2c48d37c87 /src
parent66edcfad13a9079c5a0e270714b77c5d8147100c (diff)
Added support for CCTK_COMPLEX variables.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@26 10716dce-81a3-4424-a2c8-48026a0d3035
Diffstat (limited to 'src')
-rw-r--r--src/CollectData1D.c14
-rw-r--r--src/Hyperslab.c7
2 files changed, 16 insertions, 5 deletions
diff --git a/src/CollectData1D.c b/src/CollectData1D.c
index 3b1ba78..743b017 100644
--- a/src/CollectData1D.c
+++ b/src/CollectData1D.c
@@ -29,7 +29,7 @@ int GetLocalLine(cGH *GH, pGExtras *extras,
int vardim, const int *S_l, const int *u_l, int ds, int len_l,
int *locstart, int *locend, int *nlocpoints);
#ifdef CCTK_MPI
-static MPI_Datatype CCTKtoMPItype(int cctktype);
+static MPI_Datatype CCTKtoMPItype(pGH *pughGH, int cctktype);
#endif
@@ -144,12 +144,12 @@ int Hyperslab_CollectData1D(cGH *GH, int vindex, int vtimelvl,
#ifdef CCTK_MPI
+ pughGH = PUGH_pGH(GH);
+
rem_dcount = NULL;
recvcnts = NULL;
displs = NULL;
- vmpitype= CCTKtoMPItype(vtype);
-
- pughGH = PUGH_pGH(GH);
+ vmpitype= CCTKtoMPItype(pughGH, vtype);
/* Send local number of data elements */
tmp = (CCTK_INT) loc_dcount;
@@ -236,7 +236,7 @@ int Hyperslab_CollectData1D(cGH *GH, int vindex, int vtimelvl,
#ifdef CCTK_MPI
-static MPI_Datatype CCTKtoMPItype(int cctktype)
+static MPI_Datatype CCTKtoMPItype(pGH *pughGH, int cctktype)
{
MPI_Datatype mpitype;
switch (cctktype) {
@@ -253,6 +253,10 @@ static MPI_Datatype CCTKtoMPItype(int cctktype)
mpitype = PUGH_MPI_REAL;
break;
+ case CCTK_VARIABLE_COMPLEX:
+ mpitype = pughGH->PUGH_mpi_complex;
+ break;
+
default:
CCTK_WARN (1, "Unsupported MPI variable type");
mpitype = 0;
diff --git a/src/Hyperslab.c b/src/Hyperslab.c
index be060ec..8e9cef1 100644
--- a/src/Hyperslab.c
+++ b/src/Hyperslab.c
@@ -435,6 +435,11 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl,
point, startpoint, endpoint, downsample,
points_per_dim);
break;
+ case CCTK_VARIABLE_COMPLEX:
+ PICKUP_HYPERSLAB_DATA (CCTK_COMPLEX, vinfo.dim, vdata, *hdata,
+ point, startpoint, endpoint, downsample,
+ points_per_dim);
+ break;
default:
CCTK_WARN (1, "Unsupported variable type");
retval = -1;
@@ -739,6 +744,8 @@ int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl,
mpi_vtype = PUGH_MPI_INT; break;
case CCTK_VARIABLE_REAL:
mpi_vtype = PUGH_MPI_REAL; break;
+ case CCTK_VARIABLE_COMPLEX:
+ mpi_vtype = PUGH_pGH (GH)->PUGH_mpi_complex; break;
default:
CCTK_WARN (1, "Unsupported variable type"); break;
}