Snakemake-Profiles / slurm

Cookiecutter for snakemake slurm profile
MIT License
126 stars 44 forks source link

Fails with many input files #87

Closed alanocallaghan closed 2 years ago

alanocallaghan commented 2 years ago

I think this may be a general snakemake issue rather than with this profile specifically, but I'm not a python expert.

I have a rule that runs c. 100k jobs and uses all of them together as input to a new rule. Because the input is expanded to 100k items, and the job properties (including input) are written to the jobscript, this means that the jobscript is way over the file size limit for sbatch. This means you get the error :

sbatch: error: Batch job submission failed: Pathname of a file, directory or other parameter too long

My naive solution was to try removing the bit where the job properties are written to the jobscript, but this doesn't work because that's where the properties are later read from to set cluster parameters by slurm-utils. Other than that I'm not quite sure what to do, other than maybe deling some of the properties and then re-writing the jobscript just before submission.

jdblischak commented 2 years ago

My naive solution was to try removing the bit where the job properties are written to the jobscript

@Alanocallaghan In case it could be helpful, I put together an example with my smk-simple-slurm profile that uses your idea of a custom jobscript to submit a job with 150k input files:

https://github.com/jdblischak/smk-simple-slurm/tree/main/examples/many-input-files

percyfal commented 2 years ago

@Alanocallaghan indeed I think this require some custom solution as @jdblischak suggests. Does his solution solve your problem?

alanocallaghan commented 2 years ago

Didn't test it yet tbh, I just used a temp hack to get around it

alanocallaghan commented 2 years ago

Yeah works okay, I ended up refactoring the code to avoid this issue anyways... closing the issue as I don't think it'll be resolved.

mufernando commented 1 year ago

Thanks @Alanocallaghan and @jdblischak. This issue was really helpful!

mbhall88 commented 1 year ago

FYI https://github.com/snakemake/snakemake/pull/2149 will fix this when/if it is merged

mbhall88 commented 1 year ago

snakemake v7.24.0 should not have this problem now 🎉