Skip to content

Conversation

@gridley
Copy link
Contributor

@gridley gridley commented Oct 5, 2022

Allows some printing of basic build options. This way, people wouldn't have to test with a libmesh input or similar to find out if their installation supports that feature. Personally I would have found this convenient when doing an install through spack. This would also likely be useful when helping users debug their inputs.

This functionality could be expanded a little bit further. One option is to add the date (as python shows when ran in REPL mode), but that makes it so that two binaries compiled with identical options/compiler are not the same. This seemed like it wouldn't be worth it as there's probably some value to having a perfectly reproducible compile.

Another aspect is that we have both a short form and long form of command line arguments, but this seems it would be so infrequently used that it almost doesn't deserve a shortcut like -b. Maybe just --build-info would be OK, but it would stick out like a sore thumb.

Example:

gpad% openmc -h
Usage: openmc [options] [directory]

Options:
  -c, --volume           Run in stochastic volume calculation mode
  -g, --geometry-debug   Run with geometry debugging on
  -n, --particles        Number of particles per generation
  -p, --plot             Run in plotting mode
  -r, --restart          Restart a previous run from a state point
                         or a particle restart file
  -s, --threads          Number of OpenMP threads
  -t, --track            Write tracks for all particles (up to max_tracks)
  -e, --event            Run using event-based parallelism
  -v, --version          Show version information
  -b, --build-info       Show compile options
  -h, --help             Show this message

gpad% openmc -b
Build type:            RelWithDebInfo
Compiler ID:           GNU 12.1.0
MPI enabled:           no
Parallel HDF5 enabled: no
PNG support:           yes
DAGMC support:         no
libMesh support:       no
Coverage testing:      no
Profiling flags:       no

Thoughts?

@shimwell
Copy link
Member

shimwell commented Oct 7, 2022

This looks super useful to me. Just wondering if we need those if statements. Are there any disadvantages to having this profle building always enabled

@gridley
Copy link
Contributor Author

gridley commented Oct 7, 2022

This looks super useful to me. Just wondering if we need those if statements. Are there any disadvantages to having this profle building always enabled

Which if statements? Also, the compiler could optimize a little more without profiling enabled, but I am completely speculating on that.

@shimwell
Copy link
Member

shimwell commented Oct 7, 2022

Ah sorry, I thought there were some if statement that made this build info optional, but looking again I can see that I misread it. This looks like a very welcome addition to me.

@gridley
Copy link
Contributor Author

gridley commented Oct 13, 2022

@paulromano @jtramm just would like another opinion here. Do you think this is useful and not bloat code? I don't want to drop stuff in just because I like it. (worth asking after I typedef'd every vector in openmc and have yet to make any PRs that use it lol)

Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

I agree this is a very useful addition — thanks @gridley! In fact, I almost wonder whether we should show this information by default when a user runs OpenMC (right after we print version and git SHA1). It may make it easier for us to diagnose problems from users if we can see information on their build setup.

@gridley
Copy link
Contributor Author

gridley commented Oct 20, 2022

OK guys, the comments you made should be incorporated. Output now looks like this:

gpad% openmc -v
OpenMC version 0.14.0
Git SHA1: 9a86c9c065e545a7ece086c34dc7dca38cfa9892
Copyright (c) 2011-2022 MIT, UChicago Argonne LLC, and contributors
MIT/X license at <https://docs.openmc.org/en/latest/license.html>
Build type:            RelWithDebInfo
Compiler ID:           GNU 12.1.0
MPI enabled:           no
Parallel HDF5 enabled: no
PNG support:           yes
DAGMC support:         no
libMesh support:       no
Coverage testing:      no
Profiling flags:       no

Any further feedback?

@gridley
Copy link
Contributor Author

gridley commented Oct 20, 2022

No clue what's up with CI. Does that look like something that's my fault?

@shimwell
Copy link
Member

Originally it looks like one CI job failed due to not being able to download the nuclear date, I've rerun that job and it passed. So I've now rerun the other jobs as well.

@paulromano paulromano merged commit dc0731c into openmc-dev:develop Oct 21, 2022
@shimwell
Copy link
Member

Thanks both, much appreciated feature and squeezing it in

paulromano added a commit to paulromano/openmc that referenced this pull request Oct 21, 2022
@gridley gridley deleted the buildinfo branch July 10, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants