Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f9cdea6
add tomlplusplus submodule
AstroBarker Jun 19, 2025
612dbbd
Merge remote-tracking branch 'origin/jmm/next-output' into blb/toml
Jun 20, 2025
a0563cc
add queries record
jonahm-LANL Jun 30, 2025
28d0dda
Merge branch 'jmm/next-output' into jmm/docstrings
jonahm-LANL Jul 1, 2025
7c6b5b4
Replace parameters with TOML. Backward-compatible.
Jul 1, 2025
0db82f4
Change archive_parameters option to conform to real types
Jul 1, 2025
17a985e
Merge branch 'jmm/next-output' of github:parthenon-hpc-lab/parthenon …
Jul 1, 2025
f6ad86c
Merge branch 'develop' into blb/toml
Jul 1, 2025
3d4dc5b
Merge branch 'blb/toml' of github:parthenon-hpc-lab/parthenon into bl…
Jul 1, 2025
132f183
Add GetAllPaths to list out all leaf parameter paths, for iteration.
Jul 1, 2025
39089fb
Simplify, simplify parameters. No more origins table.
Jul 1, 2025
6dd8649
Remove more parameter debugging outputs.
Jul 1, 2025
15e6f87
intermediate commit
jonahm-LANL Jul 2, 2025
864f8e9
Merge branch 'jmm/next-output' into jmm/docstrings
jonahm-LANL Jul 3, 2025
a6c2dbf
merge in next_output branch
jonahm-LANL Jul 3, 2025
24b0719
Merge branch 'jmm/next-output' into jmm/docstrings
jonahm-LANL Jul 3, 2025
c1f2168
almost there...
jonahm-LANL Jul 3, 2025
7e837bd
Merge branch 'develop' into jmm/docstrings
jonahm-LANL Jul 7, 2025
19f380e
it works
jonahm-LANL Jul 7, 2025
e369e7f
add docstrings throughout
jonahm-LANL Jul 7, 2025
1230639
make regex machinery generate csv file
jonahm-LANL Jul 7, 2025
bf375c8
add rules in cmake to generate csv files for rst to slurp up
jonahm-LANL Jul 7, 2025
25ed9db
sphinx custom template so csv tables are word wrapped
jonahm-LANL Jul 7, 2025
b0964ef
page for parameters
jonahm-LANL Jul 7, 2025
7602e72
lets see if github workflow can do it
jonahm-LANL Jul 7, 2025
4398f7d
add some discussion
jonahm-LANL Jul 7, 2025
7086359
changelog
jonahm-LANL Jul 7, 2025
2b0b0a8
readme
jonahm-LANL Jul 7, 2025
4f06b22
need kokkos now in docs
jonahm-LANL Jul 7, 2025
92d5f62
python formatting
jonahm-LANL Jul 7, 2025
f904817
come on...
jonahm-LANL Jul 7, 2025
43e4fd3
I don't want tests
jonahm-LANL Jul 7, 2025
9f2eb8c
disable output for example
jonahm-LANL Jul 8, 2025
a09bce8
try this
jonahm-LANL Jul 8, 2025
62af088
add static methods for getting meshblock and mesh region sizes so tha…
jonahm-LANL Jul 8, 2025
98e99f2
generated files are now stored in git since they could vary between b…
jonahm-LANL Jul 8, 2025
dea09de
no ifdef around registerloadbalancing
jonahm-LANL Jul 8, 2025
d9569d0
parameters always in lexicographic order
jonahm-LANL Jul 8, 2025
b79e41a
Merge develop into TOML parameters
Jul 8, 2025
bd52ed7
Fix some parameter parsing and a block iteration to pass tests w/TOML
Jul 8, 2025
d570058
stupid statefulness
jonahm-LANL Jul 8, 2025
efb065e
Check for the special case of Set called before GetOrAdd so we don't …
jonahm-LANL Jul 8, 2025
ecf869b
update cmake
jonahm-LANL Jul 8, 2025
3512b7f
Update src/parameter_input.cpp
Yurlungur Jul 8, 2025
3d71dcd
Most of luke and ben's comments
jonahm-LANL Jul 9, 2025
469903a
Merge branch 'jmm/docstrings' of github.com:parthenon-hpc-lab/parthen…
jonahm-LANL Jul 9, 2025
44559a5
Made the param output itself a param as suggested by luke. Fixed bug …
jonahm-LANL Jul 9, 2025
5bbc09c
Add ParameterRef
jonahm-LANL Jul 9, 2025
38fc240
changelog
jonahm-LANL Jul 9, 2025
2e7bed7
Merge pull request #1286 from parthenon-hpc-lab/jmm/docstrings-2-bloc…
Yurlungur Jul 9, 2025
13cbae6
Revert "Add ParameterRef"
Yurlungur Jul 9, 2025
7e775b8
Merge pull request #1287 from parthenon-hpc-lab/revert-1286-jmm/docst…
Yurlungur Jul 9, 2025
8e0a2e7
Merge (heavy airquotes) branch 'jmm/docstrings' of github:parthenon-h…
Jul 9, 2025
bb93a3c
Merge branch 'develop' into jmm/docstrings
Yurlungur Jul 9, 2025
b86fe1e
add csv comment
jonahm-LANL Jul 9, 2025
eea42fb
Merge branch 'develop' into jmm/docstrings-2-blockref-boogaloo
jonahm-LANL Jul 9, 2025
6c229da
Merge branch 'jmm/docstrings-2-blockref-boogaloo' into jmm/docstrings
jonahm-LANL Jul 9, 2025
4bd0383
ParamRef in a single commit
jonahm-LANL Jul 9, 2025
c93ab26
Pass (heavy airquotes) the tests. docstring error conditions and Chec…
Jul 9, 2025
aff47d9
merge in latest changes from docstring MR
jonahm-LANL Jul 10, 2025
f5ebe91
tests pass now
jonahm-LANL Jul 11, 2025
07c7809
comment out checkrequired and checkdesired
jonahm-LANL Jul 11, 2025
9d3c0da
Merge branch 'develop' into blb/toml
jonahm-LANL Jul 11, 2025
5099ff1
tables build
jonahm-LANL Jul 11, 2025
edc9ead
don't need ostream overload
jonahm-LANL Jul 11, 2025
c63f97a
provenance works
jonahm-LANL Jul 11, 2025
b169872
oops hide the warning
jonahm-LANL Jul 11, 2025
a7ac214
Merge branch 'develop' into blb/toml
Yurlungur Jul 11, 2025
eb0ddef
stash raw input strings...
jonahm-LANL Jul 11, 2025
73ee2ea
Merge branch 'blb/toml' of github.com:parthenon-hpc-lab/parthenon int…
jonahm-LANL Jul 11, 2025
925d529
moved parameter input and argument parser into their own folder. Adde…
jonahm-LANL Jul 11, 2025
e125829
remove unneeded toml table in parser
jonahm-LANL Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,40 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'true'
- name: Set system to non-interactive mode
run: export DEBIAN_FRONTEND=noninteractive
- name: install dependencies
run: |
pip install sphinx
pip install sphinx-rtd-theme
pip install sphinx-multiversion
sudo apt install -y --force-yes -qq build-essential cmake
- name: generate csv files
run: |
echo "Repo = ${GITHUB_REPOSITORY}"
mkdir -p build && cd build
cmake -DPARTHENON_DISABLE_HDF5=ON \
-DPARTHENON_DISABLE_MPI=ON \
-DREGRESSION_GOLD_STANDARD_SYNC=OFF \
-DBUILD_TESTING=OFF \
..
make -j4
make param-docs
cd ..
- name: Check generated files for this branch are up to date
run: |
if git diff --exit-code -- doc/sphinx/src/generated/; then
echo "Generated doc files up to date."
else
echo "Generated doc files not up to date. Run make param-docs and commit changes."
exit 1
fi
- name: Get all git references, needed for sphinx multiversion
run: |
git fetch --prune --unshallow --tags
git branch -a
git tag --list
- name: build docs
run: |
echo "Repo = ${GITHUB_REPOSITORY}"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "external/kokkos"]
path = external/Kokkos
url = https://github.com/kokkos/kokkos.git
[submodule "external/tomlplusplus"]
path = external/tomlplusplus
url = https://github.com/marzer/tomlplusplus.git
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Current develop

### Added (new features/APIs/variables/...)
- [[PR 1283]](https://github.com/parthenon-hpc-lab/parthenon/pull/1283) Ability to automatically document ParameterInputs
- [[PR 1258]](https://github.com/parthenon-hpc-lab/parthenon/pull/1258) Add "corehdf" version of hdf5 output that dumps everything
- [[PR 1162]](https://github.com/parthenon-hpc-lab/parthenon/pull/1162) Add dev container (e.g., GitHub Codepsacer or VSCode)

Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ if (NOT TARGET Kokkos::kokkos)
endif()
endif()
endif()
include_directories("external/tomlplusplus")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the preferred way to do it? Not add_subdirectory? How does this work for installing parthenon as a library?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's header only, so I assumed this was how to do it. But there are a ton of installation methods on the website, maybe another works better? Didn't really think about this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do add_subdirectory and then add TOML as a CMake target, the same way we add Kokkos. That should automatically thread it through all of the nonsense CMake might rely on.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The website doesn't explicitly call that approach out, but I see the cmake supports it. There's checks about whether or not the project is "top level."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I tried messing with this a bit and it doesn't seem like TOML++'s build system supports this. So we should leave it for now and I'll submit an issue.


# After we have imported Kokkos we can now report/check our config as Kokkos_ENABLE_XXX
# is also availalbe when imported.
Expand Down Expand Up @@ -389,6 +390,7 @@ if (PARTHENON_ENABLE_UNIT_TESTS OR PARTHENON_ENABLE_INTEGRATION_TESTS OR PARTHEN
add_subdirectory(tst)
endif()


if (PARTHENON_ENABLE_ASCENT)
if (PARTHENON_USE_SYSTEM_PACKAGES)
find_package(Ascent REQUIRED)
Expand All @@ -401,6 +403,9 @@ endif()
include(GNUInstallDirs)
set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/parthenon")

set(DOC_GEN_PATH "${CMAKE_SOURCE_DIR}/doc/sphinx/src/generated" CACHE STRING
"Path to save generated data for docs.")

add_subdirectory(src)
add_subdirectory(example)
add_subdirectory(benchmarks)
Expand All @@ -410,6 +415,13 @@ include(cmake/CheckCopyright.cmake)

configure_file("${PROJECT_SOURCE_DIR}/cmake/parthenonConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/parthenonConfig.cmake" @ONLY)

if (NOT PARTHENON_DISABLE_EXAMPLES)
add_custom_target(param-docs
DEPENDS
burgers-csv
diffusion-csv)
endif()

# Currently Ctest/Cmake doesn't ensure that tests are not stale
# before running them.
#
Expand Down
17 changes: 17 additions & 0 deletions benchmarks/burgers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,21 @@ if( "burgers-benchmark" IN_LIST DRIVER_LIST OR NOT PARTHENON_DISABLE_EXAMPLES)
)
target_link_libraries(burgers-benchmark PRIVATE Parthenon::parthenon)
lint_target(burgers-benchmark)

# JMM: Only run burgers in 2D so startup time is reasonable because
# -p flag goes through pgen
add_custom_command(
OUTPUT ${DOC_GEN_PATH}/burgers-table.csv
COMMAND ${CMAKE_COMMAND} -E env
bash -c
"${CMAKE_CURRENT_BINARY_DIR}/burgers-benchmark -i ${CMAKE_CURRENT_LIST_DIR}/burgers.pin parthenon/mesh/nx3=1 parthenon/meshblock/nx3=1 -p '^(?!.*parthenon/).*' > ${DOC_GEN_PATH}/burgers-table.csv"
DEPENDS burgers-benchmark burgers.pin
VERBATIM
)

add_custom_target(burgers-csv
DEPENDS
${DOC_GEN_PATH}/burgers-table.csv
)

endif()
18 changes: 18 additions & 0 deletions doc/sphinx/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Enable word wrap in table cells */
/* JMM: This is preferable IMO but it messed up the word wrapping for
* our hand-written tables, so I removed it and enabled wrapping only
* for csv-imported tables
/*
.rst-content table.docutils td {
white-space: normal !important;
word-wrap: break-word;
word-break: break-word;
}
*/
/* Only apply word wrapping to CSV-imported tables with .csv-wrap class */
.rst-content table.csv-wrap td {
white-space: normal !important;
word-wrap: break-word;
word-break: break-word;
}

5 changes: 5 additions & 0 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]


def setup(app):
app.add_css_file("custom.css") # Sphinx >= 1.8


# configuration for sphinx_multiversion
smv_remote_whitelist = r"^(origin)$"
48 changes: 48 additions & 0 deletions doc/sphinx/src/0_input_parameters_ref.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. _inputref:

Input Parameters Reference
===========================

This reference is automatically generated with Parthenon's
``ParameterInput`` class. To generate it, pass the ``-p`` flag into a
parthenon-based executable (in addition to the other flags you would
normally pass), and optionally a ``regex`` to specify which blocks
you'd like to output. Parthenon will print a valid CSV file to the
terminal.

Every call to ``ParameterInput::Get*`` optionally takes a "docustring"
as a final argument, which is the details column listed here. Default
values are recorded if they are available.

In Parthenon
--------------

An incomplete list of all input parameters provided by Parthenon is tabulated below

.. csv-table:: Parthenon input parameters
:file: generated/diffusion-parth-table.csv
:header-rows: 1
:widths: 20 20 10 20 30
:class: csv-wrap

In the diffusion example
----------------------------

The non-parthenon input parameters used in the diffusion example are tabulated below

.. csv-table:: Parthenon input parameters
:file: generated/diffusion-table.csv
:header-rows: 1
:widths: 20 20 10 20 30
:class: csv-wrap

In the Burgers benchmark, Parthenon-VIBE
------------------------------------------

The non-parthenon input parameters used in Parthenon-VIBE are tabulated below

.. csv-table:: Parthenon input parameters
:file: generated/burgers-table.csv
:header-rows: 1
:widths: 20 20 10 20 30
:class: csv-wrap
100 changes: 100 additions & 0 deletions doc/sphinx/src/generated/burgers-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
block,parameters,type,default,description
"burgers","cfl","Real","0.8",""
"burgers","kx_fact","Real","1",""
"burgers","ky_fact","Real","1",""
"burgers","kz_fact","Real","1",""
"burgers","num_scalars","int","1",""
"burgers","recon","string","weno5",""
"","","","",""
"parthenon.job","output_params_and_exit","bool","0","output a description of all input parameters accessed and quit"
"parthenon.job","output_params_block_regex","string","(.*)","when outputting input parameters, this selects which input blocks to output; all are output by default"
"parthenon.job","problem_id","string","parthenon","prefix for output files"
"parthenon.job","run_only_analysis","bool","",""
"","","","",""
"parthenon.loadbalancing","balancer","string","default","load balancing strategy; Allowed values: automatic, default, manual"
"parthenon.loadbalancing","interval","int","10","how frequently load balancing is performed if the mesh does not change"
"parthenon.loadbalancing","tolerance","Real","0.5","load balancer tolerance"
"","","","",""
"parthenon.mesh","derefine_count","int","10","number of iterations a block must request derefinement before it is derefined"
"parthenon.mesh","ix1_bc","string","outflow","global mesh boundary condition on inner X1 face"
"parthenon.mesh","ix2_bc","string","outflow","global mesh boundary condition on inner X2 face"
"parthenon.mesh","ix3_bc","string","outflow","global mesh boundary condition on inner X3 face"
"parthenon.mesh","multigrid","bool","0","enable a multigrid mesh"
"parthenon.mesh","nghost","int","2","number of ghost zones on a block"
"parthenon.mesh","num_threads","int","1","number of host threads for infrastructure; unused"
"parthenon.mesh","numlevel","int","1","maximum level of refinement globally"
"parthenon.mesh","nx1","int","","number of cells on base mesh in x1 direction"
"parthenon.mesh","nx2","int","","number of cells on base mesh in x2 direction"
"parthenon.mesh","nx3","int","","number of cells on base mesh in x3 direction"
"parthenon.mesh","ox1_bc","string","outflow","global mesh boundary condition on outer X1 face"
"parthenon.mesh","ox2_bc","string","outflow","global mesh boundary condition on outer X2 face"
"parthenon.mesh","ox3_bc","string","outflow","global mesh boundary condition on outer X3 face"
"parthenon.mesh","packs_per_rank","int","1","number of meshblockpacks per rank, overrides pack_size"
"parthenon.mesh","refinement","string","none","mesh refinement mode; Allowed values: adaptive, none, static"
"parthenon.mesh","refinement_in_one_min_nbufs","int","64",""
"parthenon.mesh","x1max","Real","","maximum x1 value of domain"
"parthenon.mesh","x1min","Real","","minimum x1 value of domain"
"parthenon.mesh","x1rat","Real","1","unused"
"parthenon.mesh","x2max","Real","","maximum x2 value of domain"
"parthenon.mesh","x2min","Real","","minimum x2 value of domain"
"parthenon.mesh","x2rat","Real","1","unused"
"parthenon.mesh","x3max","Real","","maximum x3 value of domain"
"parthenon.mesh","x3min","Real","","minimum x3 value of domain"
"parthenon.mesh","x3rat","Real","1","unused"
"","","","",""
"parthenon.meshblock","nx1","int","parthenon.mesh.nx1","logical size of a meshblock; defaults to the base size of the mesh"
"parthenon.meshblock","nx2","int","parthenon.mesh.nx2","logical size of a meshblock; defaults to the base size of the mesh"
"parthenon.meshblock","nx3","int","parthenon.mesh.nx3","logical size of a meshblock; defaults to the base size of the mesh"
"","","","",""
"parthenon.output0","dn","int","-1","output cadence in cycles"
"parthenon.output0","dt","Real","0.4","output cadence in physical time"
"","","","",""
"parthenon.output1","analysis_output","bool","0",""
"parthenon.output1","data_format","string","%12.5e",""
"parthenon.output1","dn","int","-1","output cadence in cycles"
"parthenon.output1","dt","Real","0.4","output cadence in physical time"
"parthenon.output1","file_number_width","int","5",""
"parthenon.output1","file_type","string","","output type"
"parthenon.output1","ghost_zones","bool","0","whether or not ghost zones are output"
"parthenon.output1","id","string","out1",""
"parthenon.output1","use_final_label","bool","1","final output will use the word final instead of a number for its index"
"","","","",""
"parthenon.refinement0","derefine_tol","Real","0.05","magnitude that triggers de-refinement"
"parthenon.refinement0","field","string","NO FIELD WAS SET","Field to refine on"
"parthenon.refinement0","max_level","int","2","maximum level this refinement criterion will achieve"
"parthenon.refinement0","method","string","PLEASE SPECIFY method",""
"parthenon.refinement0","refine_tol","Real","0.5","magnitude that triggers refinement"
"parthenon.refinement0","vector_i","int","",""
"","","","",""
"parthenon.sparse","alloc_threshold","Real","1e-12",""
"parthenon.sparse","dealloc_count","int","5",""
"parthenon.sparse","dealloc_threshold","Real","1e-14",""
"parthenon.sparse","enable_sparse","bool","1",""
"","","","",""
"parthenon.swarm","ix1_bc","string","periodic","global particle boundary condition on inner X1 face"
"parthenon.swarm","ix2_bc","string","periodic","global particle boundary condition on inner X2 face"
"parthenon.swarm","ix3_bc","string","periodic","global particle boundary condition on inner X3 face"
"parthenon.swarm","ox1_bc","string","periodic","global particle boundary condition on outer X1 face"
"parthenon.swarm","ox2_bc","string","periodic","global particle boundary condition on outer X2 face"
"parthenon.swarm","ox3_bc","string","periodic","global particle boundary condition on outer X3 face"
"","","","",""
"parthenon.time","dt","Real","1.7976931e+308","initial value of time step before constraining via cfl"
"parthenon.time","dt_ceil","Real","1.7976931e+308","maximum allowed timestep"
"parthenon.time","dt_factor","Real","2","maximum relative change in dt per timestep"
"parthenon.time","dt_floor","Real","2.2250739e-308","minimum allowed timestep"
"parthenon.time","dt_force","Real","-1.7976931e+308","if set manually enforces this time step exactly"
"parthenon.time","dt_init","Real","1.7976931e+308","the first time step will be at least as small as dt_init"
"parthenon.time","dt_init_force","bool","0","if set to true, the first time step will be exactly dt_init"
"parthenon.time","dt_max","Real","1.7976931e+308","if timestep is above this level for dt_max_count_max iterations, parthenon throws an error"
"parthenon.time","dt_max_cycle_limit","int","1","number of cycles where dt > dt_max before error"
"parthenon.time","dt_min","Real","2.2250739e-308","if timestep falls below this level for dt_min_count_max iterations, parthenon throws an error"
"parthenon.time","dt_min_cycle_limit","int","10","number of cycles where dt < dt_min before error"
"parthenon.time","integrator","string","rk2",""
"parthenon.time","ncycle","int","0","initial iteration count"
"parthenon.time","ncycle_out","int","1","cadence of outputs to stdout"
"parthenon.time","ncycle_out_mesh","int","0","cadence of outputs describing mesh"
"parthenon.time","nlim","int","-1","maximum number of iterations, only limiting if non-negative"
"parthenon.time","perf_cycle_offset","int","0","don't measure performance for some number of initial cycles"
"parthenon.time","recv_bdry_buf_timeout_sec","Real","-1",""
"parthenon.time","start_time","Real","0","physical time at which to start the simulation"
"parthenon.time","tlim","Real","inf","physical time at which to end the simulation"
1 change: 1 addition & 0 deletions doc/sphinx/src/generated/diffusion-parth-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
block,parameters,type,default,description
Loading