<div>Hi Tiziano,</div><div>Thank you very much for your reply, now I understand the first question. </div><div>For the second question (about the estimation of the ERI memory consumption),  which tag in the CP2K input file allows printing this estimated memory?</div><div>Best,</div><div>Geng</div><div><br></div><br><div class="gmail_quote"><div dir="auto" class="gmail_attr">在2021年1月28日星期四 UTC-8 下午11:49:58&...@chem.uzh.ch> 写道:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Dear Geng,
<br>
<br>for 1) the memory should be the total over MPI ranks (but only the ERI 
<br>storage part). Since the HFX code is OpenMP-parallelized I would suggest 
<br>to use less MPI ranks per physical node and more threads. Each MPI rank 
<br>has to maintain the full density matrix locally, hence you would like to 
<br>avoid too many ranks per node. The ERIs on the other hand can be 
<br>compressed and even stored to disk if needed.
<br>
<br>for 2) much of the memory usage is known a-priori (before any ERI is 
<br>actually calculated), see 
<br><a href="https://github.com/cp2k/cp2k/blob/d7da0214a5d90c06d8c33ae514e3a7d3c4a4888b/src/hfx_energy_potential.F#L611-L651" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://github.com/cp2k/cp2k/blob/d7da0214a5d90c06d8c33ae514e3a7d3c4a4888b/src/hfx_energy_potential.F%23L611-L651&source=gmail&ust=1612024639909000&usg=AFQjCNEUC5wIm0K-BMGP6T3h3kRimaOpZw">https://github.com/cp2k/cp2k/blob/d7da0214a5d90c06d8c33ae514e3a7d3c4a4888b/src/hfx_energy_potential.F#L611-L651</a>, 
<br>but some part as you already wrote is dynamic. From that one could 
<br>probably derive a (pessimistic) upper limit.
<br>
<br>Best,
<br>Tiziano
<br>
<br>On 1/29/21 4:05 AM, Sun Geng wrote:
<br>> Dear Tiziano,
<br>> Thanks for your reply.
<br>> I applied the patch to the CP2K code (v8.1), and now it can print a 
<br>> reasonable number for the RAM (below).
<br>> May I take the advantage to ask two additional questions regarding the 
<br>> RAM in HFX? Thank you very much in advance.
<br>> 1) The line "  HFX_MEM_INFO| Total memory consumption ERI's RAM [MiB]:  
<br>>                 540840" prints the total (including all MPI processors ) 
<br>> used memory, am I right?
<br>> 2) Is there a way to estimate the required memory for the HFX module 
<br>> before running the CP2k program? I thought no because the memory is 
<br>> allocated dynamically according to the occupation matrix, but I would 
<br>> like to have a double-check.
<br>> Thanks again.
<br>> Best Regards,
<br>> Geng
<br>> 
<br>> 
<br>>    HFX_MEM_INFO| Number of cart. primitive ERI's calculated:      
<br>>   32799680679415
<br>>    HFX_MEM_INFO| Number of sph. ERI's calculated:                  
<br>>   1498990881919
<br>>    HFX_MEM_INFO| Number of sph. ERI's stored in-core:                
<br>> 683885389270
<br>>    HFX_MEM_INFO| Number of sph. ERI's stored on disk:                    
<br>>         0
<br>>    HFX_MEM_INFO| Number of sph. ERI's calculated on the fly:            
<br>>          0
<br>>    HFX_MEM_INFO| Total memory consumption ERI's RAM [MiB]:              
<br>>     540840
<br>>    HFX_MEM_INFO| Whereof max-vals [MiB]:                                
<br>>      10475
<br>>    HFX_MEM_INFO| Total compression factor ERI's RAM:                    
<br>>       9.65
<br>>    HFX_MEM_INFO| Total memory consumption ERI's disk [MiB]:              
<br>>         0
<br>>    HFX_MEM_INFO| Total compression factor ERI's disk:                    
<br>>      0.00
<br>>    HFX_MEM_INFO| Size of density/Fock matrix [MiB]:                      
<br>>       408
<br>>    HFX_MEM_INFO| Size of buffers [MiB]:                                  
<br>>        25
<br>>    HFX_MEM_INFO| Number of periodic image cells considered:              
<br>>        33
<br>>    HFX_MEM_INFO| Est. max. program size after HFX  [MiB]:                
<br>>      7536
<br>> 
<br>> 
<br>> 在2021年1月28日星期四 UTC-8 上午8:09:03<<a href data-email-masked rel="nofollow">tiz...@chem.uzh.ch</a>> 写道:
<br>> 
<br>>     Hi Geng,
<br>> 
<br>>     can you please tell us which version of CP2K you are using and possibly
<br>>     also submit an input file with which you can reproduce the issue?
<br>> 
<br>>     But since that's quiet a number of ERIs (which seems a bit weird since
<br>>     you're using ADMM), my first guess is an integer overflow here:
<br>> 
<br>>     <a href="https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F#L1776-L1777" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F%23L1776-L1777&source=gmail&ust=1612024639909000&usg=AFQjCNF2P0UKINxSOdyjuwbf_5GGd70-7w">https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F#L1776-L1777</a>
<br>>     <<a href="https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F#L1776-L1777" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F%23L1776-L1777&source=gmail&ust=1612024639909000&usg=AFQjCNF2P0UKINxSOdyjuwbf_5GGd70-7w">https://github.com/cp2k/cp2k/blob/5b641945b68ab1861fea87544a697b03403b4443/src/hfx_energy_potential.F#L1776-L1777</a>>
<br>> 
<br>> 
<br>>     ... while the target variable is an int8, the variables multiplied are
<br>>     int4, and get multiplied first as such before converted to int8:
<br>>     <a href="https://gcc.godbolt.org/z/x4hYsb" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://gcc.godbolt.org/z/x4hYsb&source=gmail&ust=1612024639909000&usg=AFQjCNGUyEL_EMuRxNvYqEBke2Z636KA9A">https://gcc.godbolt.org/z/x4hYsb</a> <<a href="https://gcc.godbolt.org/z/x4hYsb" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://gcc.godbolt.org/z/x4hYsb&source=gmail&ust=1612024639909000&usg=AFQjCNGUyEL_EMuRxNvYqEBke2Z636KA9A">https://gcc.godbolt.org/z/x4hYsb</a>>
<br>>     If you have CP2K v8.1 you can try the attached patch and see whether it
<br>>     fixes the issue (only compile-tested so far).
<br>> 
<br>>     Best,
<br>>     Tiziano
<br>> 
<br>>     On 1/28/21 4:01 PM, Sun Geng wrote:
<br>>      > Dear CP2K users,
<br>>      > I am running jobs with CP2K/ADMM method, in which the CP2k prints
<br>>     the
<br>>      > following lines:
<br>>      >
<br>>      >   HFX_MEM_INFO| Number of cart. primitive ERI's calculated:
<br>>      >  52451602395221
<br>>      >   HFX_MEM_INFO| Number of sph. ERI's calculated:
<br>>      >  2343013195064
<br>>      >   HFX_MEM_INFO| Number of sph. ERI's stored in-core:
<br>>      >  2247108266900
<br>>      >   HFX_MEM_INFO| Number of sph. ERI's stored on disk:
<br>>      >        0
<br>>      >   HFX_MEM_INFO| Number of sph. ERI's calculated on the fly:
<br>>      >         0
<br>>      >   HFX_MEM_INFO| Total memory consumption ERI's RAM [MiB]:
<br>>      >   -449594
<br>>      >   HFX_MEM_INFO| Whereof max-vals [MiB]:
<br>>      >     17729
<br>>      >   HFX_MEM_INFO| Total compression factor ERI's RAM:
<br>>      >    -38.13
<br>>      >   HFX_MEM_INFO| Total memory consumption ERI's disk [MiB]:
<br>>      >        0
<br>>      >   HFX_MEM_INFO| Total compression factor ERI's disk:
<br>>      >     0.00
<br>>      >   HFX_MEM_INFO| Size of density/Fock matrix [MiB]:
<br>>      >      408
<br>>      >   HFX_MEM_INFO| Size of buffers [MiB]:
<br>>      >       25
<br>>      >   HFX_MEM_INFO| Number of periodic image cells considered:
<br>>      >       33
<br>>      >   HFX_MEM_INFO| Est. max. program size after HFX  [MiB]:
<br>>      >    31121
<br>>      >
<br>>      > The total memory consumption ERI's RAM is a negative number.
<br>>      > Why it is a negative number?
<br>>      > How can I know the real RAM consumption in this job?
<br>>      > Thank you very much in advance.
<br>>      > Best
<br>>      > Geng
<br>>      >
<br>>      >
<br>>      > --
<br>>      > You received this message because you are subscribed to the Google
<br>>      > Groups "cp2k" group.
<br>>      > To unsubscribe from this group and stop receiving emails from it,
<br>>     send
<br>>      > an email to <a href data-email-masked rel="nofollow">cp...@googlegroups.com</a>
<br>>      > <mailto:<a href data-email-masked rel="nofollow">cp...@googlegroups.com</a>>.
<br>>      > To view this discussion on the web visit
<br>>      >
<br>>     <a href="https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%2540googlegroups.com&source=gmail&ust=1612024639909000&usg=AFQjCNFWuS-yWZxl2deAD8NKhU4sCrhNqg">https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com</a>
<br>>     <<a href="https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%2540googlegroups.com&source=gmail&ust=1612024639909000&usg=AFQjCNFWuS-yWZxl2deAD8NKhU4sCrhNqg">https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com</a>>
<br>> 
<br>>      >
<br>>     <<a href="https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1612024639909000&usg=AFQjCNG392xT1obfn3y9zZDrFiGpSjvDzA">https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com?utm_medium=email&utm_source=footer</a>
<br>>     <<a href="https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1612024639910000&usg=AFQjCNG7ymgvjwJVkuRv7hK4D22ju6SCKg">https://groups.google.com/d/msgid/cp2k/02d0eebb-898e-4536-913f-548448e11648n%40googlegroups.com?utm_medium=email&utm_source=footer</a>>>.
<br>> 
<br>> 
<br>>     -- 
<br>>     Tiziano Müller
<br>>     University of Zurich
<br>>     Department of Chemistry
<br>>     Winterthurerstrasse 190
<br>>     CH-8057 Zürich
<br>> 
<br>>     Tel: +41 44 63 54234
<br>>     <a href="http://www.chem.uzh.ch" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=http://www.chem.uzh.ch&source=gmail&ust=1612024639910000&usg=AFQjCNEkUq_KQnhDK4u9-_9DZD2XhJ78Ww">www.chem.uzh.ch</a> <<a href="http://www.chem.uzh.ch" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=http://www.chem.uzh.ch&source=gmail&ust=1612024639910000&usg=AFQjCNEkUq_KQnhDK4u9-_9DZD2XhJ78Ww">http://www.chem.uzh.ch</a>>
<br>>     <a href data-email-masked rel="nofollow">tiz...@chem.uzh.ch</a>
<br>> 
<br>> -- 
<br>> You received this message because you are subscribed to the Google 
<br>> Groups "cp2k" group.
<br>> To unsubscribe from this group and stop receiving emails from it, send 
<br>> an email to <a href data-email-masked rel="nofollow">cp...@googlegroups.com</a> 
<br>> <mailto:<a href data-email-masked rel="nofollow">cp...@googlegroups.com</a>>.
<br>> To view this discussion on the web visit 
<br>> <a href="https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%40googlegroups.com" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%2540googlegroups.com&source=gmail&ust=1612024639910000&usg=AFQjCNG7dDMZmmSA8Macez3zD8B8g5QzBg">https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%40googlegroups.com</a> 
<br>> <<a href="https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%40googlegroups.com?utm_medium=email&utm_source=footer" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1612024639910000&usg=AFQjCNGGwvfIhg_BT9-gm1L__5EYUG1UxA">https://groups.google.com/d/msgid/cp2k/b579bdce-d28d-4551-b0b9-fb497a5efa3dn%40googlegroups.com?utm_medium=email&utm_source=footer</a>>.
<br>
<br>-- 
<br>Tiziano Müller
<br>University of Zurich
<br>Department of Chemistry
<br>Winterthurerstrasse 190
<br>CH-8057 Zürich
<br>
<br>Tel: +41 44 63 54234
<br><a href="http://www.chem.uzh.ch" target="_blank" rel="nofollow" data-saferedirecturl="https://www.google.com/url?hl=zh-CN&q=http://www.chem.uzh.ch&source=gmail&ust=1612024639910000&usg=AFQjCNEkUq_KQnhDK4u9-_9DZD2XhJ78Ww">www.chem.uzh.ch</a>
<br><a href data-email-masked rel="nofollow">tiz...@chem.uzh.ch</a>
<br></blockquote></div>