aboutsummaryrefslogtreecommitdiff
path: root/src/SetupPGV.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/SetupPGV.c')
-rw-r--r--src/SetupPGV.c147
1 files changed, 64 insertions, 83 deletions
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);
}