aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@1d96b42b-98df-4a6a-9d84-1b24288d4588>2000-02-10 11:02:12 +0000
committergoodale <goodale@1d96b42b-98df-4a6a-9d84-1b24288d4588>2000-02-10 11:02:12 +0000
commit40e2b612ac2e00e752fed7b8d74ddc785c2d19e5 (patch)
tree1736bcc128006390b1d6a6104466140cec7b2131
parent3d9be6f30cb22db047fe69d77f984752c4f19ad1 (diff)
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
-rw-r--r--src/make.configuration.defn6
-rw-r--r--src/petsc_confmetric.c16
-rw-r--r--src/petsc_confmetric_solver.c14
-rw-r--r--src/petsc_flat_solver.c17
4 files changed, 33 insertions, 20 deletions
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;i<argc;i++)
- argv[i] = (char*) malloc (256*sizeof(char));
- CCTK_GetArgv(argv);
+ argc = CCTK_CommandLine(&argv);
/* Set the PETSc communicator to set of PUGH and
initialzie PETSc */
diff --git a/src/petsc_confmetric_solver.c b/src/petsc_confmetric_solver.c
index 89dc950..e3fe482 100644
--- a/src/petsc_confmetric_solver.c
+++ b/src/petsc_confmetric_solver.c
@@ -6,9 +6,14 @@
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 +23,7 @@
#include "CactusPUGH/PUGH/src/include/pugh.h"
+static char *rcsid = "$Header$";
#define DEBUG
@@ -76,9 +82,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 */
@@ -175,7 +178,6 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize,
/* Things to do on first iteration */
if (trips==0) {
- int CCTK_GetCommandLine(char ***outargv);
int argc;
char **argv;
@@ -184,7 +186,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize,
printf("PETSc: initial trip: %d \n",trips);
#endif
/* Get the commandline arguments */
- argc = CCTK_GetCommandLine(&argv);
+ argc = CCTK_CommandLine(&argv);
/* Set the PETSc communicator to set of PUGH and
initialzie PETSc */
@@ -249,7 +251,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize,
/* We fix the lower and upper boundary indices, that actually "active" in
the sense that they are no ghostzones: */
imin=((pughGH->neighbors[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);