The wrapper script gets a list of env vars in the environment before, and after launching mpirun, and then passes the different (i.e., the env vars added by MPI) to cwltool. This is necessary as cwltool uses the --cleanenv and other flags to isolate the execution, but without the MPI env vars the MPI server and ranks fail to communicate.
toil-cwl-runner mpich-mpirun-mpi-requirement.cwl
Traceback (most recent call last):
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/bin/cwl-docker-extract", line 6, in <module>
sys.exit(main())
~~~~^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/docker_extract.py", line 140, in main
run(arg_parser().parse_args(sys.argv[1:]))
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/docker_extract.py", line 56, in run
top = cwl.load_document_by_uri(args.input)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 328, in load_document_by_uri
return load_document_by_string(
loadingOptions.fetcher.fetch_text(real_uri),
...<3 lines>...
load_all,
)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 365, in load_document_by_string
return load_document_by_yaml(result, uri, loadingOptions, id_, load_all)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 390, in load_document_by_yaml
result = cwl_v1_2.load_document_by_yaml(
yaml, uri, cast(Optional[cwl_v1_2.LoadingOptions], loadingOptions)
)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 30779, in load_document_by_yaml
result, metadata = _document_load(
~~~~~~~~~~~~~~^
union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
loadingOptions,
^^^^^^^^^^^^^^^
)
^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 1040, in _document_load
loader.load(doc2, baseuri, loadingOptions, docRoot=baseuri),
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 808, in load
raise ValidationException("", None, errors, "*")
schema_salad.exceptions.ValidationException: mpich-mpirun-mpi-requirement.cwl:9:1: Object `mpich-mpirun-mpi-requirement.cwl` is not valid
because:
mpich-mpirun-mpi-requirement.cwl:51:1: the `requirements` field is not valid because:
Expected a <class 'NoneType'> but got list
Traceback (most recent call last):
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/bin/toil-cwl-runner", line 6, in <module>
sys.exit(main())
~~~~^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/toil/cwl/cwltoil.py", line 4466, in main
try_prepull(uri, runtime_context, expected_config.batchSystem)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/toil/cwl/cwltoil.py", line 289, in try_prepull
call_command(["cwl-docker-extract", cwl_tool_uri])
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/toil/lib/misc.py", line 218, in call_command
raise CalledProcessErrorStderr(
proc.returncode, cmd, output=stdout, stderr=stderr
)
toil.lib.misc.CalledProcessErrorStderr: Command '['cwl-docker-extract', 'file:///pfs/lustrep4/projappl/project/<USER>/cwl/cwl-mpi/workflows/mpich-sr/mpich-mpirun-mpi-requirement.cwl']' exit status 1: Traceback (most recent call last):
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/bin/cwl-docker-extract", line 6, in <module>
sys.exit(main())
~~~~^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/docker_extract.py", line 140, in main
run(arg_parser().parse_args(sys.argv[1:]))
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/docker_extract.py", line 56, in run
top = cwl.load_document_by_uri(args.input)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 328, in load_document_by_uri
return load_document_by_string(
loadingOptions.fetcher.fetch_text(real_uri),
...<3 lines>...
load_all,
)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 365, in load_document_by_string
return load_document_by_yaml(result, uri, loadingOptions, id_, load_all)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/__init__.py", line 390, in load_document_by_yaml
result = cwl_v1_2.load_document_by_yaml(
yaml, uri, cast(Optional[cwl_v1_2.LoadingOptions], loadingOptions)
)
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 30779, in load_document_by_yaml
result, metadata = _document_load(
~~~~~~~~~~~~~~^
union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader_or_array_of_union_of_CommandLineToolLoader_or_ExpressionToolLoader_or_WorkflowLoader_or_OperationLoader_or_ProcessGeneratorLoader,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
loadingOptions,
^^^^^^^^^^^^^^^
)
^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 1040, in _document_load
loader.load(doc2, baseuri, loadingOptions, docRoot=baseuri),
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/project/project/<USER>/cwl/cwl-mpi/cwl-conformance-tests/runs/venv-toil/lib/python3.13/site-packages/cwl_utils/parser/cwl_v1_2.py", line 808, in load
raise ValidationException("", None, errors, "*")
schema_salad.exceptions.ValidationException: mpich-mpirun-mpi-requirement.cwl:9:1: Object `mpich-mpirun-mpi-requirement.cwl` is not valid
because:
mpich-mpirun-mpi-requirement.cwl:51:1: the `requirements` field is not valid because:
Expected a <class 'NoneType'> but got list
I think cwltool or cwl_utils may have changes that are not compatible with the current version of Toil?
Hi,
There is a pull request in the cwltool repository, common-workflow-language/cwltool#2216, that detects when the tool or workflow uses the
cwltool:MPIRequirementwith Singularity. That pull request is needed to use a wrapper instead of executing Singularity directly.The wrapper script gets a list of env vars in the environment before, and after launching mpirun, and then passes the different (i.e., the env vars added by MPI) to
cwltool. This is necessary as cwltool uses the --cleanenv and other flags to isolate the execution, but without the MPI env vars the MPI server and ranks fail to communicate.I'm using Toil 9.4.1 on CSC LUMI,
and I tried to simply do a
cd cwltool-folder-with-that-pullrequest-branch && pip install -e ..But running a test workflow I'm getting the following error:
I think cwltool or cwl_utils may have changes that are not compatible with the current version of Toil?
Cheers
┆Issue is synchronized with this Jira Story
┆Issue Number: TOIL-1838