From 40e2b612ac2e00e752fed7b8d74ddc785c2d19e5 Mon Sep 17 00:00:00 2001 From: goodale Date: Thu, 10 Feb 2000 11:02:12 +0000 Subject: GetCommandLine->CommandLine One nghostzones->nghostzones[0] Fixed some linking problems on my laptop - it seems the PETSc I compiled needs the X libraries. Also liblapack needs to be linked before libblas. At some point I'll add the stuff to autoconf to automatically find the X libraries and include files. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@32 1d96b42b-98df-4a6a-9d84-1b24288d4588 --- src/make.configuration.defn | 6 +++--- src/petsc_confmetric.c | 16 +++++++--------- src/petsc_confmetric_solver.c | 14 ++++++++------ src/petsc_flat_solver.c | 17 +++++++++++++++-- 4 files changed, 33 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/make.configuration.defn b/src/make.configuration.defn index 5e11f7e..754632e 100644 --- a/src/make.configuration.defn +++ b/src/make.configuration.defn @@ -32,7 +32,7 @@ endif -LIBDIRS += $(PETSC_DIR)/lib/libO/$(PETSC_ARCH) +LIBDIRS += $(PETSC_DIR)/lib/libO/$(PETSC_ARCH) /usr/X11R6/lib ### PETSC on the T3E @@ -63,8 +63,8 @@ ifeq ($(PETSC_ARCH),linux) MYLIBS := petsc petscdm petsccontrib \ petscts petscsnes petscsles \ petscmat petscvec \ - blas lapack g2c \ - mpich $(LIBS) + lapack blas g2c \ + mpich X11 $(LIBS) LIBS = $(MYLIBS) diff --git a/src/petsc_confmetric.c b/src/petsc_confmetric.c index 999ffb3..e50cb13 100644 --- a/src/petsc_confmetric.c +++ b/src/petsc_confmetric.c @@ -6,9 +6,13 @@ A nabla phi - M phi = N elliptic solver based around PETSc. For information, see the documentation for @seeroutine petscEll_conformal @enddesc + @version $Header$ @@*/ #include "cctk.h" + +#include "cctk_CommandLine.h" + #include "cctk_Parameters.h" #include "cctk_Flesh.h" @@ -18,6 +22,7 @@ #include "CactusPUGH/PUGH/src/include/pugh.h" +static char *rcsid = "$Header$"; #define DEBUG @@ -76,9 +81,6 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, void *GetDataPtr_NextTL(cGH *GH, const char *field); - int CCTK_GetArgc(void); /* PETSc wnats to know the prog. name */ - void CCTK_GetArgv(char **argv); /* and parameters, don't think they can be passed through */ - PC pc; /* preconditioner context */ KSP ksp; /* Krylov subspace method context */ @@ -169,7 +171,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /* Things to do on first iteration */ if (trips==0) { - int argc,i; + int argc; char **argv; #ifdef DEBUG @@ -178,11 +180,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, #endif /* Get the commandline arguments */ - argc = CCTK_GetArgc(); - argv = (char**) malloc ((argc+1)*sizeof(char*)); - for (i=0;ineighbors[pughGH->myproc][XDM]<0) && !(octant) ? 1 : - pughGH->nghostzones); + pughGH->nghostzones[0]); imax=((pughGH->neighbors[pughGH->myproc][XDP]<0) ? pughGH->lnsize[0]-1 : pughGH->lnsize[0]-GH->cctk_nghostzones[0]); diff --git a/src/petsc_flat_solver.c b/src/petsc_flat_solver.c index ce74e36..173c9f1 100644 --- a/src/petsc_flat_solver.c +++ b/src/petsc_flat_solver.c @@ -1,5 +1,17 @@ + /*@@ + @file petsc_flat_solver.c + @date + @author Gerd Lanfermann + @desc + + @enddesc + @version $Header$ + @@*/ #include "cctk.h" + +#include "cctk_CommandLine.h" + #include "cctk_Parameters.h" #include "mpi.h" @@ -7,6 +19,8 @@ #include "CactusPUGH/PUGH/src/include/pugh.h" +static char *rcsid = "$Header$"; + #define DEBUG /*Don't know what these actually mean! FIXME */ @@ -112,7 +126,6 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, /* Things to do on first iteration */ if (trips==0) { - int CCTK_GetCommandLine(char ***outargv); int argc; char **argv; @@ -121,7 +134,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, printf("PETSc: initial trip: %d \n",trips); #endif - argc = CCTK_GetCommandLine(&argv); + argc = CCTK_CommandLine(&argv); ierr = PetscSetCommWorld(pughGH->PUGH_COMM_WORLD); CHKERRA(ierr); PetscInitialize(&argc,&argv,NULL,NULL); -- cgit v1.2.3