summaryrefslogtreecommitdiff
path: root/lib/sbin/CreateScheduleBindings.pl
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-01-25 15:56:30 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-01-25 15:56:30 +0000
commit5ece4912f92056d4603d34475366279a31443234 (patch)
tree82d15b7cbf5fe6237cc018b49fb3bac7b74bf102 /lib/sbin/CreateScheduleBindings.pl
parentd6f8696b5c8db8a18f7b61fdb0436f42172365ac (diff)
Moved parameter recovery routines for thorns from CST-generated source files
"ParameterRecovery${thorn}.c" into "Schedule${thorn}.c". Configurations should be cleandep'ed and rebuilt after this update. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3104 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateScheduleBindings.pl')
-rw-r--r--lib/sbin/CreateScheduleBindings.pl471
1 files changed, 203 insertions, 268 deletions
diff --git a/lib/sbin/CreateScheduleBindings.pl b/lib/sbin/CreateScheduleBindings.pl
index fa96a51b..cce1a2de 100644
--- a/lib/sbin/CreateScheduleBindings.pl
+++ b/lib/sbin/CreateScheduleBindings.pl
@@ -27,56 +27,43 @@ sub CreateScheduleBindings
if(! -d $bindings_dir)
{
- mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir";
+ mkdir($bindings_dir, 0755) || die "Unable to create $bindings_dir";
}
$start_dir = `pwd`;
chdir $bindings_dir;
- if(! -d "Schedule")
+ if(! -d 'Schedule')
{
- mkdir("Schedule", 0755) || die "Unable to create Schedule directory";
+ mkdir('Schedule', 0755) || die 'Unable to create Schedule directory';
}
- if(! -d "include")
+ if(! -d 'include')
{
- mkdir("include", 0755) || die "Unable to create include directory";
+ mkdir('include', 0755) || die 'Unable to create include directory';
}
- chdir "Schedule";
+ chdir 'Schedule';
- $file_list = "";
+ $file_list = '';
foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"}))
{
$rsbuffer = &ScheduleCreateFile($thorn, $rhinterface_db, $rhschedule_db);
-
- &WriteFile("Schedule$thorn.c",$rsbuffer);
-
+ &WriteFile("Schedule$thorn.c",\$rsbuffer);
$file_list .= " Schedule$thorn.c";
-
- $rsbuffer = &ParameterRecoveryCreateFile($thorn, $rhinterface_db, $rhschedule_db);
-
- &WriteFile("ParameterRecovery$thorn.c",$rsbuffer);
-
- $file_list .= " ParameterRecovery$thorn.c";
}
$rsbuffer = &ScheduleCreateBindings($rhinterface_db, $rhschedule_db);
-
- &WriteFile("BindingsSchedule.c",$rsbuffer);
-
+ &WriteFile("BindingsSchedule.c", \$rsbuffer);
$file_list .= " BindingsSchedule.c";
$rsbuffer = &ParameterRecoveryCreateBindings($rhinterface_db, $rhschedule_db);
-
- &WriteFile("BindingsParameterRecovery.c",$rsbuffer);
-
+ &WriteFile("BindingsParameterRecovery.c", \$rsbuffer);
$file_list .= " BindingsParameterRecovery.c";
$line = "SRCS = $file_list\n";
-
- &WriteFile("make.code.defn",\$line);
+ &WriteFile("make.code.defn", \$line);
chdir "$start_dir";
}
@@ -86,9 +73,9 @@ sub CreateScheduleBindings
# @date Fri Sep 17 17:34:26 1999
# @author Tom Goodale
# @desc
-# Creates a string containing all the data which should go into a schedule file.
+# Creates a string containing all the data
+# which should go into a schedule file.
# @enddesc
-# @calls
#@@*/
sub ScheduleCreateFile
{
@@ -96,21 +83,14 @@ sub ScheduleCreateFile
my($implementation);
my($buffer, $prototypes);
+ my($recovery_buffer, $recovery_prototypes);
my($block, $block_buffer, $block_prototype);
my($statement, $statement_buffer, $statement_prototype);
- my($indent, $language, $function);
- my(@mem_groups);
- my(@comm_groups);
- my(@trigger_groups);
- my(@before_list);
- my(@after_list);
- my(@while_list);
- my($outfile);
- my($outbuf);
+ my(@data);
$implementation = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"};
- $buffer = $rhschedule_db->{"\U$thorn\E FILE"};
+ $buffer = $recovery_buffer = $rhschedule_db->{"\U$thorn\E FILE"};
# Process each schedule block
for($block = 0 ; $block < $rhschedule_db->{"\U$thorn\E N_BLOCKS"}; $block++)
@@ -120,11 +100,20 @@ sub ScheduleCreateFile
($block_buffer, $block_prototype) = &ScheduleBlock($thorn, $implementation, $block,
$rhinterface_db, $rhschedule_db);
$buffer =~ s:\@BLOCK\@$block:$block_buffer:;
+ $recovery_buffer =~ s:\@BLOCK\@$block::;
$prototypes .= "$block_prototype";
}
else
{
+ $block_buffer = $rhschedule_db->{"\U$thorn\E BLOCK_$block NAME"};
+ if($rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"} !~ m:^\s*C\s*$:i )
+ {
+ $block_buffer = "CCTK_FNAME ($block_buffer)";
+ }
+
+ $recovery_buffer =~ s:\@BLOCK\@$block:result = $block_buffer();:;
$buffer =~ s:\@BLOCK\@$block::;
+ $recovery_prototypes .= "extern int $block_buffer(void);\n";
}
}
@@ -134,143 +123,89 @@ sub ScheduleCreateFile
($statement_buffer, $statement_prototype) = &ScheduleStatement($thorn, $implementation, $statement,
$rhinterface_db, $rhschedule_db);
$buffer =~ s:\@STATEMENT\@$statement:$statement_buffer:;
- $prototypes .= "$statement_prototype";
- }
-
- # Actually create the string
-
- # Header stuff
- $outbuf = "";
- $outbuf .= "/*\@\@\n";
- $outbuf .= " \@file Schedule$thorn.c\n";
- $outbuf .= " \@author Automatically generated by CreateScheduleBindings.pl\n";
- $outbuf .= " \@desc\n";
- $outbuf .= " Creates the schedule bindings for thorn $thorn\n";
- $outbuf .= " \@enddesc\n";
- $outbuf .= "\@\@*/\n";
- $outbuf .= "\n";
- $outbuf .= "\#define THORN_IS_$thorn\n";
- $outbuf .= "\n";
- $outbuf .= "\#include \"cctk.h\"\n";
- $outbuf .= "\#include \"cctk_Parameters.h\"\n";
- $outbuf .= "\#include \"cctki_ScheduleBindings.h\"\n";
- $outbuf .= "\n";
- $outbuf .= "/* Prototypes for functions to be registered. */\n";
- $outbuf .= "$prototypes\n";
- $outbuf .= "\n";
- $outbuf .= "void CCTKi_BindingsSchedule_$thorn(void);\n";
- $outbuf .= "void CCTKi_BindingsSchedule_$thorn(void)\n";
- $outbuf .= "{\n";
- $outbuf .= " DECLARE_CCTK_PARAMETERS\n";
- $outbuf .= "$buffer\n";
- $outbuf .= "}\n";
-
- return \$outbuf;
-
-}
-
-
-#/*@@
-# @routine ParameterRecoveryCreateFile
-# @date Tue Apr 18 17:34:26 2000
-# @author Gabrielle Allen
-# @desc
-# Creates a string containing all the data which should go into a parameter recovery file.
-# @enddesc
-# @calls
-#@@*/
-sub ParameterRecoveryCreateFile
-{
- my($thorn, $rhinterface_db, $rhschedule_db) = @_;
-
- my($implementation);
- my($buffer, $prototypes);
- my($block, $block_buffer, $block_prototype);
- my($statement, $statement_buffer, $statement_prototype);
- my($indent, $language, $function);
- my(@mem_groups);
- my(@comm_groups);
- my(@trigger_groups);
- my(@before_list);
- my(@after_list);
- my(@while_list);
- my($outfile);
- my($outbuf);
+ $recovery_buffer =~ s:\@STATEMENT\@$statement::;
- $implementation = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"};
+ $prototypes .= $statement_prototype;
+ }
- $buffer = $rhschedule_db->{"\U$thorn\E FILE"};
+ # Actually create the file contents string
+ @data = ();
+ push(@data, '/*@@');
+ push(@data, " \@file Schedule$thorn.c");
+ push(@data, ' @author Automatically generated by CreateScheduleBindings.pl');
+ push(@data, ' @desc');
+ push(@data, ' Creates the schedule and parameter recovery bindings ');
+ push(@data, " for thorn $thorn");
+ push(@data, ' @enddesc');
+ push(@data, '@@*/');
+ push(@data, '');
+ push(@data, "#define THORN_IS_$thorn");
+ push(@data, '');
+ push(@data, '#include "cctk.h"');
+ push(@data, '#include "cctk_Parameters.h"');
+ push(@data, '#include "cctki_ScheduleBindings.h"');
+ push(@data, '');
+ push(@data, '/* prototypes for schedule bindings functions to be registered */');
+ push(@data, '/* Note that this is a cheat, we just need a function pointer. */');
+ push(@data, $prototypes);
+ push(@data, '');
+ push(@data, "void CCTKi_BindingsSchedule_$thorn(void);");
+ push(@data, "void CCTKi_BindingsSchedule_$thorn(void)");
+ push(@data, '{');
+ push(@data, ' DECLARE_CCTK_PARAMETERS');
+
+ # filter out empty lines
+ foreach $line (split ("\n", $buffer))
+ {
+ push(@data, $line) if ($line);
+ }
- # Process each schedule block
- for($block = 0 ; $block < $rhschedule_db->{"\U$thorn\E N_BLOCKS"}; $block++)
+ push(@data, '}');
+
+ push(@data, '');
+ push(@data, '/*@@');
+ push(@data, " \@routine CCTKi_BindingsParameterRecovery_$thorn");
+ push(@data, ' @author Automatically generated by CreateScheduleBindings.pl');
+ push(@data, ' @desc');
+ push(@data, " Creates the parameter recovery bindings for thorn $thorn");
+ push(@data, ' @enddesc');
+ push(@data, '@@*/');
+ push(@data, '');
+ if (defined ($recovery_prototypes))
{
- if ($rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} =~ /RECOVER_PARAMETERS/)
- {
- if($rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"} =~ m:^\s*C\s*$:i )
- {
- $block_buffer = $rhschedule_db->{"\U$thorn\E BLOCK_$block NAME"};
- }
- elsif($rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"} =~ m:^\s*(F|F77|FORTRAN|F90)\s*$:i )
- {
- $block_buffer = "CCTK_FNAME(".$rhschedule_db->{"\U$thorn\E BLOCK_$block NAME"} .")";
- }
+ push(@data, '/* prototypes of parameter recovery functions to be registered. */');
+ push(@data, "$recovery_prototypes");
+ }
+ push(@data, "int CCTKi_BindingsParameterRecovery_$thorn(void);");
+ push(@data, "int CCTKi_BindingsParameterRecovery_$thorn(void)");
+ push(@data, '{');
+ if (defined ($recovery_prototypes))
+ {
+ push(@data, ' DECLARE_CCTK_PARAMETERS');
+ push(@data, ' int result = 0;');
+ push(@data, '');
- $buffer =~ s:\@BLOCK\@$block:result = $block_buffer();:;
- $prototypes .= "extern int $block_buffer(void);\n";
- }
- else
+ # filter out empty lines
+ foreach $line (split ("\n", $recovery_buffer))
{
- $buffer =~ s:\@BLOCK\@$block::;
+ push(@data, $line) if ($line);
}
- }
- # Process each schedule statement
- for($statement = 0 ; $statement < $rhschedule_db->{"\U$thorn\E N_STATEMENTS"}; $statement++)
+ push(@data, '');
+ push(@data, ' return (result);');
+ }
+ else
{
- $buffer =~ s:\@STATEMENT\@$statement::;
+ push(@data, ' /* this thorn doesn\'t define any parameter recovery routines */');
+ push(@data, ' return (0);');
}
+ push(@data, '}');
+ push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- # Actually create the string
-
- # Header stuff
- $outbuf = "";
- $outbuf .= "\#define THORN_IS_$thorn\n";
- $outbuf .= "\n";
- $outbuf .= "\#include <stdarg.h>\n";
- $outbuf .= "\n";
- $outbuf .= "\#include \"cctk.h\"\n";
- $outbuf .= "\#include \"cctk_Parameters.h\"\n";
- $outbuf .= "\#include \"cctki_ScheduleBindings.h\"\n";
- $outbuf .= "\n";
- $outbuf .= "/* Prototypes for functions to be registered. */\n";
- $outbuf .= "$prototypes\n";
- $outbuf .= "\n";
- $outbuf .= "/*\@\@\n";
- $outbuf .= " \@routine CCTKi_BindingsParameterRecovery_$thorn\n";
- $outbuf .= " \@date \n";
- $outbuf .= " \@author \n";
- $outbuf .= " \@desc \n";
- $outbuf .= " Creates the parameter recovery bindings for thorn $thorn\n";
- $outbuf .= " \@enddesc \n";
- $outbuf .= " \@calls \n";
- $outbuf .= "\n";
- $outbuf .= "\@\@*/\n";
- $outbuf .= "int CCTKi_BindingsParameterRecovery_$thorn(void);\n";
- $outbuf .= "int CCTKi_BindingsParameterRecovery_$thorn(void)\n";
- $outbuf .= "{\n";
- $outbuf .= " DECLARE_CCTK_PARAMETERS\n";
- $outbuf .= " int result = 0;\n\n";
- $outbuf .= "$buffer\n";
- $outbuf .= " return (result);\n";
- $outbuf .= "}\n";
- $outbuf .= "\n";
-
- return \$outbuf;
-
+ return join ("\n", @data);
}
-
#/*@@
# @routine ScheduleCreateBindings
# @date Fri Sep 17 18:17:13 1999
@@ -284,43 +219,43 @@ sub ParameterRecoveryCreateFile
sub ScheduleCreateBindings
{
my($rhinterface_db, $rhschedule_db) = @_;
-
- my($outbuf);
-
- $outbuf = "";
- $outbuf .= "/*\@\@\n";
- $outbuf .= " \@file BindingsSchedule.c\n";
- $outbuf .= " \@author Automatically generated by CreateScheduleBindings.pl\n";
- $outbuf .= " \@desc\n";
- $outbuf .= " Calls all the thorn schedule bindings file if the thorns are active.\n";
- $outbuf .= " \@enddesc\n";
- $outbuf .= "\@\@*/\n\n";
-
- $outbuf .= "\#include \"SKBinTree.h\"\n";
- $outbuf .= "\#include \"cctk_ActiveThorns.h\"\n";
- $outbuf .= "\n";
- $outbuf .= "/* Prototypes for functions to be registered. */\n";
-
- foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"}))
+ my(@data);
+
+ @data = ();
+ push(@data, '/*@@');
+ push(@data, ' @file BindingsSchedule.c');
+ push(@data, ' @author Automatically generated by CreateScheduleBindings.pl');
+ push(@data, ' @desc');
+ push(@data, ' Calls all the thorn schedule bindings file if the thorns are active.');
+ push(@data, ' @enddesc');
+ push(@data, ' @@*/');
+ push(@data, '');
+
+ push(@data, '#include "cctk_ActiveThorns.h"');
+ push(@data, '');
+
+ push(@data, '/* Prototypes for functions to be registered. */');
+ foreach $thorn (sort split(' ', $rhinterface_db->{"THORNS"}))
{
- $outbuf .= "void CCTKi_BindingsSchedule_$thorn(void);\n";
+ push(@data, "void CCTKi_BindingsSchedule_$thorn(void);");
}
- $outbuf .= "\n";
- $outbuf .= "int CCTKi_BindingsScheduleInitialise(void);\n";
- $outbuf .= "int CCTKi_BindingsScheduleInitialise(void)\n";
- $outbuf .= "{\n";
- foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"}))
+ push(@data, '');
+ push(@data, 'int CCTKi_BindingsScheduleInitialise(void);');
+ push(@data, 'int CCTKi_BindingsScheduleInitialise(void)');
+ push(@data, '{');
+ foreach $thorn (sort split(' ', $rhinterface_db->{"THORNS"}))
{
- $outbuf .= " if(CCTK_IsThornActive(\"$thorn\"))\n";
- $outbuf .= " {\n";
- $outbuf .= " CCTKi_BindingsSchedule_$thorn();\n";
- $outbuf .= " }\n";
+ push(@data, " if(CCTK_IsThornActive(\"$thorn\"))");
+ push(@data, ' {');
+ push(@data, " CCTKi_BindingsSchedule_$thorn();");
+ push(@data, ' }');
}
- $outbuf .= " return 0;\n";
- $outbuf .= "}\n";
+ push(@data, ' return 0;');
+ push(@data, '}');
+ push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- return \$outbuf;
+ return join ("\n", @data);
}
@@ -336,57 +271,57 @@ sub ScheduleCreateBindings
sub ParameterRecoveryCreateBindings
{
my($rhinterface_db, $rhschedule_db) = @_;
-
- my($outbuf);
-
- $outbuf = "";
- $outbuf .= "/*\@\@\n";
- $outbuf .= " \@file BindingsParameterRecovery.c\n";
- $outbuf .= " \@author Automatically generated by CreateScheduleBindings.pl\n";
- $outbuf .= " \@desc\n";
- $outbuf .= " Calls all the thorn parameter recovery bindings file if the thorns are active.\n";
- $outbuf .= " \@enddesc\n";
- $outbuf .= "\n";
- $outbuf .= "\@\@*/\n\n";
-
- $outbuf .= "\#include \"SKBinTree.h\"\n";
- $outbuf .= "\#include \"cctk_ActiveThorns.h\"\n";
- $outbuf .= "\n";
- $outbuf .= "/* Prototypes for functions to be registered. */\n";
-
- foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"}))
+ my(@data);
+
+ @data = ();
+ push(@data, '/*@@');
+ push(@data, ' @file BindingsParameterRecovery.c');
+ push(@data, ' @author Automatically generated by CreateScheduleBindings.pl');
+ push(@data, ' @desc');
+ push(@data, ' Calls all the thorn parameter recovery bindings file if the thorns are active.');
+ push(@data, ' @enddesc');
+ push(@data, ' @@*/');
+ push(@data, '');
+
+ push(@data, '#include "cctk_ActiveThorns.h"');
+ push(@data, '');
+ push(@data, '/* Prototypes for functions to be registered. */');
+
+ foreach $thorn (sort split(' ', $rhinterface_db->{"THORNS"}))
{
- $outbuf .= "int CCTKi_BindingsParameterRecovery_$thorn(void);\n";
+ push(@data, "int CCTKi_BindingsParameterRecovery_$thorn(void);");
}
- $outbuf .= "int CCTKi_BindingsParameterRecoveryInitialise(void);\n";
- $outbuf .= "int CCTKi_BindingsParameterRecoveryInitialise(void)\n";
- $outbuf .= "{\n";
-
- $outbuf .= " int result;\n";
- $outbuf .= " int retval = 0;\n\n";
- $outbuf .= " do\n";
- $outbuf .= " {\n";
- foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"}))
+ push(@data, 'int CCTKi_BindingsParameterRecoveryInitialise(void);');
+ push(@data, '');
+ push(@data, 'int CCTKi_BindingsParameterRecoveryInitialise(void)');
+ push(@data, '{');
+ push(@data, ' int result;');
+ push(@data, ' int retval = 0;');
+ push(@data, '');
+ push(@data, ' do');
+ push(@data, ' {');
+ foreach $thorn (sort split(' ', $rhinterface_db->{"THORNS"}))
{
- $outbuf .= " if(CCTK_IsThornActive(\"$thorn\"))\n";
- $outbuf .= " {\n";
- $outbuf .= " result = CCTKi_BindingsParameterRecovery_$thorn();\n";
- $outbuf .= " if (result != 0)\n";
- $outbuf .= " retval = result;\n";
- $outbuf .= " if (retval > 0)\n";
- $outbuf .= " break;\n";
- $outbuf .= " }\n";
+ push(@data, " if(CCTK_IsThornActive(\"$thorn\"))");
+ push(@data, ' {');
+ push(@data, " result = CCTKi_BindingsParameterRecovery_$thorn();");
+ push(@data, ' if (result != 0)');
+ push(@data, ' retval = result;');
+ push(@data, ' if (retval > 0)');
+ push(@data, ' break;');
+ push(@data, ' }');
}
- $outbuf .= " } while (0);\n";
- $outbuf .= " return retval;\n";
- $outbuf .= "}\n";
+ push(@data, ' } while (0);');
+ push(@data, '');
+ push(@data, ' return retval;');
+ push(@data, '}');
+ push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline
- return \$outbuf;
+ return join ("\n", @data);
}
-
#/*@@
# @routine ScheduleBlock
# @date Fri Sep 17 17:37:59 1999
@@ -459,7 +394,7 @@ sub ScheduleBlock
$buffer = " {\n";
# Create the timelevel array
- $buffer .= " int cctkschedulei_tlevelarray[] = {";
+ $buffer .= ' int cctkschedulei_tlevelarray[] = {';
foreach $i (@$tlist)
{
@@ -474,73 +409,73 @@ sub ScheduleBlock
# Start writing out the data
if($rhschedule_db->{"\U$thorn\E BLOCK_$block TYPE"} eq "GROUP")
{
- $prototype = "";
- $buffer .= " CCTKi_ScheduleGroup(";
- $indent = " ";
- $language = "";
+ $prototype = '';
+ $buffer .= ' CCTKi_ScheduleGroup(';
+ $indent = ' ';
+ $language = '';
}
elsif($rhschedule_db->{"\U$thorn\E BLOCK_$block TYPE"} eq "FUNCTION")
{
if($rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"} =~ m:^\s*C\s*$:i )
{
- $language = "C";
+ $language = 'C';
$function = $rhschedule_db->{"\U$thorn\E BLOCK_$block NAME"};
}
elsif($rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"} =~ m:^\s*(F|F77|FORTRAN|F90)\s*$:i )
{
- $language = "Fortran";
+ $language = 'Fortran';
$function = "CCTK_FNAME(".$rhschedule_db->{"\U$thorn\E BLOCK_$block NAME"} .")";
}
else
{
- $mess = "Unknown language " .$rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"};
- &CST_error(0,$mess,"",__LINE__,__FILE__);
- return ("", "");
+ $mess = 'Unknown language ' .$rhschedule_db->{"\U$thorn\E BLOCK_$block LANG"};
+ &CST_error(0,$mess,'',__LINE__,__FILE__);
+ return ('', '');
}
- $prototype = "extern int $function(void); /* Note that this is a cheat, we just need a function pointer. */\n";
+ $prototype = "extern int $function(void);\n";
$buffer .= " CCTKi_ScheduleFunction((void *)$function,\n";
- $indent = " ";
- $buffer .= "$indent";
+ $indent = ' ';
+ $buffer .= $indent;
}
else
{
- $mess = "Internal error: Unknown schedule block type " . $rhschedule_db->{"\U$thorn\E BLOCK_$block TYPE"};
- &CST_error(0,$mess,"",__LINE__,__FILE__);
- return ("", "");
+ $mess = 'Internal error: Unknown schedule block type ' . $rhschedule_db->{"\U$thorn\E BLOCK_$block TYPE"};
+ &CST_error(0,$mess,'',__LINE__,__FILE__);
+ return ('', '');
}
- $buffer .= "\"" . $rhschedule_db->{"\U$thorn\E BLOCK_$block AS"} . "\"" . ",\n";
- $buffer .= $indent . "\"" . $thorn . "\"" . ",\n";
- $buffer .= $indent . "\"" . $implementation . "\"" . ",\n";
- $buffer .= $indent . "\"" . $rhschedule_db->{"\U$thorn\E BLOCK_$block DESCRIPTION"} . "\"" . ",\n";
- $buffer .= $indent . "\"" . $rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} . "\"" . ",\n";
- if($language ne "")
+ $buffer .= '"' . $rhschedule_db->{"\U$thorn\E BLOCK_$block AS"} . "\",\n";
+ $buffer .= "$indent\"$thorn\",\n";
+ $buffer .= "$indent\"$implementation\",\n";
+ $buffer .= "$indent\"" . $rhschedule_db->{"\U$thorn\E BLOCK_$block DESCRIPTION"} . "\",\n";
+ $buffer .= "$indent\"" . $rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} . "\",\n";
+ if($language ne '')
{
- $buffer .= $indent . "\"" . $language . "\"" . ",\n";
+ $buffer .= "$indent\"$language\",\n";
}
- $buffer .= $indent . scalar(@$mem_groups) . ", /* Number of STORAGE groups */\n";
- $buffer .= $indent . scalar(@$comm_groups) . ", /* Number of COMM groups */\n";
- $buffer .= $indent . scalar(@$trigger_groups) . ", /* Number of TRIGGERS groups */\n";
+ $buffer .= $indent . scalar(@$mem_groups) . ", /* Number of STORAGE groups */\n";
+ $buffer .= $indent . scalar(@$comm_groups) . ", /* Number of COMM groups */\n";
+ $buffer .= $indent . scalar(@$trigger_groups) . ", /* Number of TRIGGERS groups */\n";
if (!scalar(@$trigger_groups) && $rhschedule_db->{"\U$thorn\E BLOCK_$block WHERE"} eq "CCTK_ANALYSIS")
{
$mess = "Schedule error: Scheduling at ANALYSIS in $thorn with no TRIGGERS\n";
- $help = "Functions or function groups scheduled in the ANALYSIS bin require TRIGGERS to be set.";
- $help .= "Triggers are grid variables or grid variable group names which are examined by ";
- $help .= "IO methods to decide whether of not execution should happen.";
+ $help = 'Functions or function groups scheduled in the ANALYSIS bin require TRIGGERS to be set.';
+ $help .= 'Triggers are grid variables or grid variable group names which are examined by ';
+ $help .= 'IO methods to decide whether of not execution should happen.';
&CST_error(0,$mess,$help,__LINE__,__FILE__);
}
- $buffer .= $indent . scalar(@$sync_groups) . ", /* Number of SYNC groups */\n";
- $buffer .= $indent . scalar(@options) . ", /* Number of Options */\n";
- $buffer .= $indent . scalar(@before_list) . ", /* Number of BEFORE routines */\n";
- $buffer .= $indent . scalar(@after_list) . ", /* Number of AFTER routines */\n";
- $buffer .= $indent . scalar(@while_list) . ", /* Number of WHILE variables */\n";
- $buffer .= $indent . "cctkschedulei_tlevelarray /* Array of timelevel data for storage groups */";
+ $buffer .= $indent . scalar(@$sync_groups) . ", /* Number of SYNC groups */\n";
+ $buffer .= $indent . scalar(@options) . ", /* Number of Options */\n";
+ $buffer .= $indent . scalar(@before_list) . ", /* Number of BEFORE routines */\n";
+ $buffer .= $indent . scalar(@after_list) . ", /* Number of AFTER routines */\n";
+ $buffer .= $indent . scalar(@while_list) . ", /* Number of WHILE variables */\n";
+ $buffer .= $indent . "cctkschedulei_tlevelarray /* Array of timelevel data for storage groups */";
foreach $item (@$mem_groups, @$comm_groups, @$trigger_groups, @$sync_groups,
@options, @before_list, @after_list, @while_list)
{
- $buffer .= ",\n" . $indent . "\"" . $item . "\"" ;
+ $buffer .= ",\n$indent\"$item\"";
}
$buffer .= ");\n\n";