Skip to content

Commit

Permalink
fix #7449 reset jobRunMode if not present in application (#7451)
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep authored Feb 13, 2025
1 parent c35b955 commit 96aceec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sirepo/job_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ async def api_sbatchLogin(self):

@sirepo.quest.Spec("require_plan")
async def api_sbatchLoginStatus(self):
if sirepo.job.SBATCH not in simulation_db.JOB_RUN_MODE_MAP:
raise AssertionError(f"{sirepo.job.SBATCH} jobRunMode is not enabled")
return await self._request_api(
_request_content=self._request_content(
PKDict(computeJobHash="unused", jobRunMode=sirepo.job.SBATCH),
Expand Down
6 changes: 6 additions & 0 deletions sirepo/package_data/static/js/sirepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3927,6 +3927,12 @@ SIREPO.app.factory('persistentSimulation', function(simulationQueue, appState, a
};

state.resetSimulation = function() {
// ensure the selected jobRunMode is present
const m = appState.models[state.model];
if (m && m.jobRunMode && ! (m.jobRunMode in authState.jobRunModeMap)) {
m.jobRunMode = 'parallel';
appState.saveQuietly(state.model);
}
setSimulationStatus({state: 'missing'});
frameCache.setFrameCount(0);
appState.whenModelsLoaded(controller.simScope, runStatus);
Expand Down

0 comments on commit 96aceec

Please sign in to comment.