Tutorial: end-to-end run and artifacts¶
This tutorial connects configure → run → files you can inspect. Prerequisites: a working OpenPFC build per INSTALL.md (MPI, HeFFTe, modules as needed).
1. Build the project¶
From the repository root:
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
cmake --build build -j"$(nproc)"
Ensure examples and apps are enabled (defaults): OpenPFC_BUILD_EXAMPLES=ON, OpenPFC_BUILD_APPS=ON. If you disabled them earlier, reconfigure with ON and rebuild.
Track A — PNG snapshots (2D Allen–Cahn, fastest visual)¶
Goal: two PNG files (initial and final field) without writing JSON.
From your build directory, use the same argument order as in
apps/allen_cahn/README.md(defaults and growth check evolve with the app — the stock example below matches the shipped README):cd build mkdir -p png_out mpirun -n 4 ./apps/allen_cahn/allen_cahn 128 128 5000 0.00009 8.0 0.19 10.0 \ png_out/initial.png png_out/final.png
Success:
mpirunexits with status 0. On rank 0 you should findpng_out/initial.pngandpng_out/final.png(grayscale, fixed [-1,1] scale — seeio_results.md). The app may exit non-zero if its internal growth check fails—reduce ranks or adjust parameters per the app README.Details: full CLI reference —
apps/allen_cahn/README.md.
Track B — Config-driven Tungsten + binary field dumps¶
Goal: run the Tungsten App with JSON and produce MPI-IO binary time slices under a directory you control.
The stock file apps/tungsten/inputs_json/tungsten_single_seed.json uses a small (32^3) domain but ships with absolute fields[].data paths. For a self-contained tutorial, copy it and point output at ./data/.
From
build/, create a writable config (example edits):cd build mkdir -p data cp ../apps/tungsten/inputs_json/tungsten_single_seed.json ./tutorial_tungsten.json
Edit
tutorial_tungsten.json:Set each
fields[]entry’s"data"to a path under your build tree, e.g."./data/psi_%d.bin"and"./data/psimf_%d.bin"(same pattern the stock file uses for the two fields).Keep
"saveat"> 0 intimesteppingso writers run (the sample uses"saveat": 1.0).
Run (CPU binary):
mpirun -n 4 ./apps/tungsten/tungsten ./tutorial_tungsten.json
Success: exit code 0; rank 0 logs progress. Artifacts: binary files under
./data/whose names match yourdatatemplates (frame index in place of%d). On-disk layout:binary_field_io_spec.md; overview:io_results.md.Visualization: VTK/ParaView from the default JSON path is not automatic — the stock wiring registers binary writers. For VTK, attach
VTKWriterin code (seeio_results.mdandexamples/11_write_results.cpp). For large campaigns, binary + postprocessing is typical.
What to read next¶
Goal |
Document |
|---|---|
Full app comparison (JSON vs CLI, GPU) |
|
JSON → |
|
Example executables by topic |
|
Figures and which runnable produced them |