Automating tasks

Concerns issues with computing quasiparticle corrections to the DFT eigenvalues - i.e., the self-energy within the GW approximation (-g n), or considering the Hartree-Fock exchange only (-x)

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano

Post Reply
jmullen
Posts: 29
Joined: Wed Apr 01, 2009 6:29 pm

Automating tasks

Post by jmullen » Sat Oct 03, 2009 3:17 pm

Hi all,

I am having problems automating convergence testing for queues. I want to run p2y on my system once (after calculating with Quantum espresso) then run convergence testing by varying parameters in the GW input file. However, I have two problems:

1) yambo -i is interactive and I am not sure how to run it to get the initial setup file without running this interactive component. Also, `yambo -x -p p -g g -V 2 ` is also interactive, though I would like to just generate the file then run sed scripts on it for new runs.

2) after running a GW calculation, I move the r_xxvxc_em1d_ppa_gw0 file then change the parameters in the input file to run yambo again, but the second time I run the calculation, I get (in the queue output file)
"PGFIO-F-207/OPEN/unit=44/file is already connected to another unit."
I seem to be only able to remove this error by deleting everything and running the whole scheme again.

By hand, the steps I follow are (I want to automate the last step in a "sed and run again" loop)
p2y
yambo -i
yambo
yambo -x -p p -g g -V2
yambo
( then edit file and run last step again)

Thanks for any advice
Jeff Mullen
NCSU Physics
Jeff Mullen
NCSU Physics

User avatar
andrea marini
Posts: 325
Joined: Mon Mar 16, 2009 4:27 pm
Contact:

Re: Automating tasks

Post by andrea marini » Sun Oct 04, 2009 1:58 pm

jmullen wrote: I am having problems automating convergence testing for queues. I want to run p2y on my system once (after calculating with Quantum espresso) then run convergence testing by varying parameters in the GW input file. However, I have two problems:

1) yambo -i is interactive and I am not sure how to run it to get the initial setup file without running this interactive component. Also, `yambo -x -p p -g g -V 2 ` is also interactive, though I would like to just generate the file then run sed scripts on it for new runs.
Sorry Jeff, but I do not fully understand your problem. First of all, as far I understand, you are working on a machine with a queue system. Right ? If Yambo is compiled in parallel you can run it interactively, without using the queue, by appending the -N option. In this way MPI will not be used. For example use "yambo -N -i" instead of "yambo -i".
Then you can do the same for any other option (-x , -p ... ).
One you have created an basical input file for GW calculations (using yambo -x -p p ...) you can edit it with any editor and run the code using different values for the parameters. You do not need to run the code interactively again.

I mean, there is no way to create the input file without launching the code interactively. But why you do not want to do it ? I do not understand :(
jmullen wrote: 2) after running a GW calculation, I move the r_xxvxc_em1d_ppa_gw0 file then change the parameters in the input file to run yambo again, but the second time I run the calculation, I get (in the queue output file)
"PGFIO-F-207/OPEN/unit=44/file is already connected to another unit."
I seem to be only able to remove this error by deleting everything and running the whole scheme again.
Jeff, again I do not understand. The r_xxvxc_em1d_ppa_gw0 is closed at the end of the calculation. Why do you want to remove it ? Moreover the error you get seems due to the fact that you are not running the code in parallel. Instead it seems like you are running N times the same code. All the CPU's try to open a given unit, that turns out to be busy.

And, it is ABSOLUTELY strange, that you need to remove everything ! I usually produce hundreds of databases in my Yambo directory, especially when I also use the "-J" option.

Please Jeff, provide us with ALL output files (of the code, and of the queue) plus some snapshots of you directory contents and we will try to help you !
Andrea MARINI
Istituto di Struttura della Materia, CNR, (Italy)

jmullen
Posts: 29
Joined: Wed Apr 01, 2009 6:29 pm

Re: Automating tasks

Post by jmullen » Sun Oct 04, 2009 5:12 pm

I will concentrate on just the automation part my question. Because I am working on a queueing system, it may take hours to execute each part of the calculation process: porting the databases with p2y, running yambo initially, running the setup for GW and running yambo on that setup file. It is tedious to wait for p2y to run before running 'yambo -i', and so on, when the queue may hold my run for days before executing so what I would like to do is automate the entire process. However, creating the setup files is interactive, which attempts to open the editor. I was wondering if there is any way to generate the setup files (both initial and for GW) without using interactive mode so I can start the script in the queue and just have a notification sent when the entire process is finished. If I cannot, well, no real problem, I am just curious.

As for my second problem (the file unit issue), your comments are useful and I will recheck everything to verify which mode (parallel or not) I am really running in.

Thanks
Jeff Mullen
NCSU Physics
Jeff Mullen
NCSU Physics

User avatar
andrea marini
Posts: 325
Joined: Mon Mar 16, 2009 4:27 pm
Contact:

Re: Automating tasks

Post by andrea marini » Sun Oct 04, 2009 5:33 pm

jmullen wrote:I will concentrate on just the automation part my question. Because I am working on a queueing system, it may take hours to execute each part of the calculation process: porting the databases with p2y, running yambo initially, running the setup for GW and running yambo on that setup file. It is tedious to wait for p2y to run before running 'yambo -i', and so on, when the queue may hold my run for days before executing so what I would like to do is automate the entire process. However, creating the setup files is interactive, which attempts to open the editor. I was wondering if there is any way to generate the setup files (both initial and for GW) without using interactive mode so I can start the script in the queue and just have a notification sent when the entire process is finished. If I cannot, well, no real problem, I am just curious.
OK, now I understand. If you want to create your input files, and run them in a queue script you may try to change your list of commands as follows

p2y -F <PW FILE>
yambo -i >& /dev/null
yambo
yambo -x -p p -g g -V 2 >& /dev/null
yambo

The redirection to /dev/null forces yambo to skip the call to the editor. Note that you can also use the -F option to use different file names, like

p2y -F <PW FILE>
yambo -i -F in_setup >& /dev/null
yambo -F in_setup
yambo -x -p p -g g -V 2 -F in_gw >& /dev/null
yambo -F in_gw

My only concern is, if you create the input file automatically all variables will be set to arbitrary large values. Shouldn't be better for you to stop after the setup and edit carefully the GW input file ?
Andrea MARINI
Istituto di Struttura della Materia, CNR, (Italy)

jmullen
Posts: 29
Joined: Wed Apr 01, 2009 6:29 pm

Re: Automating tasks

Post by jmullen » Sun Oct 04, 2009 6:18 pm

andrea marini wrote:My only concern is, if you create the input file automatically all variables will be set to arbitrary large values. Shouldn't be better for you to stop after the setup and edit carefully the GW input file ?
Thanks for your reply. I am editing the input file, but I know what values I wish to check to study convergence, so I will use a sed script to edit the input before I start the GW run.

Cheers
Jeff Mullen
NCSU Physics
Jeff Mullen
NCSU Physics

jmullen
Posts: 29
Joined: Wed Apr 01, 2009 6:29 pm

Re: Automating tasks

Post by jmullen » Wed Nov 04, 2009 3:25 am

Greetings all,

I am back to revisit this post as I have solved almost all of the problems regarding automating multiple yambo runs to test convergence for various parameters. I am, however, left with the final remaining mystery.

The commands of interest are:
yambo -i (create the initial setup file)
yambo (run yambo with this initial setup file)
yambo -x -p p -g g -V 2 (setup a GW calculation)
yambo (run yambo on this new file after I edit various parameters such as FFTGVec for this system)

After Yambo generates the file r_xxvxc_em1d_ppa_gw0, I examine the results of the file. I do indeed have QP energies. Now, I want to increase/change a parameter in the yambo.in file (I am after all, testing for convergence) and then rerun yambo on the input file. All things seem to be fine, but the next file, r_xxvxc_em1d_ppa_gw0_01, does not complete. Instead, the last set of lines in the file are:

[08] Dyson equation: Newton solver
==================================


And then empty space. The error output file from the queueing engine (Sun Grid Engine) is

At line 344 of file mod_IO.f90
Fortran runtime error: File already opened in another unit

I do not know where/what this file is. What I do know, if I delete all the files from the run ( SAVE/ o.qp and any l_* ) and start the whole process over again using the same QE output files and directories (in other words I do not need to rerun QE), then I get a complete QP energy file with no failure - but I have to rerun everything from p2y through to the GW calculation.

Any comments/suggestions?

Regards
Jeff Mullen
NCSU Physics

User avatar
myrta gruning
Posts: 240
Joined: Tue Mar 17, 2009 11:38 am
Contact:

Re: Automating tasks

Post by myrta gruning » Wed Nov 04, 2009 11:17 am

Dear Jeff,

even if I never met the error you described, I know that somehow for the Dyson solver run yambo does not recognize that some parameters are changed, and since it finds the ndb.QP in the SAVE directory it does not (re)run the job.
So I think it is not needed to remove the whole SAVE directory, just (re)move the SAVE/ndb.QP.
As an alternative you can use the -J <opt> option (see yambo -H) when calling yambo to run the job (changing at every run the job string identifier). At every run yambo will create a directory with inside all the databases specific for that run.

For example in your case you may want to run the same job using either 100 or 200 band in the Green function.
Then after creating and editing the yambo.in (for 100 bands in the Green function), you launch the job with

>yambo -J GbndRnge100

this will run the job and create the dir GbndRnge100 with inside the all databases cretaed during the run, thus ndb.QP, moreover all the relevant output file will be label with this string, so that it will be easier to you to recognize to which run (parameter) they belong.
Then if you modify GbndRnge to include e.g. 200 bands, you may relaunch yambo using

>yambo -J GbndRnge200

yambo then will run with the new parameters (and you should not meet the problem you mentioned). Again it will create the dir GbndRng200 with inside the corresponding ndb.QP and label accordingly all output files. In this way you can even run the jobs at the same time (then you will need to different input files, that you can specify in the command line using the -F option) and be sure the processes won- t interfere with each other.

Note however that if you are not changing BndsRnXp (polarization bands) and NGsBlkXp (response block size), you do not want to calculate the response function (screening) again and again (so take this into account when automating the convergence), since this is usually a quite time consuming task. The info on this run are stored in the ndb.pp database. Then you want to have this database in the SAVE dir (as general rule you want to have in SAVE all common databases and in the dir specified by -J the job-specific databases) and not in the job specific one. So either you run before yambo to create just this database (yambo -p p to generate the input and then yambo) or you can move after the first run the ndb.pp to the SAVE dir.

Well I realize this may be quite confusing. I hope that at least the info in the first 2 lines will solve your problem. For the rest if you are interested try to play a bit around with those options, and of course post your doubts/problems.


Regards,

Myrta
Dr Myrta Grüning
School of Mathematics and Physics
Queen's University Belfast - Northern Ireland

http://www.researcherid.com/rid/B-1515-2009

User avatar
andrea marini
Posts: 325
Joined: Mon Mar 16, 2009 4:27 pm
Contact:

Re: Automating tasks

Post by andrea marini » Wed Nov 04, 2009 11:26 am

jmullen wrote: After Yambo generates the file r_xxvxc_em1d_ppa_gw0, I examine the results of the file. I do indeed have QP energies. Now, I want to increase/change a parameter in the yambo.in file (I am after all, testing for convergence) and then rerun yambo on the input file. All things seem to be fine, but the next file, r_xxvxc_em1d_ppa_gw0_01, does not complete. Instead, the last set of lines in the file are:

[08] Dyson equation: Newton solver
==================================


And then empty space. The error output file from the queueing engine (Sun Grid Engine) is

At line 344 of file mod_IO.f90
Fortran runtime error: File already opened in another unit
Myrta can be partially right (BTW, what is the paramater whose change does not make yambo to recreate the QP database ?), but you got an error message here, so, even if you can presumibly solve it by using the -J option, we should try to solve it. So, Jeff, please post
  • The revision of your source (otherwise I do not know which version of mod_IO you're using)
  • the PW input file used to generate the Yambo SAVE
  • the yambo input files of the first QP database and of the second (the one that gives the error) and ALL report and log files (r* and l*)
Cheers
Andrea MARINI
Istituto di Struttura della Materia, CNR, (Italy)

jmullen
Posts: 29
Joined: Wed Apr 01, 2009 6:29 pm

Re: Automating tasks

Post by jmullen » Fri Nov 06, 2009 5:19 pm

Thanks All,

The -J option worked. I did not understand all that is in the SAVE directory and how it relates to each run. I will post some information as you asked, Andrea, soon.

Cheers
Jeff Mullen
NCSU Physics

User avatar
andrea marini
Posts: 325
Joined: Mon Mar 16, 2009 4:27 pm
Contact:

Re: Automating tasks

Post by andrea marini » Fri Nov 06, 2009 5:27 pm

jmullen wrote:Thanks All,
I did not understand all that is in the SAVE directory and how it relates to each run
If you have doubts about the databases and their meaning ask and we will try to help you.

Cheers
Andrea MARINI
Istituto di Struttura della Materia, CNR, (Italy)

Post Reply