-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UUID for run_id #2192
UUID for run_id #2192
Conversation
https://github.com/mariusbancila/stduuid is a header-only library for creating UUIDs, but requires C++20 features. This commit copies the header, but hacked to work with C++11. When BOUT++ requires C++20, we should replace this header with mariusbancila/stduuid in a submodule.
Keeps Solver::solve() cleaner.
Saving run_id and run_restart_from as time-evolving variables would make it easier to concatenate data from several consecutive runs. A bit hacky, but do not have a better way to create a per-run dimension at the moment.
Looks like the
|
I'm working on it. I think fixing this requires string support in |
Test that run_id is a valid UUID, and run_restart_from is equal to the original run_id.
I've fixed the test failure, and added tests for Once boutproject/boututils#14 is merged (needed for cmake tests to work with the |
We might also want to define |
sting_view is C++17, and not used in this version of uuid.h.
That would be great! Please do 👍 |
I've merged Only thing left is to look at |
The tests are failing in |
* next-run-id: Note removing support for HDF5 in changelog Better notation for indexing zShift Update note on zShift in grid-files section of manual Print error for HDF5 macros when running bout-v5-macro-upgrader.py Support macros being removed in bout-v5-macro-upgrader.py Remove HDF5 support
So there are two main versions of UUIDs: version 1 which basically hashes the current time and the system's MAC address, and pretty much leaks that information; and version 4, which is completely random. The library we're using here, I'm happy to go ahead using the completely random v4, but I just thought I'd highlight this as a possible design decision. |
I can't remember what the number was, but I remember there was some quote on the chance of random collisions from v4 UUIDs being ludicrously small, so I'm happy to stick with v4 IDs, especially if v1 are not easy to implement right now. |
/clang-format |
I think clang-tidy-review is failing because it gets configured in an environment with libuuid installed, and then clang-tidy runs in a container where it doesn't. Not sure how best to fix that, and I'm not sure I can be bother right now -- the uuid header isn't ours and hopefully we won't have to maintain it (much), so clang-tidy won't run on it after these two PRs. Fedora still failing due to bug in Fedora. I'm going to merge this into #2149, so we can discuss things further there |
Addition for #2149:
stduuid
is MIT licensed, so I think it's OK to just copy the code, with copyright and disclaimer added to the top of the file.run_id
andrun_restart_from
to UUIDs.Would be nice to add a test. Theres a
uuid
module, so we could check thatrun_id
is a correctly formatted UUID withuuid.UUID(run_id)
(if not it will raise an exception), but at the momentcollect()
doesn't support strings, so the test will have to wait.Diff is big because I needed to merge
next
to pick up some recent features. Diff of the new additions here d46c7e3...uuid-run-id.