How to use simple commands to exit vi compiler after using yambo - i in shell script

Post here any question you encounter when running the scripts of the yambo-py suite. Post here problem strictly to the python interface as problem coming from the yambo runs should go in the appropriate subforum.

Moderators: palful, amolina, mbonacci

Post Reply
Quxiao
Posts: 100
Joined: Fri Mar 26, 2021 11:27 am

How to use simple commands to exit vi compiler after using yambo - i in shell script

Post by Quxiao » Thu Mar 09, 2023 4:07 am

Dear amolina:
I try to write a shell script to automatically submit yambo calculations and run them on my cluster.Some sentences are like this:

Code: Select all

yambo -i

Code: Select all

yambo

Code: Select all

yambo -r -x -p p -g n 
which is writen in the auto.sh.
However,when I run the auto.sh ,I will enter the vi compilation environment(after yambo -i or then after yambo -r -x -p p -g n),So what can I do to save and exit vi so that I can continue with the next command:yambo -r -x -p p -g n?
That puzzle me ,please give me some help
Best wishes
Quxiao
Quxiao in BIT,calculate the exciton

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

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Post by Daniele Varsano » Thu Mar 09, 2023 7:59 am

Dear Quixiao,

Please note, this is neither a yambo nor a yambo-py related question.
Anyway, my suggestion here is to prepare template input files beforehand, and next handle them at your wish in the bash script.

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/

rreho
Posts: 13
Joined: Mon Apr 26, 2021 3:39 pm

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Post by rreho » Thu Mar 09, 2023 8:58 am

Dear Quixiao,
Daniele is right, this is not a yambo-py related question. However, my suggestion is to use yambo-py to create input files with a script. You can use the class PwIn and follow the documentation available on the Yambo Wiki.

Following your question using shell script, have you tried adding -Q at the end of the command? It works for me with Yambo 5.1.

``` yambo -i -Q ```
or

``` yambo -r -x -p p -g n -Q ```

In this way, you will create input files with flags set to their default values. I recommend editing those.

Best,
Riccardo

Quxiao
Posts: 100
Joined: Fri Mar 26, 2021 11:27 am

Re: How to use simple commands to exit vi compiler after using yambo - i in shell script

Post by Quxiao » Sun Mar 26, 2023 5:54 am

Dear all:
Thanks a lot for your help! -Q is very useful for my calculation.
Best wishes!
Quxiao
Quxiao in BIT,calculate the exciton

Post Reply