Make GRPP an internal dependency#3966
Conversation
82c83bb to
d0564bf
Compare
|
Thanks for taking this on. I'll take a look at the precommit failure. Could you please remove the intermediate A few more comments, which could also be addressed in follow up PRs:
Tagging @aoleynichenko just in case. |
We have no choice as we are not the author of this library.
I will wait before suppressing this as well. I think we should treat it as a dependency for now.
I need to understand what these tests do and what they are reporting before doing this. That's why I also consider this as experimental feature and that the option CP2K_USE_GRPP should stay until we sort these things out. For now, we need to be sure it builds with cmake and spack. The toolchain won't be an issue.
Why ? I can compile the entire source without any conflict at all otherwise I would have fixed it. It also does not matter if the code is compiled first or second or third. I do not create a separate archive for this as we do not indent to distribute it separately. It is directly included
|
Yes, we should certainly honor the original license. The way you did it now is exactly what I had in mind.
Sure, let's take it one step at a time. It's not every day that we scoop up 60 kLoC.
Well, but it does matter in which order the objects get linked together, doesn't it? We usually protect against name collision by using modules in Fortran and prefixes like |
that's certainly true for shared libraries. The best is to do a proper namespacing and hide internal functions. The outside world interface is already namespace. |
|
Dear all, you are granted to change everything in the LIBGRPP's code except for the original MIT license headers and my copyright string. Of course, it is not a problem to add new headers specific for CP2K. Best,Alexander ----------------Кому: cp2k/cp2k ***@***.***);Копия: Alexander Oleynichenko ***@***.***), Mention ***@***.***);Тема: [cp2k/cp2k] Make GRPP an internal dependency (PR #3966);12.02.2025, 17:52, "Ole Schütt" ***@***.***>: We have no choice as we are not the author of this library.Yes, we should certainly honor the original license. The way you did it now is exactly what I had in mind.I will wait before suppressing this as well. I think we should treat it as a dependency for now.Sure, let's take it one step at a time. It's not every day that we scoop up 60 kLoC.It also does not matter if the code is compiled first or second or third.Well, but it does matter in which order the objects get linked together, doesn't it? We usually protect against name collision by using modules in Fortran and prefixes like dbm_ on the C side. However, the libgrpp codes does not use prefixes. It therefore adds a ton of symbols to the flat (!) linker namespace. And many of these have rather generic names like binomial. So, I think it would be good if we instructed CMake to link in the objects from grpp directory last.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Dear Alexander, thanks a lot for chiming in! It's very comforting to have your explicit approval. I hope you also agree with our conclusion that absorbing libgrpp into CP2K is the best way to keep your great work alive? |
7ae3145 to
ce70198
Compare
|
e8c2ae2 to
7982ace
Compare
8832093 to
69768b4
Compare
28c657f to
bc52c75
Compare
bc52c75 to
354dfd7
Compare
|
Looking at the coverage report, it seems we just need a few files from libgrpp. Should we already drop the unused files? |
|
OK, let me check that everything works fine without the unnecessary code. The only issue I could see is that some path might not be taken when we run the code but still needed at compilation time. |
|
part of the library (type 1 integrals) is currently only referenced in backup code and
will not be touched in regtests.
…________________________________________
From: Taillefumier Mathieu ***@***.***>
Sent: Tuesday, February 25, 2025 10:20 AM
To: cp2k/cp2k
Cc: Subscribed
Subject: Re: [cp2k/cp2k] Make GRPP an internal dependency (PR #3966)
OK, let me check that everything works fine without the unnecessary code. The only issue I could see is that some path might not be taken when we run the code but still needed at compilation time.
—
Reply to this email directly, view it on GitHub<#3966 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AD2WEUWWBYZB7YB3RHKINP32RQYWTAVCNFSM6AAAAABW42BLLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBRGI2TOMRSGI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
[mtaillefumier]mtaillefumier left a comment (cp2k/cp2k#3966)<#3966 (comment)>
OK, let me check that everything works fine without the unnecessary code. The only issue I could see is that some path might not be taken when we run the code but still needed at compilation time.
—
Reply to this email directly, view it on GitHub<#3966 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AD2WEUWWBYZB7YB3RHKINP32RQYWTAVCNFSM6AAAAABW42BLLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBRGI2TOMRSGI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
I am inclined of merging this PR and then open another PR for removing the unnecessary code. I did some simple tests removing the unneeded files from the compilation but got a long list of errors during linking time which means that I have to go through the entire code manually to remove all unnecessary functions. If we choose this path I wonder if it is not better to just rewrite the functionalities we need while keeping the author copyright. this test is failing but I do not understand why. It does not depend on GRPP a priori /opt/cp2k/build/bin/TEST-2025-02-24_12-07-56/QS/regtest-gpw-8/si8_broy_wc.inp.out |
|
I don't think it makes sense to identify and delete unused code in the library.
1) Maybe somebody wants to use the deleted functionality in the future
2) We may replace the currently used functionalty by our own function
In any case it is a lot of work with only minor gains.
…________________________________________
From: Taillefumier Mathieu ***@***.***>
Sent: Friday, February 28, 2025 8:29 AM
To: cp2k/cp2k
Cc: Jürg Hutter; Comment
Subject: Re: [cp2k/cp2k] Make GRPP an internal dependency (PR #3966)
I am inclined of merging this PR and then open another PR for removing the unnecessary code. I did some simple tests removing the unneeded files from the compilation but got a long list of errors during linking time which means that I have to go through the entire code manually to remove all unnecessary functions. If we choose this path I wonder if it is not better to just rewrite the functionalities we need while keeping the author copyright.
this test is failing but I do not understand why. It does not depend on GRPP a priori
/opt/cp2k/build/bin/TEST-2025-02-24_12-07-56/QS/regtest-gpw-8/si8_broy_wc.inp.out
Difference too large: 7.16e-04 > 2e-06, ref_value: 1902.1967139926, value: 1900.8347065463.
—
Reply to this email directly, view it on GitHub<#3966 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AD2WEUW5EO6TPUXWRSCRGID2SAF7NAVCNFSM6AAAAABW42BLLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHEZTCMJZGA>.
You are receiving this because you commented.Message ID: ***@***.***>
[mtaillefumier]mtaillefumier left a comment (cp2k/cp2k#3966)<#3966 (comment)>
I am inclined of merging this PR and then open another PR for removing the unnecessary code. I did some simple tests removing the unneeded files from the compilation but got a long list of errors during linking time which means that I have to go through the entire code manually to remove all unnecessary functions. If we choose this path I wonder if it is not better to just rewrite the functionalities we need while keeping the author copyright.
this test is failing but I do not understand why. It does not depend on GRPP a priori
/opt/cp2k/build/bin/TEST-2025-02-24_12-07-56/QS/regtest-gpw-8/si8_broy_wc.inp.out
Difference too large: 7.16e-04 > 2e-06, ref_value: 1902.1967139926, value: 1900.8347065463.
—
Reply to this email directly, view it on GitHub<#3966 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AD2WEUW5EO6TPUXWRSCRGID2SAF7NAVCNFSM6AAAAABW42BLLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMOBZHEZTCMJZGA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
that is also my conclusion. Both arguments make sense but it is a lot of work to do. |
|
@oschuett or anyone with merge access has the final call for this PR. I am currently checking why this test fails. |
|
Alright, then I'll merge this as is. The |
|
Thanks @oschuett . |
|
Great work! I've created #4036 so we don't forget about it. |
The grpp source code is part of cp2k source code. The flag
-DCP2K_USE_GRPP=ONwill compilecp2kandgrppsource codes.NB :