Repository navigation
Description
On an SGE cluster, requested memory is specified by using the -l flag. The exact keyword that gets used to assign memory can change from configuration to configuration; as such, it would be difficult to assume a standard string name. For example, some clusters use m_mem_free=2G, some use mem_free=2G, and others may have a different configuration.
With the SGECluster object, however, it appears that the amount of memory specified has to be passed into the memory= kwarg alongside the resource_spec string, which means that it is possible for a user to have discordant memory requested.
cluster = SGECluster(queue='our.q',
walltime="259200",
processes=1,
cores=1,
# this appears to be for Dask usage only
memory='4GB',
# this is what actually gets used by the SGE schedule
resource_spec='m_mem_free=2G',
)This gives the following job script:
#!/bin/bash
#!/usr/bin/env bash
#$ -N dask-worker
#$ -q default.q
#$ -l m_mem_free=2G
#$ -l h_rt=259200
#$ -cwd
#$ -j y
. /home/maer3/github/research/cadd-ns-nav1.1/custom_env.sh
/home/maer3/anaconda/envs/nav/bin/python -m distributed.cli.dask_worker tcp://10.145.61.204:40499 --nthreads 1 --memory-limit 4.00GB --name dask-worker--${JOB_ID}-- --death-timeout 60
As far as I can see, I have requested for 2 GB of RAM from the scheduler (per worker), while the --memory-limit 4.00GB is reflected from the memory kwarg.
Am I understanding correctly that a dask worker will think that it has 4GB of RAM, even though in reality it only was assigned 2GB here? Does this also mean, then, that if the worker is filled at 2GB of usage, the dashboard will only show 50% utilization (which would be incorrect)?
The other UI/UX issue here is that of the API - there is duplication here in specifying the memory & resource_spec kwargs separately. The best idea I have at the moment is to improve the documentation as it currently stands, such that it reflects this necessity. Might there be a better way to reduce this duplication?
Activity
lesteve commentedon Jan 15, 2019
memory: they will think they have 4GB of RAM. This is relevant for dask memory management.resource_specis used only by the scheduler. The impact depends on your scheduler configuration.mem_reqis required on my cluster and I think it is purely declarative: it is only used to find a node where there is supposed to be enough RAM available according to what all the running jobs have theirmem_reqset to.mem_reqwill not be used as a hard memory limit to kill your job if its memory usage goes overmem_req.Agreed about the duplication but I don't see a straightforward way to fix it because of the variety of configurations that GE and derivatives seems to have (not an expert at all I am just discovering this as we go ...).
Doc improvements would be very welcome! One caveat is that this is a bit
SGECluster-specific: my understanding is thatmemorywill be passed to the scheduler by other dask-jobqueue*Cluster(I checked and that's the case for SLURMCluster and PBSCluster).I would suggest either:
SGEClustercaveat in .rst docsSGEClusterdocstring to explain thatmemoryis only used for dask memory management. We are usingdocrepto reuse docstrings fromJobQueueClusterin derived classes. There may be a way to tweak part of theSGEClusterdocstring withdocrep, not sure.ericmjl commentedon Jan 15, 2019
@lesteve thanks for your response!
I believe this is the lightest-weight way to inform users of this issue. I will close my other PR - it's irrelevant for this - and submit a new one.
Most users, including myself, will probably copy/paste and tweak the example on the Example Deployments page, so that will definitely have to be changed; additionally, a line in the docstring is probably the other place I will make a PR.
guillaumeeb commentedon Jan 16, 2019
You should also document the way to specify the requested CPU. SGECluster currently relies entirely on
resource_speckwarg for resource limitation/provisionning. But maybe you plan to propose or discuss about this in another issue?Things would probably be easier if we implemented #133, users would then be able to customize launch script header to fit their cluster.
lesteve commentedon Jan 16, 2019
Good point, maybe in a different issue. AFAIK this is even a greyer area. My understanding on our SGE cluster is that if you want to use multiple cores you are encouraged to do something like
qsub -pe serial <nb_cores>(AFAIK this is purely declarative nothing prevents you from not using this option and still use multiple cores).Note this is something separate than
resource_spec(resources_specuse-l) so you have to usejob_extrainSGECluster... alsoserialis the name of what SGE calls "parallel environment" that could well vary between different SGE clusters.I would be very happy to hear about @ericmjl's experience with CPU booking on his SGE-like (UnivaGE IIRC) cluster ...
Add a `job_extra` flag to the SGECluster