From 57e99b9915d3f38d2de146074d636f1bd22c0d83 Mon Sep 17 00:00:00 2001 From: tradke Date: Fri, 5 Dec 2003 17:04:34 +0000 Subject: Made a few more functions static. Fixed gcc compiler warnings about unused parameters. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@425 b61c5cb5-eaca-4651-9a7a-d64986f99364 --- src/SetupGroup.c | 19 +++---- src/SetupPGV.c | 147 +++++++++++++++++++++++----------------------------- src/include/pughi.h | 65 +---------------------- 3 files changed, 71 insertions(+), 160 deletions(-) diff --git a/src/SetupGroup.c b/src/SetupGroup.c index 79c4da0..076fe7c 100644 --- a/src/SetupGroup.c +++ b/src/SetupGroup.c @@ -33,8 +33,7 @@ static int PUGH_SetupGAGroup (pGH *newGH, int n_variables, int vectorlength, int staggercode, - int n_timelevels, - int vectorgroup); + int n_timelevels); /*@@ @@ -95,11 +94,6 @@ static int PUGH_SetupGAGroup (pGH *newGH, @vtype int @vio in @endvar - @var vectorgroup - @vdesc is this a vector group ? - @vtype int - @vio in - @endvar @returntype int @returndesc @@ -116,8 +110,7 @@ static int PUGH_SetupGAGroup (pGH *newGH, int n_variables, int vectorlength, int staggercode, - int n_timelevels, - int vectorgroup) + int n_timelevels) { int i; int variable; @@ -178,12 +171,10 @@ static int PUGH_SetupGAGroup (pGH *newGH, groupcomm = NULL; if(newGH->commmodel == PUGH_ALLOCATEDBUFFERS) { - groupcomm = PUGH_SetupGArrayGroupComm (newGH, - dim, + groupcomm = PUGH_SetupGArrayGroupComm (dim, newGH->nvariables, n_variables, 0, - vtype, extras); } @@ -321,9 +312,11 @@ int PUGH_SetupGroup (pGH *newGH, { int retval; + + (void) (vectorgroup + 0); retval = PUGH_SetupGAGroup (newGH, nsize, nghostsize, gtype, vtype, dim, n_variables, vectorlength, staggercode, - n_timelevels, vectorgroup); + n_timelevels); return (retval); } diff --git a/src/SetupPGV.c b/src/SetupPGV.c index 4eca675..ddbc401 100644 --- a/src/SetupPGV.c +++ b/src/SetupPGV.c @@ -32,6 +32,31 @@ CCTK_FILEVERSION(CactusPUGH_PUGH_SetupPGV_c) ********************* Local Routine Prototypes ********************* ********************************************************************/ +static int PUGH_SetupPGExtrasMemory(int dim, int total_procs, pGExtras *this); +static int PUGH_SetupPGExtrasOwnership(int dim, + int *perme, + int this_proc, + pGExtras *this); +static int PUGH_SetupPGExtrasStaggering(int dim, int this_proc, pGExtras *this); +static int PUGH_SetupBoundingBox(int is_gf, + int dim, + int stagger, + int *nghosts, + int total_procs, + int *nprocs, + pGExtras *this); +static int PUGH_SetupRemoteSizes(int dim, int total_procs, pGExtras *this); +static int PUGH_SetupPGExtrasSizes(int is_gf, + int dim, + int stagger, + int *sh, + int *nghosts, + int total_procs, + int *nprocs, + int this_proc, + pGExtras *this); +static int PUGH_ComposeIJK(int dim, int *nprocs, int *pos); +static int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos); static int PUGH_IntegerRoot(int number, int invpower); static int IntSort(const void *a, const void *b); @@ -74,22 +99,16 @@ pGExtras *PUGH_SetupPGExtras(int is_gf, /* Setup memory */ if(this) { - error = PUGH_SetupPGExtrasMemory(dim, - total_procs, - nprocs, - this); - + error = PUGH_SetupPGExtrasMemory(dim, total_procs, this); if(!error) { this->dim = dim; - PUGH_SetupPGExtrasSizes(is_gf, dim, perme, stagger, sh, nghosts, + PUGH_SetupPGExtrasSizes(is_gf, dim, stagger, sh, nghosts, total_procs, nprocs, this_proc,this); - PUGH_SetupPGExtrasOwnership(dim, perme, stagger, sh, nghosts, - total_procs, nprocs, this_proc, this); - PUGH_SetupPGExtrasStaggering(dim, perme, stagger, sh, nghosts, - total_procs, nprocs, this_proc, this); + PUGH_SetupPGExtrasOwnership(dim, perme, this_proc, this); + PUGH_SetupPGExtrasStaggering(dim, this_proc, this); } } @@ -476,7 +495,7 @@ int PUGH_GenerateNeighbours(int dim, Taken from libHLL. @enddesc @@*/ -int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos) +static int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos) { int idim; @@ -506,9 +525,7 @@ int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos) Taken from libHLL. @enddesc @@*/ -int PUGH_ComposeIJK(int dim, - int *nprocs, - int *pos) +static int PUGH_ComposeIJK(int dim, int *nprocs, int *pos) { int ijk; int idim; @@ -536,10 +553,7 @@ int PUGH_ComposeIJK(int dim, Allocate memory for the members of the pGExtras structure. @enddesc @@*/ -int PUGH_SetupPGExtrasMemory(int dim, - int total_procs, - int *nprocs, - pGExtras *this) +static int PUGH_SetupPGExtrasMemory(int dim, int total_procs, pGExtras *this) { int retcode; int i,j,k; @@ -794,16 +808,15 @@ int PUGH_SetupPGExtrasMemory(int dim, structure. @enddesc @@*/ -int PUGH_SetupPGExtrasSizes(int is_gf, - int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this) +static int PUGH_SetupPGExtrasSizes(int is_gf, + int dim, + int stagger, + int *sh, + int *nghosts, + int total_procs, + int *nprocs, + int this_proc, + pGExtras *this) { int dir; int maxpoints, minpoints, avgpoints,proc; @@ -839,9 +852,7 @@ int PUGH_SetupPGExtrasSizes(int is_gf, PUGH_SetupBoundingBox(is_gf, dim, - perme, stagger, - sh, nghosts, total_procs, nprocs, @@ -849,14 +860,7 @@ int PUGH_SetupPGExtrasSizes(int is_gf, /* Set the remote sizes */ - PUGH_SetupRemoteSizes(dim, - perme, - stagger, - sh, - nghosts, - total_procs, - nprocs, - this); + PUGH_SetupRemoteSizes(dim, total_procs, this); /* Set the local sizes */ @@ -897,15 +901,10 @@ int PUGH_SetupPGExtrasSizes(int is_gf, Mostly taken from original SetupOwnership by Paul. @enddesc @@*/ -int PUGH_SetupPGExtrasOwnership(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this) +static int PUGH_SetupPGExtrasOwnership(int dim, + int *perme, + int this_proc, + pGExtras *this) { int tmp; int dir, idir; @@ -1025,15 +1024,7 @@ int PUGH_SetupPGExtrasOwnership(int dim, return 0; } -int PUGH_SetupPGExtrasStaggering(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this) +static int PUGH_SetupPGExtrasStaggering(int dim, int this_proc, pGExtras *this) { int s,d,k,dir; int *upperbnd; @@ -1096,15 +1087,13 @@ int PUGH_SetupPGExtrasStaggering(int dim, Sets up the bounding box info for a pgExtras structure. @enddesc @@*/ -int PUGH_SetupBoundingBox(int is_gf, - int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - pGExtras *this) +static int PUGH_SetupBoundingBox(int is_gf, + int dim, + int stagger, + int *nghosts, + int total_procs, + int *nprocs, + pGExtras *this) { int pnum,dir; @@ -1191,14 +1180,7 @@ int PUGH_SetupBoundingBox(int is_gf, Determines info about the sizes on each processor. @enddesc @@*/ -int PUGH_SetupRemoteSizes(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - pGExtras *this) +static int PUGH_SetupRemoteSizes(int dim, int total_procs, pGExtras *this) { int pnum; int dir; @@ -1228,12 +1210,10 @@ int PUGH_SetupRemoteSizes(int dim, Sets up a communication buffer for a group of GAs. @enddesc @@*/ -pComm *PUGH_SetupGArrayGroupComm(pGH *pughGH, - int dim, +pComm *PUGH_SetupGArrayGroupComm(int dim, int first_var, int n_vars, int sync_timelevel, - int vartype, pGExtras *extras) { int i; @@ -1360,13 +1340,14 @@ pComm *PUGH_SetupGArrayComm(pGH *pughGH, int vartype, pGExtras *extras) { - return PUGH_SetupGArrayGroupComm(pughGH, - dim, - var, - 1, - sync_timelevel, - vartype, - extras); + pComm *result; + + + (void) (pughGH + 0); + (void) (vartype + 0); + result = PUGH_SetupGArrayGroupComm(dim, var, 1, sync_timelevel, extras); + + return (result); } diff --git a/src/include/pughi.h b/src/include/pughi.h index 71828db..75cf766 100644 --- a/src/include/pughi.h +++ b/src/include/pughi.h @@ -31,12 +31,10 @@ pGExtras *PUGH_SetupPGExtras(int is_gf, int *nprocs, int this_proc); -pComm *PUGH_SetupGArrayGroupComm(pGH *pughGH, - int dim, +pComm *PUGH_SetupGArrayGroupComm(int dim, int first_var, int n_vars, int sync_timelevel, - int vartype, pGExtras *extras); void pGH_DumpInfo(pGH *pughGH); @@ -55,67 +53,6 @@ int PUGH_GenerateNeighbours(int dim, int **neighbours, int *perme); -int PUGH_DecomposeIJK(int dim, int ijk, int *nprocs, int *pos); - -int PUGH_ComposeIJK(int dim, - int *nprocs, - int *pos); - -int PUGH_SetupPGExtrasMemory(int dim, - int total_procs, - int *nprocs, - pGExtras *this); - -int PUGH_SetupPGExtrasSizes(int is_gf, - int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this); - -int PUGH_SetupPGExtrasOwnership(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this); - -int PUGH_SetupBoundingBox(int is_gf, - int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - pGExtras *this); - -int PUGH_SetupRemoteSizes(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - pGExtras *this); - -int PUGH_SetupPGExtrasStaggering(int dim, - int *perme, - int stagger, - int *sh, - int *nghosts, - int total_procs, - int *nprocs, - int this_proc, - pGExtras *this); - pGA *PUGH_SetupGArray(void *parent, pGExtras *extras, pConnectivity *connectivity, -- cgit v1.2.3