From 82bae3b0d093c02244e6f063c89e708f13ab1330 Mon Sep 17 00:00:00 2001 From: Scott Fennell Date: Tue, 9 Jul 2019 15:58:26 -0500 Subject: [PATCH] #836 remove all S_default.dat stuff --- bin/trick-CP | 5 - include/trick/CheckPointRestart.hh | 6 -- libexec/trick/configuration_processor | 11 +-- libexec/trick/pm/default_data.pm | 93 ------------------- share/man/man1/trick-CP.1 | 2 - share/trick/sim_objects/default_trick_sys.sm | 2 - test/.gitignore | 1 - trick_sims/.gitignore | 1 - .../CheckPointRestart/CheckPointRestart.cpp | 6 -- .../MemoryManager/MemoryManager_restore.cpp | 8 +- 10 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 libexec/trick/pm/default_data.pm diff --git a/bin/trick-CP b/bin/trick-CP index 9ad1e87e..2a0b0080 100755 --- a/bin/trick-CP +++ b/bin/trick-CP @@ -135,10 +135,6 @@ The simulation-specific executive source code file. The simulation-specific object code link list file. -=item B - -The simulation-specific default initialization data file. - =back =cut @@ -280,7 +276,6 @@ tidy: -rm -f S_source.hh S_sie.resource -rm -f S_main* T_main* -rm -f build/Makefile_* - -rm -f S_default.dat clean: tidy -rm -f DP_Product/DP_rt_frame DP_Product/DP_rt_itimer diff --git a/include/trick/CheckPointRestart.hh b/include/trick/CheckPointRestart.hh index 8feec31e..512f9f8b 100644 --- a/include/trick/CheckPointRestart.hh +++ b/include/trick/CheckPointRestart.hh @@ -326,12 +326,6 @@ namespace Trick { */ virtual int load_checkpoint_job() ; - /** - * Calls the MemoryManager restore_managed_memory method with S_default.dat - * @return always 0 - */ - virtual int load_default_data() ; - // Removed all doxygen documents for functions that have documents in the parent class since // Doxygen inherits the documents from the parent class automatically. diff --git a/libexec/trick/configuration_processor b/libexec/trick/configuration_processor index c8e98a4d..3fada80e 100755 --- a/libexec/trick/configuration_processor +++ b/libexec/trick/configuration_processor @@ -14,7 +14,6 @@ use lib "$RealBin/pm" ; use parse_s_define ; use gte ; use s_source ; -use default_data ; use trick_print ; use trick_version ; @@ -81,13 +80,9 @@ trick_print($sim{fh}, "S_source.c\n", "title_white", $sim{args}{v}); s_source( \%sim ) ; #-------------------------------------------------------------- -# Make Default Data +# close chdir ($cwd) ; -trick_print($sim{fh}, "Writing ", "title_blue" , $sim{args}{v}) ; -trick_print($sim{fh}, "Default_data\n", "title_white" , $sim{args}{v}) ; -make_default_data( \%sim ) ; - close OUTFILE ; #-------------------------------------------------------------- @@ -124,10 +119,6 @@ See the Trick User's guide for B =over 8 -=item B<-d> - -S_default.dat and Default_data (Default data files) - =item B<-e> S_main_\${TRICK_HOST_CPU}.exe (Master executable) diff --git a/libexec/trick/pm/default_data.pm b/libexec/trick/pm/default_data.pm deleted file mode 100644 index 4a69c67e..00000000 --- a/libexec/trick/pm/default_data.pm +++ /dev/null @@ -1,93 +0,0 @@ -package default_data ; - -use Exporter (); -@ISA = qw(Exporter); -@EXPORT = qw(make_default_data); - -use strict ; - -use lib $ENV{"TRICK_HOME"} . "/bin/pm" ; -use gte ; -use trick_print ; -use get_paths ; - -#-------------------------------------------------------------- -# Make Default Data - -sub make_default_data($) { - - my ($sim_ref) = @_ ; - my $title ; - my @all_lines ; - my $date = localtime() ; - my $user ; - my @include_paths ; - - if (open FILE, "Title") { - @all_lines = ; - $title = join "" , @all_lines ; - chomp $title ; - close FILE ; - } - else { - $title = "No Title Specified" ; - } - - $user = gte("USER"); - chomp $user ; - - open S_DEF, ">S_default.dat" or die "Could not open S_default.dat for writing" ; - - my ($sec,$min,$hour,$mday,$mon,$year) = localtime ; - $year += 1900 ; - $mon += 1 ; - my ($login) = getpwuid($<) ; - - #--------------------------- - # Print version - date - printf S_DEF "\n// Created $year/%02d/%02d %02d\:%02d\:%02d $login\n", - $mon , $mday , $hour , $min , $sec ; - - print S_DEF " -// TITLE: $title -// DATE: $date -// USER: $user\n\n" ; - - my @default_data_list ; - @include_paths = get_include_paths() ; - - foreach my $dd_comment ( @{$$sim_ref{default_data}} ) { - $dd_comment =~ s/\(\s*\(/\(/sg ; - $dd_comment =~ s/\)\s*\)/\)/sg ; - @default_data_list = $dd_comment =~ m/\((.+?)\)/sg ; - foreach my $dd ( @default_data_list ) { - my $file_found = 0 ; - my ($type , $var , $file_name) = split /\s+/ , $dd ; - if ( $file_name eq "" ) { - # not enough fields - trick_print($$sim_ref{fh},"Default data does not have \"TYPE VAR FILE\" syntax\n$dd\n", "title_red", $$sim_ref{args}{v}) ; - exit -1 ; - } - print S_DEF "\n// from $type $var $file_name\n\n" ; - (my $cc = gte("TRICK_CC")) =~ s/\n// ; - foreach my $inc ( @include_paths ) { - if ( -e "$inc/$file_name") { - open DEFDATA, "$cc -E -x c -D$type=$var $inc/$file_name |" ; - while ( ) { - print S_DEF if ( !/^#\s\d+/ ) - } - $file_found = 1 ; - last ; - } - } - if ( $file_found == 0 ) { - print "\033[31mCould not find default data file $file_name\033[00m\n" ; - } - } - } - - return ; - -} - -1; diff --git a/share/man/man1/trick-CP.1 b/share/man/man1/trick-CP.1 index f5e568b6..4a22b0a6 100644 --- a/share/man/man1/trick-CP.1 +++ b/share/man/man1/trick-CP.1 @@ -39,8 +39,6 @@ The simulation-specific executive source code file. \fIbuild/S_library_list\fP The simulation-specific object code link list file. .TP -\fIS_default.dat\fP -The simulation-specific default initialization data file. .SH ENVIRONMENT .TP \fB${TRICK_CPFLAGS}\fP diff --git a/share/trick/sim_objects/default_trick_sys.sm b/share/trick/sim_objects/default_trick_sys.sm index 74c35f02..29cbd396 100644 --- a/share/trick/sim_objects/default_trick_sys.sm +++ b/share/trick/sim_objects/default_trick_sys.sm @@ -214,8 +214,6 @@ class CheckPointRestartSimObject : public Trick::SimObject { exec_register_scheduler(&cpr) ; {TRK} P0 ("default_data") cpr.find_write_checkpoint_jobs(name + ".cpr") ; - - {TRK} P0 ("default_data") cpr.load_default_data() ; {TRK} P1 ("initialization") cpr.write_pre_init_checkpoint() ; {TRK} P65535 ("initialization") cpr.write_post_init_checkpoint() ; {TRK} P0 ("system_checkpoint") cpr.write_checkpoint() ; diff --git a/test/.gitignore b/test/.gitignore index c87fcc89..231965af 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -13,7 +13,6 @@ CP_out MAKE_out Makefile_sim Makefile_swig -S_default.dat S_document.xml S_library_list S_main_* diff --git a/trick_sims/.gitignore b/trick_sims/.gitignore index f3f5b2a5..3607e6d1 100644 --- a/trick_sims/.gitignore +++ b/trick_sims/.gitignore @@ -14,7 +14,6 @@ CP_out MAKE_out Makefile_sim Makefile_swig -S_default.dat S_document.xml S_library_list S_main_* diff --git a/trick_source/sim_services/CheckPointRestart/CheckPointRestart.cpp b/trick_source/sim_services/CheckPointRestart/CheckPointRestart.cpp index 75128f72..1be744df 100644 --- a/trick_source/sim_services/CheckPointRestart/CheckPointRestart.cpp +++ b/trick_source/sim_services/CheckPointRestart/CheckPointRestart.cpp @@ -443,12 +443,6 @@ int Trick::CheckPointRestart::load_checkpoint_job() { return(0) ; } -int Trick::CheckPointRestart::load_default_data() { - - trick_MM->read_checkpoint("S_default.dat") ; - return(0) ; -} - int Trick::CheckPointRestart::write_s_job_execution(FILE *fp) { if ( fp == NULL ) { diff --git a/trick_source/sim_services/MemoryManager/MemoryManager_restore.cpp b/trick_source/sim_services/MemoryManager/MemoryManager_restore.cpp index 3df3864d..c4a1e86a 100644 --- a/trick_source/sim_services/MemoryManager/MemoryManager_restore.cpp +++ b/trick_source/sim_services/MemoryManager/MemoryManager_restore.cpp @@ -63,13 +63,7 @@ int Trick::MemoryManager::read_checkpoint(const char* filename ) { // Create a stream from the named file. std::ifstream infile(filename , std::ios::in); if (infile.is_open()) { - - // If the filename is not S_default.dat, we will tell read_checkpoint to - // restore stls. - bool do_restore_stls = - (std::string(filename).find("S_default.dat") == std::string::npos); - - return ( read_checkpoint( &infile, do_restore_stls )) ; + return ( read_checkpoint( &infile, true )) ; } else { std::stringstream message; message << "Couldn't open \"" << filename << "\"." ;