[FluxScriptAdapter] Resources specified as a parameter are strings and break int comparisons
- Dominant language
- Python
- Stars
- 161
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
When testing a specification with Flux, I ran into the case where a parameterized resource field was carried through as a string. The adapter should probably try and cast the resources to their appropriate type instead of assuming the data type will be right.
```
2021-08-04 16:02:53,330 - maestrowf.conductor:main:387 - ERROR - ("'>' not supported between instances of 'str' and 'int'",)
Traceback (most recent call last):
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/conductor.py", line 382, in main
completion_status = conductor.monitor_study()
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/conductor.py", line 352, in monitor_study
completion_status = dag.execute_ready_steps()
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/datastructures/core/executiongraph.py", line 920, in execute_ready_steps
self._execute_record(_record, adapter)
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/datastructures/core/executiongraph.py", line 589, in _execute_record
retcode = record.execute(adapter)
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/datastructures/core/executiongraph.py", line 112, in execute
retcode, jobid = self._execute(adapter, self.script)
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/datastructures/core/executiongraph.py", line 142, in _execute
self.step, script, self.workspace.value)
File "/usr/WS2/fdinatal/pyenv/blueos_3_ppc64le_ib_p9/versions/3.6.9/envs/maestrowf/lib/python3.6/site-packages/maestrowf/interfaces/script/fluxscriptadapter.py", line 208, in submit
if processors > 0 and processors > ncores:
TypeError: '>' not supported between instances of 'str' and 'int'
2021-08-04 16:02:53,398 - maestrowf.conductor:main:391 - INFO - Study exiting, cleaning up...
```
Contributor guide
Research direction
Start in maestrowf/interfaces/script/fluxscriptadapter.py around line 208, where submit compares processors with integer values. Trace how parameterized resource values reach processors and verify that numeric resources are converted before comparison. Done means the reported string-versus-int TypeError no longer occurs for parameterized resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100