radical-cybertools / radical.pilot

RADICAL-Pilot
http://radical-cybertools.github.io/radical-pilot/index.html
Other
54 stars 23 forks source link

recover correct exit code of exec script in launcher #3123

Closed andre-merzky closed 7 months ago

mtitov commented 7 months ago

@andre-merzky should exec script be updated as well? https://github.com/radical-cybertools/radical.pilot/blob/22b3ef0a9f94d3e170b6f8c57609b6345439ee98/src/radical/pilot/agent/executing/popen.py#L769-L772 -> reorder exec_pid and rank_pid

        ret += '\nRP_RANK_PID=$!\nRP_EXEC_PID=$$\n\n'
        ret += 'wait $RP_RANK_PID\n'
        # set output
        ret += 'RP_RET=$?\n'
andre-merzky commented 7 months ago

@andre-merzky should exec script be updated as well?

https://github.com/radical-cybertools/radical.pilot/blob/22b3ef0a9f94d3e170b6f8c57609b6345439ee98/src/radical/pilot/agent/executing/popen.py#L769-L772

-> reorder exec_pid and rank_pid

        ret += '\nRP_RANK_PID=$!\nRP_EXEC_PID=$$\n\n'
        ret += 'wait $RP_RANK_PID\n'
        # set output
        ret += 'RP_RET=$?\n'

Directly after the wait call is correct, no need to reorder here. In the code which was changed, $? captured the return code of the env setting on the line before, not of the actual launch command ... Oops :-)