...
Code Block |
---|
python $BASE_PATH/run_sciflo.py $WF_DIR/$WF_NAME.sf.xml _context.json output > run_sciflo_$WF_NAME.log 2>&1 STATUS=$? echo -n "Finished running $PGE run_sciflo.py: " 1>&2 date 1>&2 if [ $STATUS -ne 0 ]; then echo "Failed to run $PGE run_sciflo.py" 1>&2 cat run_sciflo_$WF_NAME.log 1>&2 echo "{}" exit $STATUS fi |
SciFlo Python Script
This The run_sciflo.py
is the python script that executes the sciflo job. It takes 2 positional arguments:
Workflow definition document - has the file extension
.wf.xml
Job’s context file aka
_context.json
Directory to write outputs of the job i.e.
output
This script imports the sciflo_util
and calls the run_sciflo
function.
Code Block |
---|
from chimera.commons.sciflo_util import run_sciflo def main(sfl_file, context_file, output_folder): sfl_file = os.path.abspath(sfl_file) context_file = os.path.abspath(context_file) output_file = os.path.abspath(output_folder) LOGGER.info("sfl_file: %s" % sfl_file) LOGGER.info("context_file: %s" % context_file) return run_sciflo(sfl_file, ["sf_context=%s" % context_file], output_folder) |
The command to run sciflo is $HOME/verdi/bin/sflExec.py -s -f -o output --args ”"sfl_context=_context.json” json", "pge.wf.xml"
In the sciflo_util.run_sciflo
function:
This command is constructed and run by the python script.
Code Block |
---|
# build paths to executables sflexec_path = os.path.join( os.environ['HOME'], 'verdi', 'bin', 'sflExec.py') # execute sciflo cmd = [sflexec_path, "-s", "-f", "-o", output_dir, "--args", '"%s"' % ','.join(sfl_args), sfl_file] print("Running sflExec.py command:\n%s" % ' '.join(cmd)) status = os.system(' '.join(cmd)) |
...