Skip to content

Commit

Permalink
BugFix: CUDASimulation nolonger reports telemetry when an submodel
Browse files Browse the repository at this point in the history
Closes #1079
  • Loading branch information
Robadob committed Jul 10, 2023
1 parent 193fd83 commit 1f65237
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions include/flamegpu/simulation/CUDASimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class CUDASimulation : public Simulation {
bool inLayerConcurrency = true;

private:
/**
* Internal property set by Submodels to adjust some features required by submodels
*/
bool is_submodel = false;
/**
* Internal property set by SimRunner to adjust some features required for ensemble performance
*/
Expand Down
10 changes: 5 additions & 5 deletions src/flamegpu/simulation/CUDASimulation.cu
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ CUDASimulation::CUDASimulation(const std::shared_ptr<SubModelData> &submodel_des
// Submodels all run quiet/not verbose by default
SimulationConfig().verbosity = Verbosity::Default;
SimulationConfig().steps = submodel_desc->max_steps;
CUDAConfig().is_ensemble = true;
CUDAConfig().is_submodel = true;

// Determine which agents will be spatially sorted
this->determineAgentsToSort();
Expand Down Expand Up @@ -533,7 +533,7 @@ bool CUDASimulation::step() {
initialiseSingletons();

// Time the individual step, using a CUDAEventTimer if possible, else a steadyClockTimer.
std::unique_ptr<detail::Timer> stepTimer = getDriverAppropriateTimer(getCUDAConfig().is_ensemble);
std::unique_ptr<detail::Timer> stepTimer = getDriverAppropriateTimer(getCUDAConfig().is_ensemble || getCUDAConfig().is_submodel);
stepTimer->start();

// Init any unset agent IDs
Expand Down Expand Up @@ -1172,7 +1172,7 @@ void CUDASimulation::simulate() {
initialiseSingletons();

// Create the event timing object, using an appropriate timer implementation.
std::unique_ptr<detail::Timer> simulationTimer = getDriverAppropriateTimer(getCUDAConfig().is_ensemble);
std::unique_ptr<detail::Timer> simulationTimer = getDriverAppropriateTimer(getCUDAConfig().is_ensemble || getCUDAConfig().is_submodel);
simulationTimer->start();

// Create as many streams as required
Expand Down Expand Up @@ -1250,8 +1250,8 @@ void CUDASimulation::simulate() {
}
processExitLog();

// Send Telemetry
if (getSimulationConfig().telemetry) {
// Send Telemetry if not submodel
if (getSimulationConfig().telemetry && !getCUDAConfig().is_submodel) {
// Generate some payload items
std::map<std::string, std::string> payload_items;
payload_items["GPUDevices"] = flamegpu::detail::compute_capability::getDeviceName(deviceInitialised);
Expand Down

0 comments on commit 1f65237

Please sign in to comment.