Skip to content

Commit

Permalink
Allow writing distributed checkpoint using --mesh-only closes idahola…
Browse files Browse the repository at this point in the history
  • Loading branch information
friedmud committed Nov 6, 2019
1 parent 00e1aef commit 66c3ae7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/doc/content/syntax/Mesh/index.md
Expand Up @@ -60,6 +60,9 @@ Here are a couple of examples showing the usage of `--mesh-only`:
# Will do the same but write out mesh_file.e
./myapp-opt -i input_file.i --mesh-only mesh_file.e
# Run in parallel and write out parllel checkpoint format (which can be read as a split)
mpiexec -n 3 ./myapp-opt -i input_file.i Mesh/parallel_type=distributed --mesh-only mesh_file.cpr
```

## Named Entity Support
Expand Down
12 changes: 12 additions & 0 deletions framework/src/actions/MeshOnlyAction.C
Expand Up @@ -13,6 +13,7 @@
#include "MooseMesh.h"
#include "Exodus.h"
#include "libmesh/exodusII_io.h"
#include "libmesh/checkpoint_io.h"

registerMooseAction("MooseApp", MeshOnlyAction, "mesh_only");

Expand Down Expand Up @@ -70,6 +71,17 @@ MeshOnlyAction::act()

exio.write(mesh_file);
}
else if (mesh_file.find(".cpr") + 4 == mesh_file.size())
{
TimedPrint tp(std ::cout,
std::chrono::duration<double>(0.),
std::chrono::duration<double>(1.),
"Writing checkpoint");

CheckpointIO io(mesh_ptr->getMesh(), true);

io.write(mesh_file);
}
else
{
// Just write the file using the name requested by the user.
Expand Down
13 changes: 13 additions & 0 deletions test/tests/mesh/mesh_only/tests
Expand Up @@ -44,4 +44,17 @@
issues = '#12757'
requirement = 'The system shall support overriding output dimension when necessary to store coordinates in higher planes'
[../]

[./mesh_only_checkpoint]
type = 'CheckFiles'
input = 'mesh_only.i'
cli_args = 'Mesh/parallel_type=distributed --mesh-only 3d_chimney.cpr'
check_files = '3d_chimney.cpr/3/split-3-0.cpr 3d_chimney.cpr/3/split-3-1.cpr 3d_chimney.cpr/3/split-3-2.cpr'
min_parallel = 3
max_parallel = 3
recover = false
method = '!dbg'
issues = '#14312'
requirement = 'The system shall support writing parallel checkpoint files with --mesh-only'
[../]
[]

0 comments on commit 66c3ae7

Please sign in to comment.