summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-11-21 15:27:25 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-11-21 15:27:25 +0000
commita78302e02db75eefebcaea943239ec48099c556e (patch)
tree67328e853b33fda8b98b400a39c5601c26d3c1e5 /lib
parentd214164831555d2307ac1c6b9bd53bee8f6f84f4 (diff)
Allow vector groups of scalars.
Allow vector groups with more than one declared variable. Much of this patch consists of removing special case code for scalars. Scalars are now almost everywhere treated as rank 0 arrays. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3465 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rwxr-xr-xlib/make/configure5
-rw-r--r--lib/make/configure.in5
-rw-r--r--lib/make/force-rebuild6
-rw-r--r--lib/sbin/CST4
-rw-r--r--lib/sbin/GridFuncStuff.pl24
-rw-r--r--lib/sbin/interface_parser.pl42
6 files changed, 27 insertions, 59 deletions
diff --git a/lib/make/configure b/lib/make/configure
index d2c5d802..b9cb7727 100755
--- a/lib/make/configure
+++ b/lib/make/configure
@@ -4824,10 +4824,7 @@ fi
# How to link the cactus libraries
-# Currently (2003-10-07) the dependencies from the configure.ccl file are
-# not handled correctly. As a temporary work-around, we re-enable the
-# old behaviour.
-: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS) $(ALLCACTUSLIBS))'}
+: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS))'}
# How to generate C dependency info
diff --git a/lib/make/configure.in b/lib/make/configure.in
index 7c650159..3fb273a5 100644
--- a/lib/make/configure.in
+++ b/lib/make/configure.in
@@ -904,10 +904,7 @@ AC_SUBST(LIBNAME_SUFFIX)
# How to link the cactus libraries
AC_SUBST(CACTUSLIBLINKLINE)
-# Currently (2003-10-07) the dependencies from the configure.ccl file are
-# not handled correctly. As a temporary work-around, we re-enable the
-# old behaviour.
-: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS) $(ALLCACTUSLIBS))'}
+: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS))'}
# How to generate C dependency info
AC_SUBST(C_DEPEND)
diff --git a/lib/make/force-rebuild b/lib/make/force-rebuild
index e43dab88..c0cb471b 100644
--- a/lib/make/force-rebuild
+++ b/lib/make/force-rebuild
@@ -5,7 +5,7 @@
# @desc
# Timestamp file for forcing rebuilds of configurations
# @enddesc
-# @version $Id: force-rebuild,v 1.9 2003-11-19 16:47:40 schnetter Exp $
+# @version $Id: force-rebuild,v 1.10 2003-11-21 15:27:24 schnetter Exp $
# @@*/
6 March 2003: minor changes to CreateFunctionBindings.pl
@@ -17,4 +17,6 @@
27 October 2003: Provide function prototypes for both Fortran and C
28 October 2003: Correct passing of pointers between C and Fortran.
6 November 2003: Treat scalars as rank 0 arrays.
-19 November 2003: Change include mechanism for cctk_Functions.h
+19 November 2003: Change include mechanism for cctk_Functions.h.
+21 November 2003: Allow vector scalars.
+21 November 2003: Allow vector groups to have multiple variables.
diff --git a/lib/sbin/CST b/lib/sbin/CST
index 372632e3..d36a675c 100644
--- a/lib/sbin/CST
+++ b/lib/sbin/CST
@@ -6,7 +6,7 @@
# @desc
# Parses the the configuration files for thorns.
# @enddesc
-# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.58 2003-11-18 18:27:28 tradke Exp $
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.59 2003-11-21 15:27:24 schnetter Exp $
#@@*/
# Global parameter to track the number of errors from the CST
@@ -326,7 +326,7 @@ sub CreateMakeThornlist
$thorn_linklist .= ' ' . &CreateThornLinkList($thorns, $config);
- return ($thornlist . "\n" . $thorn_linklist . "\n" . $config_thornlist);
+ return ($thornlist . "\n" . $thorn_linklist . "\n" . $config_thornlist . "\n");
}
diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl
index e83985ad..80fc511a 100644
--- a/lib/sbin/GridFuncStuff.pl
+++ b/lib/sbin/GridFuncStuff.pl
@@ -349,7 +349,7 @@ sub GetThornArguments
my $vararraysize = $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"};
my $compactgroup = $rhinterface_db->{"\U$thorn GROUP $group\E COMPACT"};
- if($gtype eq 'GF' || $gtype eq 'ARRAY')
+ if($gtype eq 'GF' || $gtype eq 'ARRAY' || ($gtype eq 'SCALAR' && defined($vararraysize)))
{
$type .= ' (';
@@ -1078,29 +1078,25 @@ sub CreateThornGroupInitialisers
{
# Check that the size is allowed.
&CheckArraySizes($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"},$thorn,$rhparameter_db,$rhinterface_db);
- # Flag Cactus that it is a vector group.
- $line = ' -1';
+ # Pass in the size of the GV array, which may be a valid parameter expression
+ $line = ' "'
+ . $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"}
+ . '",';
+ push(@data, $line);
}
else
{
- $line = ' ' . scalar(@variables);
+ $line = ' NULL,';
+ push(@data, $line);
}
+ $line = ' ' . scalar(@variables);
+
foreach $variable (@variables)
{
$line .= ",\n \"$variable\"";
}
- # Pass in the size of the GV array, which may be a valid parameter expression
- if(defined($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"}))
- {
- $line .= ',';
- push(@data, $line);
- $line = ' "';
- $line .= $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"};
- $line .= '"';
- }
-
$line .= ') == 1)';
push(@data, $line);
diff --git a/lib/sbin/interface_parser.pl b/lib/sbin/interface_parser.pl
index 53ad310a..2259c2a7 100644
--- a/lib/sbin/interface_parser.pl
+++ b/lib/sbin/interface_parser.pl
@@ -786,7 +786,7 @@ sub parse_interface_ccl
$interface_db{"\U$thorn FUNCTION\E $funcname ARGS"} .= "${funcargs} ";
$interface_db{"\U$thorn FUNCTION\E $funcname RET"} .= "${rettype} ";
}
- elsif ($line =~ m/^\s*(CCTK_)?(CHAR|BYTE|INT|INT1|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)\s*(([a-zA-Z]+[a-zA-Z_0-9]*)(\[([^]]+)\])?)\s*(.*)\s*$/i)
+ elsif ($line =~ m/^\s*(CCTK_)?(CHAR|BYTE|INT|INT1|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)\s*(([a-zA-Z][a-zA-Z_0-9]*)\s*(\[([^]]+)\])?)\s*(.*)\s*$/i)
{
# for($i = 1; $i < 10; $i++)
# {
@@ -912,11 +912,6 @@ sub parse_interface_ccl
$interface_db{"\U$thorn GROUP $current_group\E DIM"} = 3;
}
- if($interface_db{"\U$thorn GROUP $current_group\E GTYPE"} eq "SCALAR")
- {
- $interface_db{"\U$thorn GROUP $current_group\E DIM"} = 0;
- }
-
if(! $interface_db{"\U$thorn GROUP $current_group\E TIMELEVELS"})
{
$interface_db{"\U$thorn GROUP $current_group\E TIMELEVELS"} = 1;
@@ -937,6 +932,13 @@ sub parse_interface_ccl
$interface_db{"\U$thorn GROUP $current_group\E COMPACT"} = 0;
}
+ # Override defaults for scalars
+ if($interface_db{"\U$thorn GROUP $current_group\E GTYPE"} eq "SCALAR")
+ {
+ $interface_db{"\U$thorn GROUP $current_group\E DIM"} = 0;
+ $interface_db{"\U$thorn GROUP $current_group\E DISTRIB"} = "CONSTANT";
+ }
+
# Check that it is a known group type
if($interface_db{"\U$thorn GROUP $current_group\E GTYPE"} !~ m:^\s*(SCALAR|GF|ARRAY)\s*$:)
{
@@ -971,37 +973,12 @@ sub parse_interface_ccl
next;
}
- # Is it is a vararray ?
-
+ # Is it a vararray?
if($isgrouparray)
{
- # Create a variable with the same name as the group
- $function = $current_group;
-
- if(! $known_variables{"\U$function\E"})
- {
- $known_variables{"\U$function\E"} = 1;
-
- $interface_db{"\U$thorn GROUP $current_group\E"} .= " $function";
- }
- else
- {
- &CST_error(0,"Duplicate variable $function in thorn $thorn",'',
- __LINE__,__FILE__);
- }
-
# get its size
-
$interface_db{"\U$thorn GROUP $current_group\E VARARRAY_SIZE"} = $grouparray_size;
-
- if($data[$line_number+1] =~ m/^\s*\{\s*$/)
- {
- &CST_error(1,"Can't give explicit list of array names with an array group - ignoring list","",__LINE__,__FILE__);
- $line_number++ until ($data[$line_number] =~ m:\}:);
- }
}
- else
- {
# Fill in data for the scalars/arrays/functions
$line_number++;
if($data[$line_number] =~ m/^\s*\{\s*$/)
@@ -1055,7 +1032,6 @@ sub parse_interface_ccl
$line_number--;
}
$interface_db{"\U$thorn GROUP $current_group\E DESCRIPTION"} = $description;
- }
}
elsif ($line =~ m/^\s*(USES\s*INCLUDE)S?\s*(SOURCE)S?\s*:\s*(.*)\s*$/i)
{