charmplusplus / charm

The Charm++ parallel programming system. Visit https://charmplusplus.org/ for more information.
Apache License 2.0
199 stars 50 forks source link

`charmc`: exit code 0 on error in charmxi #3785

Open tvandera opened 4 months ago

tvandera commented 4 months ago

Hi,

There is no set -o pipefail in charmc. Therefore, this pipe:

https://github.com/UIUC-PPL/charm/blob/738c09c9e845f2ec82c491f10a27f82729a847a5/src/scripts/charmc#L1915

can cause charmc to exit with status code 0, even when charmxi fails

tvandera commented 4 months ago

Hmm, I seems you'd also need a set -e for the set -o pipefail to work.

Another solution would be to use a temporary file to split the two commands

  Do $CMK_CPP_CHARM $OPTS_CPP $FILE -o $FILE.i
  Do $CHARMBIN/charmxi $XIOPTS -orig-file $FILE $FILE.i
  # original: Do $CMK_CPP_CHARM $OPTS_CPP $FILE | Do $CHARMBIN/charmxi $XIOPTS -orig-file $FILE