Rationaizing Resource Specification errors acorss executors. #3627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There are three places where the executors raise the errors regarding resource specification.
when passing the resource_specification parameter to the htex, it raises the mpi_prefix_composer InvalidResourceSpecification from validate_resource_spec method. https://github.com/Parsl/parsl/blob/master/parsl/executors/high_throughput/executor.py#L342
ThreadPoolExecutor also raises the UnsupportedFeatureError when passing resource specification to it, https://github.com/Parsl/parsl/blob/master/parsl/executors/threads.py#L54
WorkQueueExecutor raises two errors similar to this but as a Base ExecutorError, one when there is invalid resource_specification ; https://github.com/Parsl/parsl/blob/master/parsl/executors/workqueue/executor.py#L418 and another one when the autolabel is false and resource_specification is not right, https://github.com/Parsl/parsl/blob/master/parsl/executors/workqueue/executor.py#L429
This PR rationalize these errors by creating a
InvalidResourceSpecificationError
in executors.error and using it across the executors. MoreoverInvalidResourceSpecification
andMissingResourceSpecification
is removed from mpi_prefix_composer and places where the above two used were replaced withInvalidResourceSpecificationError
.Changed Behaviour
From this PR, All executors will raise
InvalidResourceSpecificationError
for errors regarding resource_spec.Fixes
Fixes #3589
Type of change