SSCHAcode / python-sscha

The python implementation of the Stochastic Self-Consistent Harmonic Approximation (SSCHA).
GNU General Public License v3.0
55 stars 21 forks source link

add Slurm QOS parameter support #120

Closed eliheady closed 1 year ago

eliheady commented 1 year ago

This adds support for the Slurm QOS parameter. This is an optional attribute: if no QOS value is given, the flag is not added to the job. This is useful if your cluster requires QOS to be set for certain partitions or if you have access to job priority that depends on a specific QOS setting in your batch scripts.

Usage:

my_cluster = Cluster(qos_name="dev", ...)

or

my_cluster = Cluster(...)
my_cluster.qos_name = "dev"

This will result in the following line being added to the generated batch jobs

#SBATCH --qos=dev

mesonepigreco commented 1 year ago

Thanks for this addition to the code! Indeed, it is good to have support for the qos as it is a very common setup. Rightnow, to add extra parameter not specifically accounted for in the clas, one should use the dictionary custom_params of the cluster class.

In the case of the qos, it would be like:

my_cluster.custom_params["qos"] = "dev" 

And it will add the related variable to the submission line

#SBATCH --qos=dev

So if you need more exotic options, you can use this way (no need to modify the class each time). I think I can merge this pull request as the commit seems correct.

eliheady commented 1 year ago

Fantastic, thanks for considering this change!