diff --git a/src/sst/elements/memHierarchy/memTypes.h b/src/sst/elements/memHierarchy/memTypes.h index 97c574dcb2..da30f15f32 100644 --- a/src/sst/elements/memHierarchy/memTypes.h +++ b/src/sst/elements/memHierarchy/memTypes.h @@ -229,7 +229,7 @@ static const std::string NONE = "None"; enum class MemEventStatus { OK, Stall, Reject }; /* Define an address region by start/end & interleaving */ -class MemRegion : public SST::Core::Serialization::serializable, SST::Core::Serialization::serializable_type { +class MemRegion : public SST::Core::Serialization::serializable { public: SST::MemHierarchy::Addr start; // First address that is part of the region SST::MemHierarchy::Addr end; // Last address that is part of the region diff --git a/src/sst/elements/simpleElementExample/Makefile.am b/src/sst/elements/simpleElementExample/Makefile.am index 07a5f61453..f635c20ba6 100644 --- a/src/sst/elements/simpleElementExample/Makefile.am +++ b/src/sst/elements/simpleElementExample/Makefile.am @@ -39,6 +39,7 @@ endif EXTRA_DIST = \ README \ tests/testsuite_default_simpleComponents.py \ + tests/basicCheckpoint.py \ tests/basicClocks.py \ tests/basicParams.py \ tests/basicStatistics1.py \ diff --git a/src/sst/elements/simpleElementExample/basicSimLifeCycle.cc b/src/sst/elements/simpleElementExample/basicSimLifeCycle.cc index b6c9f1ac1d..2cbcf5cc29 100644 --- a/src/sst/elements/simpleElementExample/basicSimLifeCycle.cc +++ b/src/sst/elements/simpleElementExample/basicSimLifeCycle.cc @@ -327,6 +327,7 @@ void basicSimLifeCycle::serialize_order(SST::Core::Serialization::serializer& se switch ( ser.mode() ) { case SST::Core::Serialization::serializer::SIZER: case SST::Core::Serialization::serializer::PACK: + break; case SST::Core::Serialization::serializer::UNPACK: { //Reinitialize iter from neighbors @@ -336,5 +337,8 @@ void basicSimLifeCycle::serialize_order(SST::Core::Serialization::serializer& se break; } + case SST::Core::Serialization::serializer::MAP: + // Mapping mode not supported + break; } } diff --git a/src/sst/elements/simpleElementExample/tests/basicCheckpoint.py b/src/sst/elements/simpleElementExample/tests/basicCheckpoint.py new file mode 100644 index 0000000000..16250f0e54 --- /dev/null +++ b/src/sst/elements/simpleElementExample/tests/basicCheckpoint.py @@ -0,0 +1,31 @@ +import sst + +# Test a basic param +basicParam = sst.Component("basicParam", "simpleElementExample.basicParams") +params = { + "int_param" : 20, + "bool_param" : "false", + "uint32_param" : "678", + "array_param" : "[0, 1, 5, 20, -1 ]", + "example_param" : "a:92", +} +basicParam.addParams(params) + +component0 = sst.Component("c0", "simpleElementExample.example0") +component1 = sst.Component("c1", "simpleElementExample.example1") + +params = { + "eventsToSend" : 50, # Required parameter, error if not provided + "eventSize" : 32 # Optional parameter, defaults to 16 if not provided +} +component0.addParams(params) +component1.addParams(params) + +link = sst.Link("component_link0") +link.connect( (component0, "port", "1ns"), (component1, "port", "1ns") ) + + +sst.setStatisticLoadLevel(7) +sst.setStatisticOutput("sst.statOutputConsole") +sst.enableAllStatisticsForComponentType("simpleElementExample.example0") +sst.enableAllStatisticsForComponentType("simpleElementExample.example1") \ No newline at end of file diff --git a/src/sst/elements/simpleElementExample/tests/testsuite_default_simpleComponents.py b/src/sst/elements/simpleElementExample/tests/testsuite_default_simpleComponents.py index 106f0a5601..d5083db8e5 100644 --- a/src/sst/elements/simpleElementExample/tests/testsuite_default_simpleComponents.py +++ b/src/sst/elements/simpleElementExample/tests/testsuite_default_simpleComponents.py @@ -53,12 +53,15 @@ def test_basic_simlifecycle(self): def test_basic_subcomponent(self): self.simple_components_template("basicSubComponent") + def test_basic_checkpoint(self): + self.simple_components_template("basicCheckpoint", checkpoint=True) + #def test_simple_rng_component_marsaglia(self): # self.simple_components_template("simpleRNGComponent_marsaglia", striptotail=1) ##### - def simple_components_template(self, testcase, striptotail=0): + def simple_components_template(self, testcase, striptotail=0, checkpoint=False): # Get the path to the test files test_path = self.get_testsuite_dir() outdir = self.get_test_output_run_dir() @@ -75,29 +78,51 @@ def simple_components_template(self, testcase, striptotail=0): errfile = "{0}/{1}.err".format(outdir, testDataFileName) mpioutfiles = "{0}/{1}.testfile".format(outdir, testDataFileName) - self.run_sst(sdlfile, outfile, errfile, mpi_out_files=mpioutfiles) - - testing_remove_component_warning_from_file(outfile) - - # Copy the outfile to the cmpfile - os.system("cp {0} {1}".format(outfile, cmpfile)) - - if striptotail == 1: - # Post processing of the output data to scrub it into a format to compare - os.system("grep Random {0} > {1}".format(outfile, tmpfile)) - os.system("tail -5 {0} > {1}".format(tmpfile, cmpfile)) - - # NOTE: THE PASS / FAIL EVALUATIONS ARE PORTED FROM THE SQE BAMBOO - # BASED testSuite_XXX.sh THESE SHOULD BE RE-EVALUATED BY THE - # DEVELOPER AGAINST THE LATEST VERSION OF SST TO SEE IF THE - # TESTS & RESULT FILES ARE STILL VALID - - # Perform the tests - if os_test_file(errfile, "-s"): - log_testing_note("simpleComponents test {0} has a Non-Empty Error File {1}".format(testDataFileName, errfile)) - - cmp_result = testing_compare_sorted_diff(testcase, cmpfile, reffile) - if (cmp_result == False): - diffdata = testing_get_diff_data(testcase) - log_failure(diffdata) - self.assertTrue(cmp_result, "Sorted Output file {0} does not match sorted Reference File {1}".format(cmpfile, reffile)) + if not checkpoint: + self.run_sst(sdlfile, outfile, errfile, mpi_out_files=mpioutfiles) + + testing_remove_component_warning_from_file(outfile) + + # Copy the outfile to the cmpfile + os.system("cp {0} {1}".format(outfile, cmpfile)) + + if striptotail == 1: + # Post processing of the output data to scrub it into a format to compare + os.system("grep Random {0} > {1}".format(outfile, tmpfile)) + os.system("tail -5 {0} > {1}".format(tmpfile, cmpfile)) + + # NOTE: THE PASS / FAIL EVALUATIONS ARE PORTED FROM THE SQE BAMBOO + # BASED testSuite_XXX.sh THESE SHOULD BE RE-EVALUATED BY THE + # DEVELOPER AGAINST THE LATEST VERSION OF SST TO SEE IF THE + # TESTS & RESULT FILES ARE STILL VALID + + # Perform the tests + if os_test_file(errfile, "-s"): + log_testing_note("simpleComponents test {0} has a Non-Empty Error File {1}".format(testDataFileName, errfile)) + + cmp_result = testing_compare_sorted_diff(testcase, cmpfile, reffile) + if (cmp_result == False): + diffdata = testing_get_diff_data(testcase) + log_failure(diffdata) + self.assertTrue(cmp_result, "Sorted Output file {0} does not match sorted Reference File {1}".format(cmpfile, reffile)) + + # Checkpoint test + else: + cptfreq = "15us" + cptrestart = "0_15000000" + + # Generate checkpoint + sdlfile_generate = "{0}/{1}.py".format(test_path,testcase) + outfile_generate = "{0}/{1}_generate.out".format(outdir,testcase) + options_checkpoint="--checkpoint-sim-period={0} --checkpoint-prefix={1}".format(cptfreq,testcase) + self.run_sst(sdlfile_generate, outfile_generate, other_args=options_checkpoint) + + # Run from restart + sdlfile_restart = "{0}/{1}/{1}_{2}/{1}_{2}.sstcpt".format(outdir,testcase,cptrestart) + outfile_restart = "{0}/{1}_restart.out".format(outdir, testcase) + options_restart = "--load-checkpoint" + self.run_sst(sdlfile_restart, outfile_restart, other_args=options_restart) + + # Check that restart output is a subset of checkpoint output + cmp_result = testing_compare_filtered_subset(outfile_restart, outfile_generate) + self.assertTrue(cmp_result, "Output/Compare file {0} does not match Reference File {1}".format(outfile_restart, outfile_generate)) \ No newline at end of file