diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-01 13:35:51 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-02-01 13:35:51 +0000 |
commit | d72657f6e39e9118bd9f3737da8bab87769bf173 (patch) | |
tree | f746b56f7b92365a0332e9fa1e61a58e86509a06 | |
parent | ca9353cc04b5103daec4849b991b56897fcf4ff6 (diff) |
Changes to parsing the scheduling files
git-svn-id: http://svn.cactuscode.org/flesh/trunk@164 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | lib/sbin/config_parser.pl | 17 | ||||
-rw-r--r-- | lib/sbin/schedule_parser.pl | 24 |
2 files changed, 22 insertions, 19 deletions
diff --git a/lib/sbin/config_parser.pl b/lib/sbin/config_parser.pl index 043caf10..dc69b6b3 100644 --- a/lib/sbin/config_parser.pl +++ b/lib/sbin/config_parser.pl @@ -771,14 +771,15 @@ sub CreateScheduleBindings } chdir "Schedule"; - # Parse the schedule.ccl files - @schedule_routines = &create_schedule_code($bindings_dir,%thorns); + # Parse the schedule.ccl files + ($wrapper,$rfr,$startup) = &create_schedule_code($bindings_dir,%thorns); + # Write the contents of BindingsScheduleRegisterRFR.c - &create_BindingsScheduleRegisterRFR($bindings_dir); + &create_RegisterRFR($bindings_dir,split(" ",$rfr)); # Write the contents of BindingsScheduleRegisterSTARTUP.c - &create_BindingsScheduleRegisterSTARTUP($bindings_dir); + &create_RegisterSTARTUP($bindings_dir,split(" ",$startup)); open (OUT, ">Bindings.c") || die "Cannot open Bindings.c"; @@ -794,11 +795,11 @@ sub CreateScheduleBindings if (CCTK_Equals(type,"STARTUP")) { - Cactus_BindingsScheduleRegisterSTARTUP(); + Cactus_RegisterSTARTUP(); } else if (CCTK_Equals(type,"RFRINIT")) { - Cactus_BindingsScheduleRegisterRFR(data); + Cactus_RegisterRFR(data); } else { printf ("Unknown type in CCTK_BindingsScheduleRegister"); } @@ -813,11 +814,11 @@ EOT open (OUT, ">make.code.defn") || die "Cannot open make.code.defn"; $files = ""; - foreach $file (@schedule_routines) { + foreach $file (split(" ",$rfr),split(" ",$startup),split(" ",$wrapper)) { $files = "$files ".$file.".c"; } - print OUT "SRCS = Bindings.c Cactus_BindingsScheduleRegisterSTARTUP.c Cactus_BindingsScheduleRegisterRFR.c $files\n"; + print OUT "SRCS = Bindings.c Cactus_RegisterSTARTUP.c Cactus_RegisterRFR.c $files\n"; close OUT; diff --git a/lib/sbin/schedule_parser.pl b/lib/sbin/schedule_parser.pl index 84165db8..1abd9440 100644 --- a/lib/sbin/schedule_parser.pl +++ b/lib/sbin/schedule_parser.pl @@ -47,10 +47,10 @@ sub create_schedule_code @indata = &read_file("$thorns{$thorn}/schedule.ccl"); # Parse the data and create rfr and startup subroutines - @wrapper_files = &parse_schedule_ccl($thorn,"rfr",OUTRFR,PROTO,@indata); - push (@compile_files,@wrapper_files); - push (@compile_files,$thorn_rfr); - push (@compile_files,$thorn_startup); + @wrappers = &parse_schedule_ccl($thorn,"rfr",OUTRFR,PROTO,@indata); + $wrapper_files .= join(" ",@wrappers); + $rfr_files .= " $thorn_rfr"; + $startup_files .= " $thorn_startup"; &parse_schedule_ccl($thorn,"startup",OUTSTART,PROTO,@indata); @@ -63,7 +63,7 @@ sub create_schedule_code } - return @compile_files; + return ($wrapper_files,$rfr_files,$startup_files); } @@ -108,15 +108,17 @@ sub write_startup_header { } -sub create_BindingsScheduleRegisterRFR +sub create_RegisterRFR { local ($dir,@rfr_routines) = @_; local ($rfr_calls,$file,$outfile); - $outfile = "$dir/Schedule/Cactus_BindingsScheduleRegisterRFR.c"; + $outfile = "$dir/Schedule/Cactus_RegisterRFR.c"; open (OUT, ">$outfile") || die "Cannot open $outfile"; + print "HELLO\n\n\n\n\n"; + print @rfr_routines; $rfr_calls = ""; foreach $file (@rfr_routines) { $rfr_calls = "$rfr_calls ".$file."(data);\n"; @@ -124,7 +126,7 @@ sub create_BindingsScheduleRegisterRFR print OUT <<EOT; - Cactus_BindingsScheduleRegisterRFR(void *data) + Cactus_RegisterRFR(void *data) { $rfr_calls } @@ -134,13 +136,13 @@ EOT } -sub create_BindingsScheduleRegisterSTARTUP +sub create_RegisterSTARTUP { local ($dir,@startup_routines) = @_; local ($startup_calls,$file,$outfile); - $outfile = "$dir/Schedule/Cactus_BindingsScheduleRegisterSTARTUP.c"; + $outfile = "$dir/Schedule/Cactus_RegisterSTARTUP.c"; open (OUT, ">$outfile") || die "Cannot open $outfile"; $startup_calls = ""; @@ -150,7 +152,7 @@ sub create_BindingsScheduleRegisterSTARTUP print OUT <<EOT; - Cactus_BindingsScheduleRegisterSTARTUP() + Cactus_RegisterSTARTUP() { $startup_calls } |