diff options
author | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-07 13:10:56 +0000 |
---|---|---|
committer | allen <allen@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2000-03-07 13:10:56 +0000 |
commit | 9b633d4cbcb0b67369fdfc06ac39fbd25bc32111 (patch) | |
tree | 486c31360429aca5b15a2a00b1a6cb4b403c69d2 /src/PughUtils.c | |
parent | f5ece95737b176d55fa7d62bdb8729e140975ea0 (diff) |
Load balancing grid decomposition for PUGH.
Contributed by Matei Ripeneau
Here are his notes (hopefully there will soon be PUGH docs to add them to):
1. Purpose
Allow manual (user specified) grid partitioning
2. Parameters
I've added the following parameters to ./PUGH/param.ccl
KEYWORD partition "Is the partition manual/automatic"
{
"automatic" :: "even implicit partition"
"manual" :: "specified by partition_#d_XYZ .."
} "automatic"
STRING partition_1d_X "Tells how to partition on direction X" ...
STRING partition_2d_X "Tells how to partition on direction X" ...
STRING partition_2d_Y "Tells how to partition on direction Y" ...
STRING partition_3d_X "Tells how to partition on direction X" ...
STRING partition_3d_Y "Tells how to partition on direction Y" ...
STRING partition_3d_Z "Tells how to partition on direction Z" ...
(all these strings have default "")
How to specify a manual partition?
Simpler to explain using an example: partitioning a grid space with 30 x 30 x
30 points for a configuration with 8 processors can be specified as:
PUGH::partition = "manual"
PUGH::partition_1d_X = "" // uses default
PUGH::partition_2d_X = "16:14"
PUGH::partition_2d_Y = "7:9:5:9"
PUGH::partition_3d_X = "16:14"
PUGH::partition_3d_Y = "12:18"
PUGH::partition_3d_Z = "17:13"
Even if PUGH::partition = "manual" an empty string like PUGH::partition_1d_X =
"" will lead to default (even) partition on that direction
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@174 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/PughUtils.c')
-rw-r--r-- | src/PughUtils.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/PughUtils.c b/src/PughUtils.c index 49c9a96..617860a 100644 --- a/src/PughUtils.c +++ b/src/PughUtils.c @@ -34,8 +34,11 @@ static char *rcsid = "$Header$"; void pugh_Report(CCTK_CARGUMENTS) { + DECLARE_CCTK_PARAMETERS + pGH *pughGH; /* PUGH extension handle */ char *message; + int i; pughGH = pugh_pGH(cctkGH); @@ -58,9 +61,24 @@ void pugh_Report(CCTK_CARGUMENTS) sprintf(message,"Processor topology: %d x %d x %d", pughGH->nproc[0], pughGH->nproc[1], pughGH->nproc[2]); CCTK_INFO(message); - sprintf(message,"Local load: %d [%d x %d x %d]", - pughGH->npoints,pughGH->lnsize[0], pughGH->lnsize[1], pughGH->lnsize[2]); - + + if (CCTK_Equals(partition, "automatic")) { + sprintf(message,"Local load: %d [%d x %d x %d]", + pughGH->npoints, + pughGH->lnsize[0], pughGH->lnsize[1], pughGH->lnsize[2]); + CCTK_INFO(message); + } else { /* manual partition */ + for (i=0; i<pughGH->nprocs; i++) { + sprintf(message, + "Local load on proc %d: %d [%d x %d x %d]", + i, + pughGH->rnpoints[i], + pughGH->rnsize[i][0], + pughGH->rnsize[i][1], + pughGH->rnsize[i][2]); + CCTK_INFO(message); + } + } #endif } else if (cctkGH->cctk_dim == 2) @@ -74,8 +92,8 @@ void pugh_Report(CCTK_CARGUMENTS) pughGH->nproc[0], pughGH->nproc[1]); CCTK_INFO(message); sprintf(message,"Local load: %d [%d x %d]", - pughGH->npoints,pughGH->lnsize[0], pughGH->lnsize[1]); - + pughGH->npoints,pughGH->lnsize[0], pughGH->lnsize[1]); + CCTK_INFO(message); #endif } @@ -83,14 +101,14 @@ void pugh_Report(CCTK_CARGUMENTS) { sprintf(message,"Size: %d",pughGH->nsize[0]); - CCTK_INFO(message); + CCTK_INFO(message); #ifdef MPI sprintf(message,"Processor topology: %d",pughGH->nproc[0]); CCTK_INFO(message); sprintf(message,"Local load: %d [%d]", - pughGH->npoints,pughGH->lnsize[0]); - + pughGH->npoints,pughGH->lnsize[0]); + CCTK_INFO(message); #endif } @@ -100,7 +118,6 @@ void pugh_Report(CCTK_CARGUMENTS) } #ifdef MPI - CCTK_INFO(message); sprintf(message,"Maximum load skew: %f",pughGH->maxskew); CCTK_INFO(message); #endif |