Skip to content

SLURMCluster - number of tasks requirement #62

Closed

Description

@AdamWlodarczyk

Hi,
I've got a question/problem - what is the reason of hard-coding the number of tasks to 1?
This is problematic in some way for me because in my scenario I want to run multiple-node jobs and it is impossible with current generation of job_header.
Example:
I have a cluster of nodes with 24 CPUs per each and initialize my SLURMCluster like that

from dask.distributed import Client
from dask_jobqueue import SLURMCluster
cluster = SLURMCluster(name='dask_test',
                       queue='qwe123',
                       memory='1GB',
                       processes=48, # 2 times 24 since I want double-node job
                       threads=2, # combined with number of processes gives 96 cores
                       interface='ib0',
                       walltime='00:10:00',
                       job_cpu=1, # 1 CPU per each task
                       job_extra=['--nodes=2', '--ntasks-per-node=24']) 

Such declaration gives me following job header:

In [22]: cluster.job_header
Out[22]: '#SBATCH -J dask_test\n#SBATCH -e dask_test.err\n#SBATCH -o dask_test.out\n#SBATCH -p qwe123\n#SBATCH -n 1\n#SBATCH --cpus-per-task=1\n#SBATCH --mem=45G\n#SBATCH -t 00:10:00\n#SBATCH --nodes=2\n#SBATCH --ntasks-per-node=24'

And because of -n argument it won't create double-node jobs. So I've got to remove that from job header manually.

Maybe the number of tasks should be also an argument for cluster initialization and if it will be None the -n sbatch argument would not appear in job header? What I mean is a more flexible way of job_header creation.

Activity

  1. mrocklin commented on May 18, 2018

    @mrocklin
    Member
  2. AdamWlodarczyk commented on May 18, 2018

    @AdamWlodarczyk
    Author

    Got it but I am talking about case when I want to run a dask-worker within multiple-node environment created by sbatch script (e.g. task requires more CPUs than one node has).
    cc @ocaisa

  3. mrocklin commented on May 18, 2018

    @mrocklin
    Member

    Each dask worker only runs on a single node. Dask-jobqueue works by submitting many single-node scripts, one for each dask worker. The dask workers will connect up to each other after they start.

    You're still going to have many nodes that will communicate with each other, you're just going to get these many nodes by asking for them one-at-a-time

  4. AdamWlodarczyk commented on May 18, 2018

    @AdamWlodarczyk
    Author

    I see. Well, thanks for clarification. Issue can be closed.
    Great package BTW!

  5. ocaisa commented on May 18, 2018

    @ocaisa
    Member

    What @AdamWlodarczyk is trying to describe is the case where each we want a single Dask worker for a set of nodes attached to a single job. Our use case is a task that forks out an srun process which can consume the entire resources allocated to the job. The current syntax doesn't allow us to do this since we would need to overwrite the #SBATCH -n 1\n#SBATCH --cpus-per-task=1...but come to think of it, I wonder if we can just override the default values via job_extra

  6. guillaumeeb commented on May 18, 2018

    @guillaumeeb
    Member

    As @mrocklin mentionned, this was not the initial idea of dask-jobqueue to launch multi nodes job at once. I believe this is also because initial development was done with PBS if I am not mistaken.

    From the few I've seen, Slurm is much more powerfull and versatile, and it is probably possible to easily launch jobs that spawn dask-worker processes on multiple nodes at once. By easily I mean just by slightly modifying the job script.

    Feel free to work on a pull request doing this 🙂 ! This could be a nice option.

  7. mrocklin commented on May 18, 2018

    @mrocklin
    Member

    Is there an advantage to running few jobs that launch multiple dask-workers vs many jobs that launch one dask-worker each?

  8. guillaumeeb commented on May 19, 2018

    @guillaumeeb
    Member

    The case I can think of is if you want to be sure to have a given computing power for a known amount of time.

    Dask-jobqueue is great for interactive analysis, where we can varry the number of workers. But in some production cases, we may want to know for sure we have a fixed amount of resources for a computation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions