diff options
author | schnetter <> | 2001-12-07 17:24:00 +0000 |
---|---|---|
committer | schnetter <> | 2001-12-07 17:24:00 +0000 |
commit | 898eb37e5c6aba7dc802d73d626dfea3584fcd9b (patch) | |
tree | d373718f860340a292f85eb6fde90ecccfbb8d15 /Carpet | |
parent | ebab24bb787677c6b9a726817009c069ac493307 (diff) |
Added more helper functions.
Added more helper functions.
Added sample configuration using gcc 3.0.
darcs-hash:20011207172415-07bb3-6bd456e009997ee816a974ddc290d5db283c72c8.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/options/carpet-lilypond-gcc3 | 29 | ||||
-rw-r--r-- | Carpet/Carpet/param.ccl | 9 | ||||
-rw-r--r-- | Carpet/Carpet/src/Recompose.cc | 4 | ||||
-rw-r--r-- | Carpet/Carpet/src/SetupGH.cc | 9 | ||||
-rw-r--r-- | Carpet/Carpet/src/carpet_public.h | 5 | ||||
-rw-r--r-- | Carpet/Carpet/src/helpers.cc | 26 |
6 files changed, 69 insertions, 13 deletions
diff --git a/Carpet/Carpet/options/carpet-lilypond-gcc3 b/Carpet/Carpet/options/carpet-lilypond-gcc3 new file mode 100644 index 000000000..5900a6881 --- /dev/null +++ b/Carpet/Carpet/options/carpet-lilypond-gcc3 @@ -0,0 +1,29 @@ +# $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/options/Attic/carpet-lilypond-gcc3,v 1.1 2001/12/07 18:24:15 schnetter Exp $ + +#CPP = /home/eschnett/gcc/bin/cpp -traditional -DTMPL_EXPLICIT -DCARPET_REAL +CPP = cpp -traditional -DTMPL_EXPLICIT -DCARPET_REAL +CC = /home/eschnett/gcc/bin/gcc +CXX = /home/eschnett/gcc/bin/g++ +F77 = /home/eschnett/gcc/bin/g77 +F90 = /home/eschnett/gcc/bin/g77 + +CXXFLAGS = -DTMPL_EXPLICIT -DCARPET_REAL -ftemplate-depth-30 -Wl,-rpath,/home/eschnett/gcc/lib + +C_OPTIMISE_FLAGS = -O2 -funroll-loops -march=pentiumpro +CXX_OPTIMISE_FLAGS = -O2 -funroll-loops -march=pentiumpro +F90_OPTIMISE_FLAGS = -O2 -funroll-loops -march=pentiumpro -malign-double +F77_OPTIMISE_FLAGS = -O2 -funroll-loops -march=pentiumpro -malign-double + +C_WARN_FLAGS = -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-declarations +CXX_WARN_FLAGS = -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-declarations +F90_WARN_FLAGS = -Wall +F77_WARN_FLAGS = -Wall + +SYS_INC_DIRS = /home/eschnett/proj/FlexIO +LIBDIRS = /home/eschnett/proj/FlexIO +LIBS = AMR h5io hdfio hlio ieeeio hdf5 mfhdf df jpeg z crypt g2c m + +HDF5 = yes +MPI = MPICH + +DEBUG = yes diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl index f3997bcc6..1343b81d9 100644 --- a/Carpet/Carpet/param.ccl +++ b/Carpet/Carpet/param.ccl @@ -1,5 +1,5 @@ # Parameter definitions for thorn Carpet -# $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/param.ccl,v 1.12 2001/12/05 19:34:30 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/param.ccl,v 1.13 2001/12/07 18:24:15 schnetter Exp $ shares: Cactus @@ -60,7 +60,7 @@ CCTK_INT ghost_size "Ghost zones in each spatial direction" CCTK_INT max_refinement_levels "Maximum number of refinement levels (including the base level)" { 1:* :: "must be positive" -} 1 +} 4 CCTK_INT refinement_factor "Refinement factor" { @@ -151,6 +151,11 @@ CCTK_INT processor_topology_3d_z "Number of processors in z-direction" +CCTK_INT refinement_levels "Number of refinement levels (including the base level)" +{ + 1:* :: "must be positive" +} 1 + KEYWORD refined_regions "Regions where the grid is refined" { "centre" :: "Refine (arbitrarily) the centre of the grid only" diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc index 4503e9009..d9f2525f5 100644 --- a/Carpet/Carpet/src/Recompose.cc +++ b/Carpet/Carpet/src/Recompose.cc @@ -13,7 +13,7 @@ #include "carpet.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Recompose.cc,v 1.10 2001/12/05 19:04:45 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Recompose.cc,v 1.11 2001/12/07 18:24:16 schnetter Exp $"; @@ -229,7 +229,7 @@ namespace Carpet { vector<vector<bbox<int,dim> > > bbss(reflevels); for (int rl=0; rl<reflevels; ++rl) { - const int levfac = floor(pow(hh->reffact, rl) + 0.5); + const int levfac = floor(pow((double)hh->reffact, rl) + 0.5); assert (all (rstr % levfac == 0)); const vect<int,dim> str (rstr / levfac); const vect<int,dim> lb (lower[rl]); diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc index 1c0af87e4..901b265d2 100644 --- a/Carpet/Carpet/src/SetupGH.cc +++ b/Carpet/Carpet/src/SetupGH.cc @@ -10,7 +10,7 @@ #include "carpet.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.13 2001/12/05 19:34:30 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/SetupGH.cc,v 1.14 2001/12/07 18:24:16 schnetter Exp $"; @@ -38,7 +38,7 @@ namespace Carpet { // Refinement information maxreflevels = max_refinement_levels; - maxreflevelfact = floor(pow(refinement_factor, maxreflevels-1) + 0.5); + maxreflevelfact = floor(pow((double)refinement_factor, maxreflevels-1) + 0.5); // Ghost zones vect<int,dim> lghosts, ughosts; @@ -234,10 +234,11 @@ namespace Carpet { // Invent a refinement structure gh<dim>::rexts bbsss; gh<dim>::rprocs pss; + assert (refinement_levels <= max_refinement_levels); if (CCTK_EQUALS (refined_regions, "centre")) { - MakeRegions_RefineCentre (cgh, maxreflevels, bbsss); + MakeRegions_RefineCentre (cgh, refinement_levels, bbsss); } else if (CCTK_EQUALS (refined_regions, "manual")) { - MakeRegions_AsSpecified (cgh, maxreflevels, bbsss); + MakeRegions_AsSpecified (cgh, refinement_levels, bbsss); } if (CCTK_EQUALS (processor_topology, "automatic")) { SplitRegions_AlongZ (cgh, bbsss); diff --git a/Carpet/Carpet/src/carpet_public.h b/Carpet/Carpet/src/carpet_public.h index c80d4d3d8..72ba7aadc 100644 --- a/Carpet/Carpet/src/carpet_public.h +++ b/Carpet/Carpet/src/carpet_public.h @@ -1,4 +1,4 @@ -/* $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/carpet_public.h,v 1.2 2001/12/05 03:31:56 schnetter Exp $ */ +/* $Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/carpet_public.h,v 1.3 2001/12/07 18:24:17 schnetter Exp $ */ #include <mpi.h> @@ -9,4 +9,5 @@ int CarpetParamCheck (void); int CarpetStartup (void); /* Helper functions */ -MPI_Comm CarpetMPICommunicator (void); +MPI_Comm CarpetMPIComm (void); +MPI_Datatype CarpetMPIDatatype (int vartype); diff --git a/Carpet/Carpet/src/helpers.cc b/Carpet/Carpet/src/helpers.cc index 6f9a20f2a..cedf0391a 100644 --- a/Carpet/Carpet/src/helpers.cc +++ b/Carpet/Carpet/src/helpers.cc @@ -11,7 +11,7 @@ #include "carpet.hh" -static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/helpers.cc,v 1.10 2001/11/15 16:41:33 schnetter Exp $"; +static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/helpers.cc,v 1.11 2001/12/07 18:24:17 schnetter Exp $"; @@ -60,13 +60,33 @@ namespace Carpet { - MPI_Comm CarpetMPICommunicator () + MPI_Comm CarpetMPIComm () { return dist::comm; } + MPI_Datatype CarpetMPIDatatype (const int vartype) + { + switch (vartype) { +#define TYPECASE(N,T) \ + case N: { \ + T dummy; \ + return dist::datatype(dummy); \ + } +#include "typecase" +#undef TYPECASE + default: + CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Carpet does not support the variable type %d.", vartype); + } + // notreached + return MPI_CHAR; + } + + + int mintl (const checktimes where, const int num_tl) { assert (num_tl>0); @@ -148,7 +168,7 @@ namespace Carpet { // Change reflevel = rl; const bbox<int,dim>& base = hh->baseextent; - reflevelfact = (int)floor(pow((double)hh->reffact, reflevel)+0.5); + reflevelfact = floor(pow((double)hh->reffact, reflevel) + 0.5); cgh->cctk_delta_time = base_delta_time / reflevelfact; for (int d=0; d<dim; ++d) { cgh->cctk_gsh[d] |