Skip to content

Commit

Permalink
Removed deprecated Simulation class from the public API.
Browse files Browse the repository at this point in the history
  • Loading branch information
feldergast committed May 11, 2024
1 parent b98e4c7 commit 1f707b9
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 151 deletions.
1 change: 0 additions & 1 deletion src/sst/core/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ nobase_dist_sst_HEADERS = \
profile/syncProfileTool.h \
profile/componentProfileTool.h \
rankInfo.h \
simulation.h \
sparseVectorMap.h \
sst_types.h \
sstpart.h \
Expand Down
6 changes: 0 additions & 6 deletions src/sst/core/baseComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -625,12 +625,6 @@ BaseComponent::doesSubComponentExist(const std::string& type)
return Factory::getFactory()->doesSubComponentExist(type);
}

Simulation*
BaseComponent::getSimulation() const
{
return sim_;
}

uint8_t
BaseComponent::getComponentInfoStatisticEnableLevel(const std::string& statisticName) const
{
Expand Down
8 changes: 0 additions & 8 deletions src/sst/core/baseComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -866,14 +866,6 @@ class BaseComponent : public SST::Core::Serialization::serializable

bool doesSubComponentExist(const std::string& type);

/* Get the Simulation */
#if !SST_BUILDING_CORE
[[deprecated("getSimulation is deprecated because the Simulation object is being removed as part of the public API "
"and simulation.h will be removed in SST 14")]]
#endif
Simulation*
getSimulation() const;

// Does the statisticName exist in the ElementInfoStatistic
bool doesComponentInfoStatisticExist(const std::string& statisticName) const;
// Return the EnableLevel for the statisticName from the ElementInfoStatistic
Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/component.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ Component::registerAsPrimaryComponent()
void
Component::primaryComponentDoNotEndSim()
{
int thread = getSimulation()->getRank().thread;
int thread = Simulation_impl::getSimulation()->getRank().thread;
Simulation_impl::getSimulation()->getExit()->refInc(getId(), thread);
}

void
Component::primaryComponentOKToEndSim()
{
int thread = getSimulation()->getRank().thread;
int thread = Simulation_impl::getSimulation()->getRank().thread;
Simulation_impl::getSimulation()->getExit()->refDec(getId(), thread);
}

Expand Down
4 changes: 2 additions & 2 deletions src/sst/core/link.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ Link::recv()
CALL_INFO, 1, "Cannot call recv on a Link with an event handler installed (non-polling link.\n");
}

Event* event = nullptr;
Simulation* simulation = Simulation_impl::getSimulation();
Event* event = nullptr;
Simulation_impl* simulation = Simulation_impl::getSimulation();

if ( !pair_link->send_queue->empty() ) {
Activity* activity = pair_link->send_queue->front();
Expand Down
1 change: 0 additions & 1 deletion src/sst/core/simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ Simulation_impl::shutdown()
}

Simulation_impl::Simulation_impl(Config* cfg, RankInfo my_rank, RankInfo num_ranks) :
Simulation(),
timeVortex(nullptr),
interThreadMinLatency(MAX_SIMTIME_T),
endSim(false),
Expand Down
115 changes: 0 additions & 115 deletions src/sst/core/simulation.h

This file was deleted.

31 changes: 15 additions & 16 deletions src/sst/core/simulation_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "sst/core/output.h"
#include "sst/core/profile/profiletool.h"
#include "sst/core/rankInfo.h"
#include "sst/core/simulation.h"
#include "sst/core/sst_types.h"
#include "sst/core/statapi/statengine.h"
#include "sst/core/unitAlgebra.h"
Expand Down Expand Up @@ -68,55 +67,55 @@ class StatisticProcessingEngine;
* Main control class for a SST Simulation.
* Provides base features for managing the simulation
*/
class Simulation_impl : public Simulation
class Simulation_impl
{

public:
/******** Public API inherited from Simulation ********/
/** Get the run mode of the simulation (e.g. init, run, both etc) */
SimulationRunMode getSimulationMode() const override { return runMode; };
SimulationRunMode getSimulationMode() const { return runMode; };

/** Return the current simulation time as a cycle count*/
SimTime_t getCurrentSimCycle() const override;
SimTime_t getCurrentSimCycle() const;

/** Return the end simulation time as a cycle count*/
SimTime_t getEndSimCycle() const override;
SimTime_t getEndSimCycle() const;

/** Return the current priority */
int getCurrentPriority() const override;
int getCurrentPriority() const;

/** Return the elapsed simulation time as a time */
UnitAlgebra getElapsedSimTime() const override;
UnitAlgebra getElapsedSimTime() const;

/** Return the end simulation time as a time */
UnitAlgebra getEndSimTime() const override;
UnitAlgebra getEndSimTime() const;

/** Get this instance's parallel rank */
RankInfo getRank() const override { return my_rank; }
RankInfo getRank() const { return my_rank; }

/** Get the number of parallel ranks in the simulation */
RankInfo getNumRanks() const override { return num_ranks; }
RankInfo getNumRanks() const { return num_ranks; }

/**
Returns the output directory of the simulation
@return Directory in which simulation outputs are placed
*/
std::string& getOutputDirectory() override { return output_directory; }
std::string& getOutputDirectory() { return output_directory; }

/** Signifies that a library is required for this simulation.
* @param name Name of the library
*/
virtual void requireLibrary(const std::string& name) override;
void requireLibrary(const std::string& name);

/** Causes the current status of the simulation to be printed to stderr.
* @param fullStatus - if true, call printStatus() on all components as well
* as print the base Simulation's status
*/
virtual void printStatus(bool fullStatus) override;
void printStatus(bool fullStatus);

virtual double getRunPhaseElapsedRealTime() const override;
virtual double getInitPhaseElapsedRealTime() const override;
virtual double getCompletePhaseElapsedRealTime() const override;
double getRunPhaseElapsedRealTime() const;
double getInitPhaseElapsedRealTime() const;
double getCompletePhaseElapsedRealTime() const;

/******** End Public API from Simulation ********/

Expand Down

0 comments on commit 1f707b9

Please sign in to comment.