Make sure sbatch receives --comments correctly #118
Closed
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.
I’ve resolved the issue, and it turns out that the problem was not with the account and partition not being input correctly. The actual issue was with the
--comment
parameter in the sbatch command. In the original__init__.py
file, line 133 wasf"--comment {comment_str}"
. It’s crucial to note thatcomment_str
needs to be enclosed in quotes. If this is not done, it might cause sbatch to misinterpretcomment_str
, leading to the -A and -p parameters (which specify the account and partition) being incorrectly associated with the--comment
parameter. This would result in the following WorkflowError:To fix the issue, the line in the init.py file should be modified to ensure that comment_str is properly quoted, like so:
f"--comment=`{comment_str}`"
Note: it’s important to use the
=
sign to properly assign the value to the--comment
option in the sbatch command.By making this change, sbatch will correctly interpret the --comment parameter and subsequent -A and -p parameters, allowing the job to be submitted without errors.
The final command passed to sbatch would then be correctly formatted, like so:
sbatch --comment=`Y{comment_str}` -A your_account -p your_partition ...