Writing the full DIP_iR matrix by using PP_wait()

Various technical topics such as parallelism and efficiency, netCDF problems, the Yambo code structure itself, are posted here.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Post Reply
lyzhao
Posts: 40
Joined: Tue May 31, 2016 8:02 am

Writing the full DIP_iR matrix by using PP_wait()

Post by lyzhao » Sun Jan 15, 2023 2:21 am

Dear all,
I want to write the DIP_iR matrix by adding the following code (see bottom) to the file DIPOLE_driver.F (before cleaning DIP_iR).
I use the "call PP_wait()" and "set myid" to let the master cpu write the matrix.
I get the following strange results

Code: Select all

mpirun -np 12 yambo -F ipa.in -J ipa_12
                              1         150           1         150          19  for debug
 Shape(DIP_iR) is:            3         150         150           7           1  for debug
mpirun -np 8 yambo -F ipa.in -J ipa_8
                              1         150           1         150          19  for debug
 Shape(DIP_iR) is:            3         150         150          10           1  for debug
mpirun -np 10 yambo -F ipa.in -J ipa_10
mpirun -np 6 yambo -F ipa.in -J ipa_6
mpirun -np 4 yambo -F ipa.in -J ipa_4
                              1         150           1         150          19  for debug
 Shape(DIP_iR) is:            3         150         150          19           1  for debug
 
In summary, mpirun with 4,6,10 can write correctly, but mpirun with 12 and 8 write incorrectly (only 7 and 10 kpoints are written, respectively)

I use the newest Yambo by clone. The input and output files are attached.
I have noticed "viewtopic.php?t=382", which shows how to use python to do post-processing,
but I prefer to output them directly by using fortran.
Any help will be appreciated.

Code: Select all

!~ lyzhao lyzhao lyzhao lyzhao
 call PP_wait()
 !~ if (master_cpu) then !lyzhao
 if (myid==0) then !lyzhao
   
   write(*,*) Dip%ib(1),Dip%ib_lim(1),Dip%ib_lim(2),Dip%ib(2),Xk%nibz, " for debug"
      
   open(200,file='YBDIPiR.BIN',form='UNFORMATTED',action='WRITE')
   write (*,*) "Shape(DIP_iR) is: ",shape(DIP_iR), " for debug"
   write(200) DIP_iR
   close(200)
   
 endif
 !~ lyzhao lyzhao lyzhao lyzhao
 
 !
 ! Clean up
 !
 if (.not.io_DIP) return
 !
 call DIP_alloc('DIP_iR')
 call DIP_alloc('DIP_P')
 call DIP_alloc('DIP_v')

You do not have the required permissions to view the files attached to this post.
Youzhao Lan
College of Chemistry and Materials Science,
Zhejiang Normal University,
Jinhua, Zhejiang, China.
HomePage: http://blog.sciencenet.cn/u/lyzhao

User avatar
Daniele Varsano
Posts: 3773
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Writing the full DIP_iR matrix by using PP_wait()

Post by Daniele Varsano » Mon Jan 16, 2023 8:29 am

Dear Youzhao,

As a general advice, I strongly suggest you to read the database using the yambopy utility to read databases, you do not need to modify the code and the procedure is less prone to errors.
Here you can find a tutorial on how to read databases including dipoles:
https://www.yambo-code.eu/wiki/index.ph ... _databases

Best,
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

lyzhao
Posts: 40
Joined: Tue May 31, 2016 8:02 am

Re: Writing the full DIP_iR matrix by using PP_wait()

Post by lyzhao » Tue Jan 17, 2023 9:52 am

Dear Daniele,
Thanks for your help.

Best regards.
Youzhao
Youzhao Lan
College of Chemistry and Materials Science,
Zhejiang Normal University,
Jinhua, Zhejiang, China.
HomePage: http://blog.sciencenet.cn/u/lyzhao

Post Reply