yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
91 stars 35 forks source link

Refact fast collisions #96

Closed attacc closed 3 weeks ago

attacc commented 1 month ago

This branch introduce a new approximation for collisions. The possibility to use only the long-range part of the SEX and to construct it on the fly. This is useful for large systems, we plain to use it for large systems: multi-layers, nanotubes etc...

This way to do collisions was already used in: Phys. Rev. B 95, 125403 I just update the code to the last version of Yambo in order to merge it.

Tests are in progress... I'm not in hurry to merge it, it can stay here some time.

A tutorial is available here: https://www.yambo-code.eu/wiki/index.php/A_fast_approach_to_excitonic_effects_in_linear/non-linear_response

at present we are using it for calculations.

sangallidavide commented 3 weeks ago

I had a look to the code. Nothing specific to mention on the structure of the code.

Before merging, can we add one or more tests to the test-suite?

Beside this, few small points:

a) There is a new OpenMP directive which I do not know. !$OMP WORKSHARE . What is this doing?

b) New option TestOSCLL. Do we want to keep it? (fine with me in case)

c) Nice new comment Except for the cases where the ID is defined, io_control is a trivial subrtouine (this is a joke) :-) By the way, in case the ID is to be defined, the subroutine is really trivial

 if (.not. (define_ID_RD .or. define_ID_WR) ) then                      
   call set_action_mode_com_and_sec()                                   
   return                                                               
 endif                                                                  

d) Should the following be changed ?

 if(l_nl_optics) then
   X_scattering    =.FALSE.
 !   sigma_scattering=.FALSE. ! I need them for the LSEX
 endif

e) omp is switched off in src/collisions/COLLISIONS_HXC.F. Is this needed?

attacc commented 3 weeks ago

Here my replies:

a) !$OMP WORKSHARE is used to parallelize vectorized Fortran code for example image you have a matrix A(:,:,:) and you do A=0 you can parallelize this operation doing

 !$OMP WORKSHARE
 A=0
 !$OMP END WORKSHARE

similar for the forall, where, etc... more info here: https://www.openmp.org/spec-html/5.0/openmpsu39.html

b) Yes I would like to keep TestOScll, it forces the code to allocate the two type of collisions and compare it

c) ok!

d) No, the code works, probably it is a wrong comment

e) this was a mistake, probably I comment it for some test, I restored it

attacc commented 3 weeks ago

I already added test in test-suite in the branch refact_fast-collisions I merge them

sangallidavide commented 3 weeks ago

The new tests in tech-master fail in parallel on my machine: https://media.yambo-code.eu/robots/tech-master/unimi-XPS-8930.php

attacc commented 3 weeks ago

This puzzling.... on my pc parallel tests work https://media.yambo-code.eu/robots/tech-master/attacc-lavoro.php

I will check it again

sangallidavide commented 3 weeks ago

I get this error:

 <---> P1: [PARALLEL Oscillators for OSCL bands on 2 CPU] Loaded/Total (Percentual):18/36(50%)
 <---> P1: [OSC] Checking oscillators header
 <---> P1: [OSC] Missing or broken oscillators
 <02s> P1: [PARALLEL distribution for Wave-Function states] Loaded/Total(Percentual):12/24(50%)
 <02s> P1: [FFT-OSC] Mesh size:  12  12  27

 <02s> P1: [OSC] Oscillators : |                                        | [000%] --(E) --(X)
P1: [ERROR] STOP signal received while in[05.01] Messaging
P1: [ERROR] EMPTY WF index @ b5 k2 spin1 ID0

Parallel scheme (randomly generated from test-suite)

DIP_ROLEs= "k.c.v"
NL_ROLEs= "w.k"

NL_CPU="1.4"
DIP_CPU="2.1.2"
attacc commented 3 weeks ago

Thanks I will check it

attacc commented 3 weeks ago

Hi Davide there is a part that I do not understand here.

I create a new parallelization scheme for the Oscillators, how can I explain to Yambo-test to generate parallel configuration also for that one, and set some configuration as "WRONG CPU configuration"?

Any hints is welcome.

sangallidavide commented 3 weeks ago

I think you need to edit this file for adding a parallel configurations in the test-suite libs/PARALLEL_build_the_conf.pm

I do not remember how it works the WRONG_CPU_CONF ...

attacc commented 3 weeks ago

ok I will have a look

andreamarini commented 3 weeks ago

Well. The test-suite was originally based on the code written by Conor.

At that time I knew nothing about perl but, rather then wasting Conor's work and rewriting everything from scratch, I decided to learn perl and dig in his code.

Com'on. You can do the same, no? ;)

attacc commented 2 weeks ago

Andrea I do not agree, we are in 2024, I think you should move to python..... Perl is abandoned in all scripts in the Linux distributions.

sangallidavide commented 2 weeks ago

Andrea I do not agree, we are in 2024, I think you should move to python..... Perl is abandoned in all scripts in the Linux distributions.

Yeah, this is also the conclusion which came out from different MaX discussions.

Also all students now knows python. If we want for the test-suite to have a future, we need to switch to it.

There already is a prototype (thanks to Nicola and Claudio).

andreamarini commented 2 weeks ago

I do think that there is only one sustainable way to move from perl to python:

  1. we create a new branch and start rewriting a brand new test-suite drive
  2. we test it and make stable and fully functional (note that the perl version took years to become what it is)
  3. we slowly move from perl to python

Now. Even if perl is so obsolete (are you sure? Look https://github.com/Perl and https://www.perl.org/) I see a big problem: who is going to spend hours in rewriting something that is fully working?

attacc commented 2 weeks ago

Ciao

  1. we create a new branch and start rewriting a brand new test-suite drive

ok

  1. we test it and make stable and fully functional (note that the perl version took years to become what it is)
  2. we slowly move from perl to python

Now. Even if perl is so obsolete (are you sure? Look https://github.com/Perl http://here) I see a big problem: who is going to spend hours in rewriting something that is fully working?

I already started and Nicola is continuing to work on it Claudio

— Reply to this email directly, view it on GitHub https://github.com/yambo-code/yambo/pull/96#issuecomment-2172547444, or unsubscribe https://github.com/notifications/unsubscribe-auth/AED6PCJA7ZYSTGRSTBHM54DZH2IQBAVCNFSM6AAAAABIX7QIDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZSGU2DONBUGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

--

Phone: +33491172806 Mobile[FR]: +33662922897 Mobile[IT]: +393384315437 Fax: +33491418916 Address: CINaM Campus de Luminy 163 Avenue de Luminy, Case 913 13288 Marseille Cedex 9

Skype: claudioattaccalite Editor Fellow for: www.scipost.org web site: www.attaccalite.com