diff options
-rw-r--r-- | lib/make/force-rebuild | 1 | ||||
-rw-r--r-- | lib/sbin/GridFuncStuff.pl | 32 | ||||
-rw-r--r-- | src/include/cctk.h | 21 |
3 files changed, 43 insertions, 11 deletions
diff --git a/lib/make/force-rebuild b/lib/make/force-rebuild index 9c0475b5..d4247101 100644 --- a/lib/make/force-rebuild +++ b/lib/make/force-rebuild @@ -35,3 +35,4 @@ 08 Apr 2008: Add IF clause to scheduler 23 Dec 2010: Rename cctki_Capabilities.h to cctk_Capabilities.h 20 Jan 2011: Generate prototypes for scheduled functions +27 Oct 2011: Optimize CCTK_ARGUMENTS for grid functions in Fortran diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl index d12831ed..f564d954 100644 --- a/lib/sbin/GridFuncStuff.pl +++ b/lib/sbin/GridFuncStuff.pl @@ -381,19 +381,37 @@ sub GetThornArguments { # FIXME: quick hack to shorten argument names # $type .= "${sep}cctkv$dim$group"; - $type .= "${sep}X$dim$group"; - $sep = ','; - if($block eq 'PRIVATE') + if ($gtype ne 'GF') { -# FIXME: quick hack to shorten argument names -# $arguments{"cctkv$dim$group"} = "(STORAGESIZE($thorn\::$group, $dim))"; - $arguments{"X$dim$group"} = "(STORAGESIZE($thorn\::$group, $dim))"; + $type .= "${sep}X$dim$group"; } else { + my $dim1=$dim+1; + if ($dim<3) + { + $type .= "${sep}cctk_lsh$dim1"; + } + else + { + $type .= "${sep}cctk_lsh($dim1)"; + } + } + $sep = ','; + if ($gtype ne 'GF') + { + if($block eq 'PRIVATE') + { +# FIXME: quick hack to shorten argument names +# $arguments{"cctkv$dim$group"} = "(STORAGESIZE($thorn\::$group, $dim))"; + $arguments{"X$dim$group"} = "(STORAGESIZE($thorn\::$group, $dim))"; + } + else + { # FIXME: quick hack to shorten argument names # $arguments{"cctkv$dim$group"} = "(STORAGESIZE($imp\::$group, $dim))"; - $arguments{"X$dim$group"} = "(STORAGESIZE($imp\::$group, $dim))"; + $arguments{"X$dim$group"} = "(STORAGESIZE($imp\::$group, $dim))"; + } } } if(defined($vararraysize) && $compactgroup == 0) diff --git a/src/include/cctk.h b/src/include/cctk.h index a258dc4d..32bcac79 100644 --- a/src/include/cctk.h +++ b/src/include/cctk.h @@ -37,7 +37,8 @@ cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_lssh,cctk_from,cctk_to,\ cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,\ cctk_levfac,cctk_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,\ -cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH +cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,\ +cctk_lsh1,cctk_lsh2,cctk_lsh3 #define _DECLARE_CCTK_ARGUMENTS _DECLARE_CCTK_FARGUMENTS #define _DECLARE_CCTK_FARGUMENTS &&\ @@ -62,7 +63,10 @@ cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH CCTK_DECLARE(INTEGER,cctk_convfac,)&&\ CCTK_DECLARE(INTEGER,cctk_nghostzones,(cctk_dim))&&\ CCTK_DECLARE(INTEGER,cctk_iteration,)&&\ - CCTK_DECLARE(CCTK_POINTER,cctkGH,)&& + CCTK_DECLARE(CCTK_POINTER,cctkGH,)&&\ + CCTK_DECLARE(INTEGER,cctk_lsh1,)&&\ + CCTK_DECLARE(INTEGER,cctk_lsh2,)&&\ + CCTK_DECLARE(INTEGER,cctk_lsh3,)&& #define CCTK_WARN(a,b) CCTK_Warn(a,__LINE__,__FORTRANFILE__,CCTK_THORNSTRING,b) @@ -164,6 +168,9 @@ cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH /* Include prototypes for scheduled functions */ #include "cctk_ScheduleFunctions.h" +/* Include prototypes for scheduled functions */ +#include "cctk_ScheduleFunctions.h" + /* Include definitions provided by capabilities */ #include "cctk_Capabilities.h" @@ -479,7 +486,10 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *GH, &((xGH)->cctk_convfac),\ (xGH)->cctk_nghostzones,\ &((xGH)->cctk_iteration),\ - &(xGH) + &(xGH),\ + &(xGH)->cctk_lsh[0],\ + &(xGH)->cctk_lsh[1],\ + &(xGH)->cctk_lsh[2] #define _CCTK_C2F_PROTO int *,\ int *,\ int *,int *, int *, int *, int *,int *,int *,\ @@ -493,7 +503,10 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *GH, int *,\ int *,\ int *,\ - cGH ** + cGH **,\ + int *,\ + int *,\ + int * #define CCTK_EQUALS(a,b) (CCTK_Equals((a),(b))) |