yambo-code / yambo

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

performance issue in parallel io with BSE #100

Open sangallidavide opened 3 months ago

sangallidavide commented 3 months ago

The io_BS_header is done by all files, while this is not needed.

This is due to two factors: a) in file PARALLEL_global_Response_T_transitions there is the line

 !                                                                      
 ! I/O privileges                                                       
 !                                                                      
 call IO_and_Messaging_switch("+io_out",CONDITION=.TRUE.)               

b) in K.F there is the line

 !                                                                      
 call io_control(ACTION=OP_APP,COM=REP,ID=ID_head,DO_IT=.true.)                      
 io_BS_err=io_BS_header(iq,X,ID_head,"full")             

I do not understand what is the meaning of DO_IT ? Does it mean DO_IO_IN_PARALLEL ?

sangallidavide commented 3 months ago

Tentative fix released with commit b585505

The DO_IT=.true. has been removed. However it is not possible to change it to DO_IT=.false. because in such a way it would still define the COMM as mpi_comm_world instead of mpi_comm_null

Just removing DO_IT=.true. the comm correctly results in mpi_comm_null, however IO_write is defined for all CPUs, due to the line call IO_and_Messaging_switch("+io_out",CONDITION=.TRUE.) mentioned above.

As a solution I explicitly added some if(master_cpu) in the IO subroutines. A possible alternative could be to change the call in PARALLEL_global_Response_T_transitions to call IO_and_Messaging_switch("+io_out",CONDITION=master_cpu). However, I'm not sure about the implications. To be possibly tested in the future ...