-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--slurm-logdir
not working when first keyword starts with /
#214
Comments
--slurm-logdir
not working when first keyword contains root--slurm-logdir
not working when first keyword contains /
--slurm-logdir
not working when first keyword contains /
--slurm-logdir
not working when first keyword starts with /
Thank you for brining this issue to our attention! Your minimal examples do not show the setting of the logdir. Perhaps you can show how and where (on the command line, in a configuration file) your logdir is set and what its value is? |
I set the slurm-logdir with This was functional on my cluster: (with not-generalized paths, so that it actually runs)
and logged to while
run in the same way logged to |
I'm running it with a profile now and this is just making me very confused and i don't fully understand what's going on.
logs to Additionally, I feel this is partially due to paths in the wildcards also remaining as paths in the log file name. This also causes for me very indented log files even with functional Thanks for quickly replying and looking into it! 😁 |
Ah, sorry. Now, I begin to see your point. The SLURM logfile internally starts with the slurm_logfile = self.slurm_logdir / group_or_rule / wildcard_str / "%j.log" This is path concatenation using Python's Consider: >>> p = Path("/home/someone")
>>> l = p / 'b' / 'test'
>>> print(l)
/home/someone/b/test
>>> l = p / 'b' / '/test'
>>> print(l)
/test So, indeed, when a wildcard will start with a slash, the SLURM log directory, will start with One might want to consider this a bug in Python, as Now, I could implement a check to prevent wildcards from starting with |
Ah okay, that makes sense; For me the arguments for different/configurable logpath would be unrelated to this issue, i can open a new issue for this. |
Yes, you can open new issues. Yes, it seems easy to have a solution by replacing it here. I do not know whether there will be repercussions somewhere else in Snakemake's code. It is, therefore, that I started a discussion in the main repo. So: Is there a reason to let a wildcard start with a special character? |
I think it would be unintuitive to have the restriction, but also don't think there's another very strong argument for it. |
This is a minor fix, which addresses issue #214: A slurm logdirectory will start with `/` if a wildcard starts with `/`. After discussing with @johanneskoester , allowing for slashes in wildcards should not be an issue. Hence, the escape in this PR. Also, snakemake/snakemake#3318 can be considered solved. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced functionality for requesting GPU resources in SLURM jobs, with detailed documentation on methods for specifying GPUs and associated CPU settings. - **Bug Fixes** - Improved handling of job resource specifications to enforce clarity between GRES and GPU inputs, preventing potential conflicts. - **Dependencies** - Updated the version of the `snakemake-executor-plugin-slurm-jobstep` dependency from `^0.2.0` to `^0.3.0`, which may include enhancements and bug fixes. - **Documentation** - Added a new section on "GPU Jobs" outlining how to request GPU resources with examples and clarifications on resource specifications. - **Tests** - Removed unnecessary import from test files, streamlining the test code without affecting functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Software Versions
snakemake
8.28snakemake-executor-plugin-slurm
0.15.1slurm
24.05.4Describe the bug
When the first wildcard starts with
/
the--logdir
redirection gets overwritten and the concatenation of wildcards is interpreted as a rooted path.Minimal example
This writes log files to
/rootname/folder1/_folder_to_wildcard/%J.log
, where %J is jobid, even if--logdir
is set.similarly, this writes logs to /folder1/_folder_to_wildcard
--slurm-logdir
gets successfully set in this, although due to the concatenation of wildcards, you do get them at slurm_logdir/rulename/rootname/folder1/_folder/%J.logThe text was updated successfully, but these errors were encountered: