Skip to content

Commit

Permalink
TimeLord serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
gvoskuilen committed Apr 19, 2024
1 parent 1c37903 commit 771c035
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/sst/core/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SST_CORE_OUTPUT_H

#include <string.h>
#include <vector>

// UNCOMMENT OUT THIS LINE TO ENABLE THE DEBUG METHOD -OR_
// CHOOSE THE --enable-debug OPTION DURING SST CONFIGURATION
Expand Down
6 changes: 6 additions & 0 deletions src/sst/core/simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@ Simulation_impl::checkpoint()
ser& currentPriority;
ser& endSimCycle;
ser& output_directory;
ser& timeLord;
// Actions that may also be in TV
ser& m_exit;
ser& syncManager;
Expand Down Expand Up @@ -1327,6 +1328,7 @@ Simulation_impl::checkpoint()
ser& currentPriority;
ser& endSimCycle;
ser& output_directory;
ser& timeLord;
// Actions that may also be in TV
ser& m_exit;
ser& syncManager;
Expand Down Expand Up @@ -1463,6 +1465,7 @@ Simulation_impl::restart(Config* cfg)
ser& endSimCycle;
ser& output_directory;
printf("outdir: %s\n", output_directory.c_str());
ser& timeLord;
// Actions that may also be in TV
ser& m_exit;
printf("here3.1, %s\n", m_exit->toString().c_str());
Expand Down Expand Up @@ -1496,6 +1499,9 @@ Simulation_impl::restart(Config* cfg)
compInfoMap.insert(compInfo);
}

/* Fix-up TimeLord */
timeLord.init(timeLord.timeBaseString);

fs.close();
delete [] buffer;

Expand Down
8 changes: 8 additions & 0 deletions src/sst/core/timeLord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ TimeLord::getSimCycles(const std::string& ts, const std::string& UNUSED(where))
return parseCache[ts]->getFactor();
}

void
TimeLord::serialize_order(SST::Core::Serialization::serializer& ser)
{
ser& timeBaseString;
ser& timeBase;
ser& tcMap;
}

UnitAlgebra
TimeConverter::getPeriod() const
{
Expand Down
6 changes: 4 additions & 2 deletions src/sst/core/timeLord.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UnitAlgebra;
/**
Class for creating and managing TimeConverter objects
*/
class TimeLord
class TimeLord : public SST::Core::Serialization::serializable
{
typedef std::map<SimTime_t, TimeConverter*> TimeConverterMap_t;
typedef std::map<std::string, TimeConverter*> StringToTCMap_t;
Expand Down Expand Up @@ -76,7 +76,9 @@ class TimeLord
*/
SimTime_t getSimCycles(const std::string& timeString, const std::string& where);


void serialize_order(SST::Core::Serialization::serializer& ser) override;
ImplementSerializable(SST::TimeLord)

private:
friend class SST::Simulation;
friend class SST::Simulation_impl;
Expand Down

0 comments on commit 771c035

Please sign in to comment.