-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
libint: expose tunable configuration options for integral generation #202658
Conversation
76d63d8
to
691c92d
Compare
dffe732
to
d220005
Compare
This one is nice. It builds relatively fast and still covers all use cases. Tested cp2k with HF+ADMM and works as expected. The psi4 version works out of the box for Psi4 1.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are to many options and I am against merging this in the current state.
I would be fine with having an easier option to overwrite the configureFlags or a very small subset of this.
libint: more conservative optimisation settings libint: fix integral angular momentum remove leftover log file libint: more options libint: more options libint: more options libint: more fixes libint: more fixes libint: more fixes libint: more fixes libint: more fixes libint: more configuration options libint: psi4-compatible alias libint: 2.7.1 -> 2.7.2 + expose build options libint: fix formatting libint; change psi4 settings libint: adapt psi4 settings libint: fix typo libint: fix compilation libint: disable SSE for Psi4 libint: review changes
Certainly, and I would be a much in favour of handling less myself. Unfortunately libint is used in a large variety of variants and we are not the first bitten by it: https://github.com/evaleev/libint/wiki Unfortunately again, it is a quite performance critical part of quantum chemistry. While there are many options now I've went some way to ensure only reasonable combinations can be specified. Then again I see no harm more options cause to Nixpkgs. @markuskowa what is your opinion on this? |
nixpkgs is a general purpose linux distribution. If you need really specific compile flags to that level and granularity that cannot be generalized, I would highly recommend to start a side project that can fulfill that exact need. Then you most likely also want to compile with AVX which we are not going to do for a while.
It is a maintenance burden and makes the code more complex than it needs to be. Also those flags are not tested or understood by most maintainers so the package will be less good maintained and in case of breakages likely just marked broken. |
@SuperSandro2000 I usually would agree with you that this doesn't look too good. However, this package is a bit of an exception. I am in favor of exposing these configuration options. This is a library that is used by multiple theoretical chemistry packages and with many requiring the package configured slightly differently. I would say that providing that flexibility it is strength of nix. Other distribution have a hard time doing that.
There a lot of specialized packages in nixpkgs, including a lot of scientific software packages. This probably even one of the less exotic ones.
I actually agree here with @sheepforce that there is no harm done of trying this version and see how it holds up. If it turns out to not be a good solution in practice, we simply change it to something simpler. Regarding maintenance: this change is proposed a maintainer of the package. This is a well maintained packaged that will certainly not be left behind as a "marked broken" package. |
Removing options afterwards is always harder. How about we use this feature somewhere and only implement what we truly need? |
@SuperSandro2000 I really appreciate your feedback. In this case, however I think this version is the best option forward. I will try to give some context.
Indeed we have such a side project (https://github.com/markuskowa/NixOS-QChem) and libint originated from there. We are gradually upstreaming stuff suitable for nixpkgs. Libint is a quite basic building block for quantum chemistry, is widely used and works generally well.
We are doing so in NixOS-QChem by modifying the stdenv for several packages and/or directly passing the AVX options similar to how it is done in fftw.
That is probably correct. However, this is also quite hard and I've tried to document them. These things have a physical meaning. They are not merely changing something in the build. The reason is, that libint builds in two phases. Phase 1 is the libint generator. Basically a computer algebra system which code-generates many millions of specific cases in the Obara-Saika recursion scheme required to solve molecular integrals. It absolutely hardcodes every single case and there are many, here is some overview: http://www.zhjun-sci.com/software-libreta-os.php. The flags control (via the build system!) how this equation (see link) is solved. There is no easy way around knowing what this equation does and give it reasonable parameters. We simply can not expect this to be understandable by each maintainer in Nix. The build system is basically already doing quantum mechanics. However, they are tested via assertions. There are simply impossible combinations of values and I catch them.
Oh, if libint breaks we will certainly notice. Half of our research group indirectly depends on libint and a breakage will have a noticable effect. :) I think its the same for @markuskowa
It cannot be generalised for reasons explained above. The version we had in nixpkgs previously is suitable for CP2K (also in nixpkgs) but for nearly no other quantum chemistry package. It is not myself who requires this level of granularity, it is simply how quantum chemistry is being built. Currently, I have introduced the
In conclusion, there is no way to correctly set these parameters without some knowledge of quantum chemistry and what each of the individual programmes utilising libint does in detail, I am afraid. |
Okay fine but if any work needs to be done then we should leave that up to you two and otherwise mark it broken. Also building the package timed out on ofborg after one hour. |
Perfectly fine for me, that is why we are listed as maintainers :) Yes, even here where I've tried much to reduce build time requires at least two hours. The code generation step is unfortunately completely serial. Bigger builds can take more than three days, so this is the best I can do, I am afraid. |
Then we should set meta.hydraPlatforms to an empty list because it will likely also time out on hydra. |
@SuperSandro2000 ofBorg has relatively short timeout. It should be no problem on Hydra though. The build now should be on the order of about 2 hours. |
then lets try that |
Description of changes
Libint for integrals in quantum chemistry can be built in a variety of ways. Up to now, only one has been supported suitable for CP2K included in Nixpkgs. However, other quantum chemistry programmes require very different settings. This PR exposes the majority of libints configuration options within reasonable constraints, so that multiple versions can be built. More integrals are built by default now (for example one-electron integrals and multipole integrals).
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes