-
Notifications
You must be signed in to change notification settings - Fork 51
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
Implement a region calculus #995
base: dev
Are you sure you want to change the base?
Conversation
This is a draft only. There are three classes:
Each class has three variants:
Please advise:
|
Thanks for the details! Is
We are using Catch2: https://github.com/catchorg/Catch2 Example tests are located in test/ and you could add to the
Sounds great, please also consider adding Doxygen strings in the headers.
If you can use a
We vendor a JSON library (https://github.com/nlohmann/json) that we can use for serialization, but don't yet use a yaml lib. If we can separate them out well, we make them opt-in. I would try to avoid another mandatory dependency for now. |
Hiding the dimension is somewhat difficult in C++.
I'll implement a proof of concept for discussion. Thanks for the other comments. |
I added new (temporary) files
The former is necessary for efficiency. The latter is convenient when creating high-level language bindings. The two other classes If you agree with this generic setup, then I'll clean up my implementation. |
This pull request introduces 1 alert when merging 84796f8 into 9170612 - view on LGTM.com new alerts:
|
@ax3l Can you comment? Do you want to discuss further, or would my API choices have a good chance of being accepted? |
Thanks for the ping! It's a bit challenging for compile-time that we have to put so much in header-only files due to templates. But since we make the headers opt-in for users, this should not cause too much trouble. Can you please at the end add Doxygen strings to classes and methods? With respect to naming conventions, we could try to make the class spellings similar to existing classes in the library (uppercase first letter), unless that feels very unnatural for you. |
I find that I'm using C++17, because that's quite convenient, especially |
Are you using a particular benchmarking infrastructure? |
We usually test performance on Summit and Cori. Is that what you mean? :)
…On June 6, 2021 9:02:02 AM PDT, Erik Schnetter ***@***.***> wrote:
Are you using a particular benchmarking infrastructure?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#995 (comment)
|
Since this calculus is opt-in with explicit include headers, we can have it require C++17 already, I would stay.
We will transition to C++17 as soon as WarpX and PIConGPU do the switch; probably later this year if things go well?
Xref:
#625 (comment)
…On June 5, 2021 8:56:51 AM PDT, Erik Schnetter ***@***.***> wrote:
I find that I'm using C++17, because that's quite convenient,
especially `if constexpr` statements. I see that openPMD-api only uses
C++14 elsewhere. If you're planning on upgrading soon, I'll leave the
code, otherwise I'll have to downgrade my code.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#995 (comment)
|
This pull request introduces 1 alert when merging 15399b1 into ed8f16f - view on LGTM.com new alerts:
|
# Conflicts: # .github/workflows/unix.yml
This pull request introduces 1 alert when merging c436db6 into 239cf68 - view on LGTM.com new alerts:
|
Fun fact: This seems to uncover a compiler bug on
Building with Also conceptually, I understand it correctly, that this code is currently not supposed to interact with other parts of openPMD apart from often being useful to have? |
@franzpoeschel I will have a look at the signed/unsigned warnings. I don't recall seeing these in the code I added. Conceptually, Regions would be added without making any other changes to openPMD-api at first. Later, it would be unobtrusive to allow It might also make sense to offer certain helper routines that are sometimes needed to read or write chunks. Examples would be extracting or inserting a sub-box into a box: A given array in memory is defined by a box, and the chunk that is read or written is only a part of this (another box, contained in the first), and there could be efficient functions for reading/writing these. Alternatively, the chunk reading/writing functions could be extended to support these operations. HDF5 calls this "hyperslab selection". The core contribution is the |
Thank you for the clarification! Introducing the region calculus as an independent library segment first and later using it where applicable is a good approach in my opinion. I have not really had a very thorough look into the code itself, rather than skimming it for a first understanding, but this looks like a nice addition to openPMD overall, thank you for contributing it :) |
I see no warnings when building with |
After some playing around, I only see those warnings when building with |
I still see no warnings when building in |
I disabled Regions by default. |
Hm, weird. I used no special flags otherwise for compiling. |
I have tried to fix the warnings on this branch. Is there a particular reason that you would use |
@franzpoeschel I looked at the code, and the type Can you open a pull request against my branch? This will allow me to see a diff for the changes you made. |
I have opened a pull request: eschnett#1 @eschnett |
Don't use std::ptrdiff type
@franzpoeschel I merged you pull request. |
# Conflicts: # .github/workflows/unix.yml
Just wanted to check - is this PR still active? |
Closes #989 .