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

Rubel, Oleg rubelo at mcmaster.ca
Tue Sep 8 22:03:19 CEST 2020


It is a possibility. In case of LAPW1 it can be lapw1.error, but it can also be uplapw1.error, or uplapw1_1.error, or uplapw1_2.error, etc. Some error files could be in place from a previous run. Maybe there is a more elegant solution?

________________________________________
From: Wien <wien-bounces at zeus.theochem.tuwien.ac.at> on behalf of Yundi Quan <yquan at ucdavis.edu>
Sent: Tuesday, September 8, 2020 14:38
To: A Mailing list for WIEN2k users
Subject: Re: [Wien] Exit code "0" for LAPW1 with an error

The simplest way that I can think of is to check whether the lawp1.error file is empty or not after executing x lapw1. If it is empty after executing 'x lapw1', then lapw1 terminates without any errors. If it is not, then lapw1 terminates with error(s).

On Tue, Sep 8, 2020 at 2:23 PM Rubel, Oleg <rubelo at mcmaster.ca<mailto:rubelo at mcmaster.ca>> wrote:
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<mailto:rubelo at mcmaster.ca>
Tel: +1-905-525-9140, ext. 24094
Web: http://olegrubel.mcmaster


_______________________________________________
Wien mailing list
Wien at zeus.theochem.tuwien.ac.at<mailto:Wien at zeus.theochem.tuwien.ac.at>
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html


More information about the Wien mailing list