Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,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 @@ -384,6 +385,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 Down
1 change: 1 addition & 0 deletions external/tomlplusplus
Submodule tomlplusplus added at 708fff
13 changes: 7 additions & 6 deletions src/driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ DriverStatus EvolutionDriver::Execute() {
}
} // END OF MAIN INTEGRATION LOOP
// ======================================================
} // Main t < tmax loop region
} // Main t < tmax loop region

if (pmesh->UserWorkAfterLoop != nullptr) {
pmesh->UserWorkAfterLoop(pmesh, pinput, tm);
Expand Down Expand Up @@ -270,12 +270,13 @@ void EvolutionDriver::SetGlobalTimeStep() {
}

void EvolutionDriver::DumpInputParameters() {
auto archive_settings =
pinput->GetOrAddString("parthenon/job", "archive_parameters", "false",
std::vector<std::string>{"true", "false", "timestamp"});
if (archive_settings != "false" && Globals::my_rank == 0) {
auto archive_parameters =
pinput->GetOrAddBoolean("parthenon/job", "archive_parameters", false);
auto archive_timestamp =
pinput->GetOrAddBoolean("parthenon/job", "archive_timestamp", false);
if (archive_parameters && Globals::my_rank == 0) {
std::ostringstream ss;
if (archive_settings == "timestamp") {
if (archive_timestamp) {
auto itt_now =
std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
ss << "parthinput.archive." << std::put_time(std::gmtime(&itt_now), "%FT%TZ");
Expand Down
42 changes: 17 additions & 25 deletions src/mesh/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,12 @@ Mesh::Mesh(ParameterInput *pin, ApplicationInput *app_in, Packages_t &packages,
adaptive(pin->GetOrAddString("parthenon/mesh", "refinement", "none") == "adaptive"
? true
: false),
multilevel(
(adaptive ||
pin->GetOrAddString("parthenon/mesh", "refinement", "none") == "static" ||
pin->GetOrAddString("parthenon/mesh", "multigrid", "false") == "true")
? true
: false),
multigrid(pin->GetOrAddString("parthenon/mesh", "multigrid", "false") == "true"
? true
: false),
Comment thread
Yurlungur marked this conversation as resolved.
Outdated
nbnew(), nbdel(), step_since_lb(), gflag(), packages(packages),
multilevel(adaptive ||
pin->GetOrAddString("parthenon/mesh", "refinement", "none") ==
"static" ||
pin->GetOrAddBoolean("parthenon/mesh", "multigrid", false)),
multigrid(pin->GetOrAddBoolean("parthenon/mesh", "multigrid", false)), nbnew(),
nbdel(), step_since_lb(), gflag(), packages(packages),
resolved_packages(ResolvePackages(packages)),
default_pack_size_(pin->GetOrAddInteger("parthenon/mesh", "pack_size", -1)),
// private members:
Expand Down Expand Up @@ -739,10 +735,6 @@ void Mesh::FillDerived() {
}
}

//----------------------------------------------------------------------------------------
// \!fn void Mesh::Initialize(bool init_problem, ParameterInput *pin)
// \brief initialization before the main loop

void Mesh::Initialize(bool init_problem, ParameterInput *pin, ApplicationInput *app_in) {
PARTHENON_INSTRUMENT
bool init_done = true;
Expand Down Expand Up @@ -1095,27 +1087,28 @@ void Mesh::DoStaticRefinement(ParameterInput *pin) {
return std::pair<int, int>{lxmin, lxmax};
};

InputBlock *pib = pin->pfirst_block;
while (pib != nullptr) {
if (pib->block_name.compare(0, 27, "parthenon/static_refinement") == 0) {
for (auto pib : pin->Blocks("parthenon")) {
std::string block_name = std::string(pib.first);
Comment on lines +1116 to +1117

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.

Just to confirm, you could have instead done a search for "parthenon/static_refinement" here right? You just chose to use the nested block structure?

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.

Actually, not really. Asking for Blocks("") would give you just "parthenon" and e.g. "problem" or whatever. If you need a multi-level recursive list you're encouraged into the visitor pattern.

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.

hmm I don't love that... oh well... price we pay maybe.

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.

Why is this a price? I thought separating Parthenon blocks was the whole reason for naming them all parthenon/ in the first place -- this just enforces that structure.
I can't think why anyone would name their blocks as if they had a structure, then want to iterate as if that structure weren't there, but if there's a use case it's definitely possible to emulate. Just didn't see it as useful.

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 just want the ability to loop over all blocks, which is something someone might want to do. But if you've added a visitor that visits everything, then it's a non-issue.

if (block_name.compare(0, 17, "static_refinement") == 0) {
RegionSize ref_size;
ref_size.xmin(X1DIR) = pin->GetReal(pib->block_name, "x1min");
ref_size.xmax(X1DIR) = pin->GetReal(pib->block_name, "x1max");
std::string block_path = "parthenon." + block_name;
ref_size.xmin(X1DIR) = pin->GetReal(block_path, "x1min");
ref_size.xmax(X1DIR) = pin->GetReal(block_path, "x1max");
if (ndim >= 2) {
ref_size.xmin(X2DIR) = pin->GetReal(pib->block_name, "x2min");
ref_size.xmax(X2DIR) = pin->GetReal(pib->block_name, "x2max");
ref_size.xmin(X2DIR) = pin->GetReal(block_path, "x2min");
ref_size.xmax(X2DIR) = pin->GetReal(block_path, "x2max");
} else {
ref_size.xmin(X2DIR) = mesh_size.xmin(X2DIR);
ref_size.xmax(X2DIR) = mesh_size.xmax(X2DIR);
}
if (ndim == 3) {
ref_size.xmin(X3DIR) = pin->GetReal(pib->block_name, "x3min");
ref_size.xmax(X3DIR) = pin->GetReal(pib->block_name, "x3max");
ref_size.xmin(X3DIR) = pin->GetReal(block_path, "x3min");
ref_size.xmax(X3DIR) = pin->GetReal(block_path, "x3max");
} else {
ref_size.xmin(X3DIR) = mesh_size.xmin(X3DIR);
ref_size.xmax(X3DIR) = mesh_size.xmax(X3DIR);
}
int ref_lev = pin->GetInteger(pib->block_name, "level");
int ref_lev = pin->GetInteger(block_path, "level");
int lrlev = ref_lev + GetLegacyTreeRootLevel();
// range check
if (ref_lev < 1) {
Expand Down Expand Up @@ -1167,7 +1160,6 @@ void Mesh::DoStaticRefinement(ParameterInput *pin) {
}
}
}
pib = pib->pnext;
}
}
// Return list of locations and levels for the legacy tree
Expand Down
12 changes: 6 additions & 6 deletions src/outputs/outputs_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin) {
std::vector<Real> last_times;
std::vector<int> last_ns;

// loop over input block names. Find those that start with "parthenon/output", read
// loop over input block names. Find those in the parthenon.output blocks, read
// parameters, and construct singly linked list of OutputTypes.
for (InputBlock *pib = pin->pfirst_block; pib != nullptr; pib = pib->pnext) {
if (pib->block_name.compare(0, 16, "parthenon/output") == 0) {
std::string outn = pib->block_name.substr(16); // 6 because counting starts at 0!
std::string block_name = pib->block_name;
for (auto pib : pin->Blocks("parthenon")) {
std::string block_name = std::string(pib.first);
if (block_name.compare(0, 6, "output") == 0) {
std::string outn = block_name.substr(6); // 6 because counting starts at 0!

if (pin->DoesParameterExist(block_name, "next_time")) {
std::stringstream msg;
Expand All @@ -68,7 +68,7 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin) {
}

// these are used for book-keeping
block_names.push_back(block_name);
block_names.push_back("parthenon." + block_name);
block_numbers.push_back(atoi(outn.c_str()));

// These will be updated later or restarted from
Expand Down
Loading