Skip to content

rename job_extra - #577

Merged
guillaumeeb merged 14 commits into
dask:mainfrom
jolange:renaming
Aug 24, 2022
Merged

guillaumeeb merged 14 commits into
dask:mainfrom
jolange:renaming

Conversation

@jolange

@jolange jolange commented Aug 19, 2022

Copy link
Copy Markdown
Contributor

to job_extra_directives, see #323.

If job_extra_directives is empty, job_extra will still be respected.

The warning code is duplicated for different *Cluster classes now. I thought about putting it in the base class, but that does not know this parameter (almost all implentations define it, but not all) and it is not treated exactly the same everywhere.
So I think the repetition is ok for this temporary code.

@guillaumeeb

Copy link
Copy Markdown
Member

Thanks @jolange for continuing work here, I really appreciate it.

The warning code is duplicated for different *Cluster classes now. I thought about putting it in the base class, but that does not know this parameter (almost all implentations define it, but not all) and it is not treated exactly the same everywhere

With a quick glance, I'm not sure why it is duplicated and not in the base class. Do you think something prevent to declare a private attribute in the main class, putting the warning in there, and just keep special handling in defferent implementations?

@jolange

jolange commented Aug 22, 2022

Copy link
Copy Markdown
Contributor Author

I did not check in detail before, which *Cluster classes do not implement it, but it now I see that it's actually only Moab and that this basically is PBS. So all of them use the parameter, really.

The only problem is that the parameter is supposed to be a dict for HTCondor, but a list for every other one.

@guillaumeeb

Copy link
Copy Markdown
Member

The only problem is that the parameter is supposed to be a dict for HTCondor, but a list for every other one.

I guess this is a problem only for the doc string or warning message? Maybe we could indicate list or dict as type?

I'm not sure if we should duplicate code just for this? Or maybe we should just do something for the HTCondor specific case?

@jolange

jolange commented Aug 22, 2022

Copy link
Copy Markdown
Contributor Author

Only for the doc string, actually. Indicating "dict or list" would be ok, I think, but the doc strings for the *Cluster classes are rather different (and rightfully so, I think):

$ ack "job_extra_directives : " dask_jobqueue/*.py -A2
dask_jobqueue/htcondor.py
245:    job_extra_directives : dict
246-        Extra submit file attributes for the job as key-value pairs.
247-        They will be inserted as ``key = value``.

dask_jobqueue/lsf.py
211:    job_extra_directives : list
212-        List of other LSF options, for example -u. Each option will be
213-        prepended with the #LSF prefix.

dask_jobqueue/oar.py
134:    job_extra_directives : list
135-        List of other OAR options, for example `-t besteffort`. Each option will be prepended with the #OAR prefix.
136-

dask_jobqueue/pbs.py
143:    job_extra_directives : list
144-        List of other PBS options. Each option will be prepended with the #PBS prefix.
145-

dask_jobqueue/sge.py
117:    job_extra_directives : list
118-        List of other SGE options, for example -w e. Each option will be
119-        prepended with the #$ prefix.

dask_jobqueue/slurm.py
148:    job_extra_directives : list
149-        List of other Slurm options, for example -j oe. Each option will be prepended with the #SBATCH prefix.
150-

What do you think about making it a parameter of the base class and store it as member variable, but keeping the doc string in the different base classes? Maybe adding a comment to the parameter in the base class where the doc string(s) can be found?

@guillaumeeb

Copy link
Copy Markdown
Member

Sounds good. We should put a generic doc string in the base class, and some more complete description in each cluster implementation.

@jolange

jolange commented Aug 23, 2022

Copy link
Copy Markdown
Contributor Author

Ok, I pushed a proposal, now.

@guillaumeeb guillaumeeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good, I've just got a comment on default values, both in the code and in the config file.

Comment thread dask_jobqueue/core.py Resolved
Comment thread dask_jobqueue/jobqueue.yaml Resolved
@guillaumeeb

Copy link
Copy Markdown
Member

Thanks a lot @jolange for sticking with that!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants