snakemake / snakemake-executor-plugin-slurm

A Snakemake executor plugin for submitting jobs to a SLURM cluster
MIT License
18 stars 19 forks source link

Make sure sbatch receives --comments correctly #118

Closed Zhongzheng99 closed 3 months ago

Zhongzheng99 commented 4 months ago

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 was f"--comment {comment_str}". It’s crucial to note that comment_str needs to be enclosed in quotes. If this is not done, it might cause sbatch to misinterpret comment_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:

SLURM job submission failed. The error message was sbatch: error: invalid account or account/partition combination specified sbatch: error: Batch job submission failed: Unspecified error

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 ...

Zhongzheng99 commented 4 months ago

117

Zhongzheng99 commented 3 months ago

Ah, this is a mistake because my account is in arrears.