diff options
author | goodale <goodale@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 1999-02-05 08:36:00 +0000 |
---|---|---|
committer | goodale <goodale@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 1999-02-05 08:36:00 +0000 |
commit | 98762bea56ca3929e893322e8826049b6513763b (patch) | |
tree | 0cc1b1ac4fbe752d305317d849e1a78e3d183a21 | |
parent | e8572a7714cdefbe86e58aa09fd45ea4b2464e6b (diff) |
Now compiles.
Tom
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@3 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | param.ccl | 32 | ||||
-rw-r--r-- | src/GHExtension.c | 5 | ||||
-rw-r--r-- | src/SetupPGH.c | 24 |
3 files changed, 50 insertions, 11 deletions
@@ -1,21 +1,21 @@ # Parameter definitions for thorn pugh # $Header$ -public: +protected: -INTEGER nx "The size of the grid in the x direction" +INTEGER global_nx "The size of the grid in the x direction" { *:-1 :: "Fixed size of minus this per processor" 1:* :: "Grid of this size distributed across all processors" } 10 -INTEGER ny "The size of the grid in the y direction" +INTEGER global_ny "The size of the grid in the y direction" { *:-1 :: "Fixed size of minus this per processor" 1:* :: "Grid of this size distributed across all processors" } 10 -INTEGER nz "The size of the grid in the z direction" +INTEGER global_nz "The size of the grid in the z direction" { *:-1 :: "Fixed size of minus this per processor" 1:* :: "Grid of this size distributed across all processors" @@ -25,3 +25,27 @@ INTEGER ghost_size "The width of the ghost zone" { 1:* :: "Must be a positive integer" } 1 + +private: + +KEYWORD proc_topology "How to determine the processor topology" +{ + "manual" :: "Specified by proc_top_nx etc" + "automatic" :: "Automatically generated" +} "automatic" + + +INTEGER proc_top_nx "No of Procs in X direction" +{ + 0:* :: "See proc_topology" +} 0 + +INTEGER proc_top_ny "No of Procs in Y direction" +{ + 0:* :: "See proc_topology" +} 0 + +INTEGER proc_top_nz "No of Procs in Z direction" +{ + 0:* :: "See proc_topology" +} 0 diff --git a/src/GHExtension.c b/src/GHExtension.c index f36f6ee..6880379 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -15,6 +15,8 @@ static char *rcsid = "$Header$"; +pGH *SetupPGH(int nx, int ny, int nz, int ghost_size, int stagger); + void *pugh_SetupGH(tFleshConfig *config, int convergence_level, cGH *GH) @@ -22,7 +24,8 @@ void *pugh_SetupGH(tFleshConfig *config, DECLARE_PARAMETERS pGH *newGH; - newGH = SetupPGH(nx, ny, nz, ghost_size, PUGH_NO_STAGGER); + newGH = SetupPGH(global_nx, global_ny, global_nz, + ghost_size, PUGH_NO_STAGGER); if(!newGH) { diff --git a/src/SetupPGH.c b/src/SetupPGH.c index 76d1fd5..16cc8ca 100644 --- a/src/SetupPGH.c +++ b/src/SetupPGH.c @@ -9,7 +9,12 @@ @enddesc @@*/ +#include <stdio.h> +#include <stdlib.h> + #include "pugh.h" +#include "cctk.h" +#include "declare_parameters.h" /* Old Id: SetupPGH.c,v 1.29 1999/01/12 08:23:35 bruegman Exp */ @@ -235,11 +240,15 @@ void pGH_SetupBasics(pGH *GH, int nx, int ny, int nz, /* set staggering flag */ GH->stagger = staggertype; + /* if (Contains("bound","periodic")) { GH->periodic = 1; } else { GH->periodic = 0; } + */ + + GH->periodic = 0; /* Grid function list */ GH->ngridFuncs = 0; @@ -1028,13 +1037,16 @@ void DestroyPGH(pGH **GHin) { void ProcTop(int np, int *npx, int *npy, int *npz) { int x,y,z,r; - if (Contains("proc_topology","manual")) { - x = Geti("proc_top_nx"); - y = Geti("proc_top_ny"); - z = Geti("proc_top_nz"); + DECLARE_PARAMETERS; + + if (CCTK_Equals(proc_topology,"manual")) { + x = proc_top_nx; + y = proc_top_ny; + z = proc_top_nz; if (x * y * z != np) { - printf ("Manual processor topology error. %d x %d x %d != %d\n", - x,y,z,np); + fprintf (stderr, + "Manual processor topology error. %d x %d x %d != %d\n", + x,y,z,np); #ifdef MPI CACTUS_MPI_ERROR(MPI_Finalize()); #endif |