/*@@ @file PUGH_utils.c @date Sunday 12th September 1999 @author Gabrielle Allen @desc @enddesc @version $Header$ @@*/ #include #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "pugh.h" static char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusPUGH_PUGH_PughUtils_c) /*@@ @routine PUGH_Report @date Sunday 12 September 1999 @author Gabrielle Allen @desc Report on PUGH set up @enddesc @calls @calledby @history @endhistory @@*/ void PUGH_Report(CCTK_ARGUMENTS) { DECLARE_CCTK_PARAMETERS pGH *pughGH; int i,gi,dim; int *havedims; char *mess; #ifdef CCTK_MPI int in; #endif pughGH = PUGH_pGH(cctkGH); havedims = (int *)calloc(cctkGH->cctk_dim,sizeof(int)); mess = (char *)malloc(200*sizeof(char)); #ifdef CCTK_MPI CCTK_VInfo(CCTK_THORNSTRING, "MPI Evolution on %d processors", pughGH->nprocs); #else CCTK_VInfo(CCTK_THORNSTRING, "Single processor evolution"); #endif /* Report on grid decomposition for any grid functions */ for (gi=0;gicctk_dim;dim++) { if (havedims[dim]) { CCTK_VInfo(CCTK_THORNSTRING, "%d-dimensional grid functions",dim+1); sprintf(mess," Size:"); for (i=0;iGFExtras[dim]->nsize[i]); } CCTK_INFO(mess); #ifdef CCTK_MPI sprintf(mess," Processor topology:"); for (i=0;iConnectivity[dim]->nprocs[i]); } sprintf(mess,"%s %d",mess,pughGH->Connectivity[dim]->nprocs[dim]); CCTK_INFO(mess); if (CCTK_Equals(partition, "automatic")) { sprintf(mess," Local load: %d [",pughGH->GFExtras[dim]->npoints); for (i=0;iGFExtras[dim]->lnsize[i]); } sprintf(mess,"%s%d]",mess,pughGH->GFExtras[dim]->lnsize[i]); CCTK_INFO(mess); } else { /* manual partition */ for (in=0; innprocs; i++) { sprintf(mess," Local load on proc %d: %d [", in,pughGH->GFExtras[dim]->rnpoints[in]); for (i=0;iGFExtras[dim]->rnsize[in][i]); } sprintf(mess,"%s%d]",mess,pughGH->GFExtras[dim]->rnsize[in][i]); CCTK_INFO(mess); } } CCTK_VInfo(CCTK_THORNSTRING, " Maximum load skew: %f", pughGH->GFExtras[dim]->maxskew); #endif } } free(havedims); free(mess); } /*@@ @routine PUGH_pGH @date Wed Feb 2 13:27:41 2000 @author Tom Goodale @desc This takes a cGH and returns the active pGH. Needed once the pugh GH Extension changes from being a pGH to a structure containing pGHs for multi-patch stuff. @enddesc @calls @calledby @history @endhistory @@*/ pGH *PUGH_pGH(cGH *GH) { pGH *pughGH; pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; return pughGH; }