diff options
author | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2001-06-12 22:37:51 +0000 |
---|---|---|
committer | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2001-06-12 22:37:51 +0000 |
commit | d7ef9dc3eb2dec7f338d77bcd435a4e86d386529 (patch) | |
tree | 4b132737e59473bb5808cd4c82012c580b0d93d9 /src/SetupPGH.c | |
parent | dac533161647369d074064828e5589f591a57594 (diff) |
Now PUGH also supports all the fixed-precision CCTK datatypes.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@334 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/SetupPGH.c')
-rw-r--r-- | src/SetupPGH.c | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/src/SetupPGH.c b/src/SetupPGH.c index 4597580..0687e38 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -187,13 +187,17 @@ int PUGH_Terminate (cGH *GH) @date Thu Aug 21 11:38:10 1997 @author Paul Walker @desc - Destroys a GH object. + Destroys a GH object. @enddesc -@@*/ -void PUGH_DestroyPGH(pGH **GHin) + @var GHin + @vdesc address of PUGH GH extensions object to be destroyed + @vtype pGH ** + @vio in + @endvar +@@*/ +void PUGH_DestroyPGH (pGH **GHin) { - /* First remove me from the list. */ pGH *GH; pGA *GA; cGroup pgroup; @@ -202,20 +206,28 @@ void PUGH_DestroyPGH(pGH **GHin) int group; int this_var; + GH = *GHin; #ifdef CCTK_MPI - CACTUS_MPI_ERROR(MPI_Type_free (&GH->PUGH_mpi_complex)); - CACTUS_MPI_ERROR(MPI_Comm_free(&(GH->PUGH_COMM_WORLD))); + CACTUS_MPI_ERROR (MPI_Comm_free (&GH->PUGH_COMM_WORLD)); + + CACTUS_MPI_ERROR (MPI_Type_free (&GH->PUGH_mpi_complex)); +#ifdef CCTK_REAL4 + CACTUS_MPI_ERROR (MPI_Type_free (&GH->PUGH_mpi_complex8)); +#endif +#ifdef CCTK_REAL8 + CACTUS_MPI_ERROR (MPI_Type_free (&GH->PUGH_mpi_complex16)); +#endif +#ifdef CCTK_REAL16 + CACTUS_MPI_ERROR (MPI_Type_free (&GH->PUGH_mpi_complex32)); +#endif #endif /* Great. Now go about the work of destroying me. */ - variable = 0; - for(group = 0; group < CCTK_NumGroups(); group++) { - #ifdef DEBUG_PUGH printf("Calling Destroying Group %s\n", CCTK_GroupName(group)); fflush(stdout); @@ -223,7 +235,6 @@ void PUGH_DestroyPGH(pGH **GHin) CCTK_GroupData(group,&pgroup); - /* destroy group comm buffers */ if (pgroup.grouptype == CCTK_ARRAY || pgroup.grouptype == CCTK_GF) { GA = (pGA *) GH->variables[variable][0]; @@ -283,10 +294,7 @@ void PUGH_DestroyPGH(pGH **GHin) } free(GH->Connectivity); free(GH->GFExtras); - if(GH->variables) - { - free(GH->variables); - } + free(GH->variables); free(GH); *GHin = NULL; } @@ -651,11 +659,25 @@ static int Setup_nProcs (pGH *pughGH, int dim) /* define the complex datatype as a concatanation of 2 PUGH_MPI_REALs */ CACTUS_MPI_ERROR (MPI_Type_contiguous (2, PUGH_MPI_REAL, &pughGH->PUGH_mpi_complex)); - /* the same for single precision */ + CACTUS_MPI_ERROR (MPI_Type_commit (&pughGH->PUGH_mpi_complex)); + + /* dito for fixed-precision reals */ +#ifdef CCTK_REAL4 CACTUS_MPI_ERROR (MPI_Type_contiguous (2, PUGH_MPI_REAL4, &pughGH->PUGH_mpi_complex8)); - CACTUS_MPI_ERROR (MPI_Type_commit (&pughGH->PUGH_mpi_complex)); CACTUS_MPI_ERROR (MPI_Type_commit (&pughGH->PUGH_mpi_complex8)); +#endif +#ifdef CCTK_REAL8 + CACTUS_MPI_ERROR (MPI_Type_contiguous (2, PUGH_MPI_REAL8, + &pughGH->PUGH_mpi_complex16)); + CACTUS_MPI_ERROR (MPI_Type_commit (&pughGH->PUGH_mpi_complex16)); +#endif +#ifdef CCTK_REAL16 + CACTUS_MPI_ERROR (MPI_Type_contiguous (2, PUGH_MPI_REAL16, + &pughGH->PUGH_mpi_complex32)); + CACTUS_MPI_ERROR (MPI_Type_commit (&pughGH->PUGH_mpi_complex32)); +#endif + #else pughGH->nprocs = 1; pughGH->myproc = 0; |