[Wien] Exit code "0" for LAPW1 with an error

Rubel, Oleg rubelo at mcmaster.ca
Tue Sep 8 20:23:02 CEST 2020


Dear WIEN2k community,

suppose we have a code that includes a sequence of commands. Before running the next command, I would like to check if the previous one completed successfully. It is convenient to use exit codes for that purpose. Here is a small example in bash (looking for a file that does not exist):

[rubel at gra-login3 lambda1]$ ls oleg
ls: cannot access 'oleg': No such file or directory
[rubel at gra-login3 lambda1]$ echo $?
2

Here "echo $?" returns the exit code of a previous command. If it is not "0", there is a problem (like in this case, there is no "oleg" file).

Now I try to apply the same strategy to WIEN2k:

[rubel at gra-login3 lambda1]$ x lapw1
LAPW1 - Error
0.001u 0.018s 0:00.06 16.6%     0+0k 23592+16io 67pf+0w
[rubel at gra-login3 lambda1]$ echo $?
0

This is an unexpected result. The exist status is OK in spite of the fact that LAPW1 exited with an error. Of course, there are error files created for each program + spin up/dn (even process for parallel calculations). But it can be quite elaborate to search through them, and it depends on whether you run lapw1 or lapw2, etc.

I wonder if there is a _simple_ alternative way for sensing an error? Also message is not always "XXXXX - Error". It can be different (e.g., segmentation fault).

Thank you in advance
Oleg

--
Oleg Rubel (PhD, PEng)
Department of Materials Science and Engineering
McMaster University
JHE 359, 1280 Main Street West, Hamilton, Ontario L8S 4L8, Canada
Email: rubelo at mcmaster.ca
Tel: +1-905-525-9140, ext. 24094
Web: http://olegrubel.mcmaster




More information about the Wien mailing list