diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-30 16:19:55 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2002-05-30 16:19:55 +0000 |
commit | 11f4931086eeec6260be13b7a42533eef4d06605 (patch) | |
tree | fc071a1602ebac9d6adad7a5825bde57fe020c1a /lib/sbin/CreateScheduleBindings.pl | |
parent | 9d01956c74f5802cc783b1fb100e1f42b70c27e8 (diff) |
Fixed typo in warning message. Some better grdoc for generated files.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2872 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateScheduleBindings.pl')
-rw-r--r-- | lib/sbin/CreateScheduleBindings.pl | 282 |
1 files changed, 100 insertions, 182 deletions
diff --git a/lib/sbin/CreateScheduleBindings.pl b/lib/sbin/CreateScheduleBindings.pl index 0d360905..fa96a51b 100644 --- a/lib/sbin/CreateScheduleBindings.pl +++ b/lib/sbin/CreateScheduleBindings.pl @@ -2,25 +2,20 @@ # @file CreateScheduleBindings.pl # @date Thu Sep 16 23:30:21 1999 # @author Tom Goodale -# @desc -# New schedule stuff. Should be renamed !!! -# @enddesc -# @version $Header$ +# @desc +# New schedule stuff. Should be renamed !!! +# @enddesc +# @version $Header$ #@@*/ #/*@@ # @routine CreateScheduleBindings # @date Fri Sep 17 14:16:23 1999 # @author Tom Goodale -# @desc -# Creates the schedule bindings. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @desc +# Creates the schedule bindings. +# @enddesc +# @calls #@@*/ sub CreateScheduleBindings { @@ -82,23 +77,18 @@ sub CreateScheduleBindings $line = "SRCS = $file_list\n"; &WriteFile("make.code.defn",\$line); - + chdir "$start_dir"; -} +} #/*@@ # @routine ScheduleCreateFile # @date Fri Sep 17 17:34:26 1999 # @author Tom Goodale -# @desc +# @desc # Creates a string containing all the data which should go into a schedule file. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleCreateFile { @@ -119,9 +109,9 @@ sub ScheduleCreateFile my($outbuf); $implementation = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"}; - + $buffer = $rhschedule_db->{"\U$thorn\E FILE"}; - + # Process each schedule block for($block = 0 ; $block < $rhschedule_db->{"\U$thorn\E N_BLOCKS"}; $block++) { @@ -141,19 +131,25 @@ sub ScheduleCreateFile # Process each schedule statement for($statement = 0 ; $statement < $rhschedule_db->{"\U$thorn\E N_STATEMENTS"}; $statement++) { - ($statement_buffer, $statement_prototype) = &ScheduleStatement($thorn, $implementation, $statement, + ($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 .= "\#define THORN_IS_$thorn\n"; + $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 .= "\#include <stdarg.h>\n"; + $outbuf .= "\#define THORN_IS_$thorn\n"; $outbuf .= "\n"; $outbuf .= "\#include \"cctk.h\"\n"; $outbuf .= "\#include \"cctk_Parameters.h\"\n"; @@ -162,28 +158,12 @@ sub ScheduleCreateFile $outbuf .= "/* Prototypes for functions to be registered. */\n"; $outbuf .= "$prototypes\n"; $outbuf .= "\n"; - $outbuf .= "/*\@\@\n"; - $outbuf .= " \@routine CCTKi_BindingsSchedule_$thorn\n"; - $outbuf .= " \@date \n"; - $outbuf .= " \@author \n"; - $outbuf .= " \@desc \n"; - $outbuf .= " Creates the schedule bindings for thorn $thorn\n"; - $outbuf .= " \@enddesc \n"; - $outbuf .= " \@calls \n"; - $outbuf .= " \@calledby \n"; - $outbuf .= " \@history \n"; - $outbuf .= "\n"; - $outbuf .= " \@endhistory\n"; - $outbuf .= "\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 .= "return;\n"; $outbuf .= "}\n"; - $outbuf .= "\n"; return \$outbuf; @@ -194,15 +174,10 @@ sub ScheduleCreateFile # @routine ParameterRecoveryCreateFile # @date Tue Apr 18 17:34:26 2000 # @author Gabrielle Allen -# @desc +# @desc # Creates a string containing all the data which should go into a parameter recovery file. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ParameterRecoveryCreateFile { @@ -223,9 +198,9 @@ sub ParameterRecoveryCreateFile my($outbuf); $implementation = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"}; - + $buffer = $rhschedule_db->{"\U$thorn\E FILE"}; - + # Process each schedule block for($block = 0 ; $block < $rhschedule_db->{"\U$thorn\E N_BLOCKS"}; $block++) { @@ -246,7 +221,7 @@ sub ParameterRecoveryCreateFile else { $buffer =~ s:\@BLOCK\@$block::; - } + } } # Process each schedule statement @@ -254,7 +229,7 @@ sub ParameterRecoveryCreateFile { $buffer =~ s:\@STATEMENT\@$statement::; } - + # Actually create the string # Header stuff @@ -278,10 +253,6 @@ sub ParameterRecoveryCreateFile $outbuf .= " Creates the parameter recovery bindings for thorn $thorn\n"; $outbuf .= " \@enddesc \n"; $outbuf .= " \@calls \n"; - $outbuf .= " \@calledby \n"; - $outbuf .= " \@history \n"; - $outbuf .= "\n"; - $outbuf .= " \@endhistory\n"; $outbuf .= "\n"; $outbuf .= "\@\@*/\n"; $outbuf .= "int CCTKi_BindingsParameterRecovery_$thorn(void);\n"; @@ -304,16 +275,11 @@ sub ParameterRecoveryCreateFile # @routine ScheduleCreateBindings # @date Fri Sep 17 18:17:13 1999 # @author Tom Goodale -# @desc -# Creates a string containing all the data which should go into the master +# @desc +# Creates a string containing all the data which should go into the master # schedule bindings file. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleCreateBindings { @@ -322,6 +288,14 @@ sub ScheduleCreateBindings 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"; @@ -332,20 +306,7 @@ sub ScheduleCreateBindings $outbuf .= "void CCTKi_BindingsSchedule_$thorn(void);\n"; } - $outbuf .= "/*\@\@\n"; - $outbuf .= " \@routine CCTKi_BindingsScheduleInitialise\n"; - $outbuf .= " \@date \n"; - $outbuf .= " \@author \n"; - $outbuf .= " \@desc \n"; - $outbuf .= " Calls all the thorn schedule bindings file if the thorns are active.\n"; - $outbuf .= " \@enddesc \n"; - $outbuf .= " \@calls \n"; - $outbuf .= " \@calledby \n"; - $outbuf .= " \@history \n"; - $outbuf .= "\n"; - $outbuf .= " \@endhistory\n"; $outbuf .= "\n"; - $outbuf .= "\@\@*/\n"; $outbuf .= "int CCTKi_BindingsScheduleInitialise(void);\n"; $outbuf .= "int CCTKi_BindingsScheduleInitialise(void)\n"; $outbuf .= "{\n"; @@ -358,7 +319,6 @@ sub ScheduleCreateBindings } $outbuf .= " return 0;\n"; $outbuf .= "}\n"; - $outbuf .= "\n"; return \$outbuf; } @@ -368,16 +328,10 @@ sub ScheduleCreateBindings # @routine ParameterRecoveryCreateBindings # @date Tue Apr 18 13:17:13 2000 # @author Gabrielle Allen -# @desc -# Creates a string containing all the data which should go into the master +# @desc +# Creates a string containing all the data which should go into the master # parameter recovery bindings file. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc #@@*/ sub ParameterRecoveryCreateBindings { @@ -386,31 +340,26 @@ sub ParameterRecoveryCreateBindings 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"; - $outbuf .= "int CCTKi_BindingsParameterRecoveryInitialise(void);\n"; foreach $thorn (sort split(" ", $rhinterface_db->{"THORNS"})) { $outbuf .= "int CCTKi_BindingsParameterRecovery_$thorn(void);\n"; } - $outbuf .= "/*\@\@\n"; - $outbuf .= " \@routine CCTKi_BindingsParameterRecoveryInitialise\n"; - $outbuf .= " \@date \n"; - $outbuf .= " \@author \n"; - $outbuf .= " \@desc \n"; - $outbuf .= " Calls all the thorn parameter recovery bindings file if the thorns are active.\n"; - $outbuf .= " \@enddesc \n"; - $outbuf .= " \@calls \n"; - $outbuf .= " \@calledby \n"; - $outbuf .= " \@history \n"; - $outbuf .= "\n"; - $outbuf .= " \@endhistory\n"; - $outbuf .= "\n"; - $outbuf .= "\@\@*/\n"; + $outbuf .= "int CCTKi_BindingsParameterRecoveryInitialise(void);\n"; $outbuf .= "int CCTKi_BindingsParameterRecoveryInitialise(void)\n"; $outbuf .= "{\n"; @@ -432,7 +381,6 @@ sub ParameterRecoveryCreateBindings $outbuf .= " } while (0);\n"; $outbuf .= " return retval;\n"; $outbuf .= "}\n"; - $outbuf .= "\n"; return \$outbuf; } @@ -443,15 +391,10 @@ sub ParameterRecoveryCreateBindings # @routine ScheduleBlock # @date Fri Sep 17 17:37:59 1999 # @author Tom Goodale -# @desc +# @desc # Creates the code for a given schedule block -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleBlock { @@ -471,14 +414,14 @@ sub ScheduleBlock my(@while_list); # Extract group and routine information from the databases - ($mem_groups, $tlist) = &ScheduleSelectGroups($thorn, $implementation, + ($mem_groups, $tlist) = &ScheduleSelectGroups($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block STOR"}, $rhinterface_db); &ScheduleValidateTimeLevels($thorn, $implementation, $mem_groups,$tlist, $rhinterface_db); - - ($unused_comm_groups) = &ScheduleSelectGroups($thorn, $implementation, + + ($unused_comm_groups) = &ScheduleSelectGroups($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block COMM"}, $rhinterface_db); if (@$unused_comm_groups) @@ -489,25 +432,25 @@ sub ScheduleBlock $comm_groups = []; - ($trigger_groups) = &ScheduleSelectGroups($thorn, $implementation, + ($trigger_groups) = &ScheduleSelectGroups($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block TRIG"}, $rhinterface_db); - - ($sync_groups) = &ScheduleSelectGroups($thorn, $implementation, + + ($sync_groups) = &ScheduleSelectGroups($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block SYNC"}, $rhinterface_db); @options = split(/,/, $rhschedule_db->{"\U$thorn\E BLOCK_$block OPTIONS"}); - @before_list = &ScheduleSelectRoutines($thorn, $implementation, + @before_list = &ScheduleSelectRoutines($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block BEFORE"}, $rhschedule_db); - @after_list = &ScheduleSelectRoutines($thorn, $implementation, + @after_list = &ScheduleSelectRoutines($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block AFTER"}, $rhschedule_db); - @while_list = &ScheduleSelectVars($thorn, $implementation, + @while_list = &ScheduleSelectVars($thorn, $implementation, $rhschedule_db->{"\U$thorn\E BLOCK_$block WHILE"}, $rhinterface_db); @@ -527,8 +470,8 @@ sub ScheduleBlock # Can also be used to detect end of array. $buffer .= "0};\n"; - - # Start writing out the data + + # Start writing out the data if($rhschedule_db->{"\U$thorn\E BLOCK_$block TYPE"} eq "GROUP") { $prototype = ""; @@ -565,7 +508,7 @@ sub ScheduleBlock &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"; @@ -593,8 +536,8 @@ sub ScheduleBlock $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, + + foreach $item (@$mem_groups, @$comm_groups, @$trigger_groups, @$sync_groups, @options, @before_list, @after_list, @while_list) { $buffer .= ",\n" . $indent . "\"" . $item . "\"" ; @@ -612,15 +555,10 @@ sub ScheduleBlock # @routine ScheduleStatement # @date Fri Sep 17 17:38:30 1999 # @author Tom Goodale -# @desc +# @desc # Creates the code for a given schedule statement -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleStatement { @@ -631,7 +569,7 @@ sub ScheduleStatement my($misc); # Extract the groups. - ($groups,$misc) = &ScheduleSelectGroups($thorn, $implementation, + ($groups,$misc) = &ScheduleSelectGroups($thorn, $implementation, $rhschedule_db->{"\U$thorn\E STATEMENT_$statement GROUPS"}, $rhinterface_db); @@ -673,15 +611,10 @@ sub ScheduleStatement # @routine ScheduleSelectGroups # @date Fri Sep 17 17:38:53 1999 # @author Tom Goodale -# @desc +# @desc # Parses a list of variable groups and selects valid ones. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleSelectGroups { @@ -706,7 +639,7 @@ sub ScheduleSelectGroups $group =~ m/^([^[]+)(\[([^]]*)\])?$/; $group = $1; - + my $misc = $3; if(! defined $misc) @@ -726,7 +659,7 @@ sub ScheduleSelectGroups if(($other_imp !~ m:^\s*$thorn\s*$:i) && ($other_imp !~ m:^\s*$implementation\s*$:i)) { # The name has been given completely specified but it isn't this thorn. - + if($rhinterface_db->{"IMPLEMENTATION \U$implementation\E ANCESTORS"} =~ m:\b$other_imp\b:i) { $block = "PUBLIC"; @@ -745,7 +678,7 @@ sub ScheduleSelectGroups $rhinterface_db->{"IMPLEMENTATION \U$other_imp\E THORNS"} =~ m:(\w+):; $other_thorn = $1; - + if($rhinterface_db->{"\U$other_thorn\E $block GROUPS"} =~ m:\b$group\b:i) { push(@groups, "$other_imp\::$group"); @@ -757,7 +690,7 @@ sub ScheduleSelectGroups $mess = "Schedule error: Thorn $thorn - group $other_imp\:\:$group doesn't exist.\n"; &CST_error(0,$mess,"",__LINE__,__FILE__); next; - } + } } } @@ -813,10 +746,10 @@ sub ScheduleSelectGroups { $mess = "Schedule error: Thorn $thorn - group $group doesn't exist."; $help = "Check $group really is in thorn $thorn. Groups from other thorns "; - $help .= "need to be specified using \$implementation\:\:\$group and "; + $help .= "need to be specified using $implementation\:\:$group and "; $help .= "$implementation must be inheritied by your thorn."; &CST_error(0,$mess,$help,__LINE__,__FILE__); - + } } else @@ -834,16 +767,11 @@ sub ScheduleSelectGroups # @routine ScheduleSelectRoutines # @date Fri Sep 17 17:39:29 1999 # @author Tom Goodale -# @desc +# @desc # Parses a list of schedule routines/groups. # FIXME - should validate -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleSelectRoutines { @@ -869,16 +797,11 @@ sub ScheduleSelectRoutines # @routine ScheduleSelectVars # @date Fri Sep 17 17:39:58 1999 # @author Tom Goodale -# @desc +# @desc # Parses a list of variables # FIXME - should validate -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleSelectVars { @@ -903,15 +826,10 @@ sub ScheduleSelectVars # @routine ScheduleValidateTimeLevels # @date Tue Apr 16 15:22:02 2002 # @author Tom Goodale -# @desc +# @desc # Validate the timelevel specifiers for a group list. -# @enddesc -# @calls -# @calledby -# @history -# -# @endhistory -# +# @enddesc +# @calls #@@*/ sub ScheduleValidateTimeLevels { @@ -936,9 +854,9 @@ sub ScheduleValidateTimeLevels $return_code++; next; } - + $group =~ m/^(.+)::(.+)$/; - + my $imp = $1; my $groupname = $2; @@ -955,7 +873,7 @@ sub ScheduleValidateTimeLevels $allowed_timelevels = $rhinterface_db->{"\U$thornlist[0] GROUP $groupname TIMELEVELS\E"}; } - # If the maximum number of timelevels is 1, the timelevel specification can be empty. + # If the maximum number of timelevels is 1, the timelevel specification can be empty. if($timelevels eq "" && $allowed_timelevels == 1) { $$timelevels_list[$i] = 1; @@ -970,7 +888,7 @@ sub ScheduleValidateTimeLevels "Note that you should only activate the number of timelevels necesary for your scheme, which may be less than this maximum." ,"",__LINE__,__FILE__); $return_code++; - } + } elsif($timelevels > 0 && $timelevels <= $allowed_timelevels) { next; |