forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automatic checkpoints triggered by SIGUSR1 being sent to process …
- Loading branch information
1 parent
53e902a
commit 75370c6
Showing
13 changed files
with
417 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "Action.h" | ||
|
||
class AutoCheckpointAction : public Action | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
AutoCheckpointAction(const InputParameters & params); | ||
|
||
virtual void act() override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "AutoCheckpointAction.h" | ||
#include "FEProblem.h" | ||
#include "Checkpoint.h" | ||
registerMooseAction("MooseApp", AutoCheckpointAction, "auto_checkpoint_action"); | ||
|
||
InputParameters | ||
AutoCheckpointAction::validParams() | ||
{ | ||
InputParameters params = Action::validParams(); | ||
|
||
return params; | ||
} | ||
|
||
AutoCheckpointAction::AutoCheckpointAction(const InputParameters & params) : Action(params) {} | ||
|
||
void | ||
AutoCheckpointAction::act() | ||
{ | ||
if (_app.isUltimateMaster()) | ||
{ | ||
if (!_app.getOutputWarehouse().getOutputs<Checkpoint>().empty()) | ||
// if there's already a checkpoint object, we don't need to worry about creating a new | ||
// checkpoint | ||
return; | ||
|
||
auto cp_params = _factory.getValidParams("Checkpoint"); | ||
cp_params.setParameters("should_output", false); | ||
cp_params.setParameters("is_autosave", true); | ||
_problem->addOutput("Checkpoint", "autosave", cp_params); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.