Skip to content

Default to multiprocesses instead of single process - #334

Closed
jennirinker wants to merge 3 commits into
dask:masterfrom
jennirinker:multiproc_default
Closed

jennirinker wants to merge 3 commits into
dask:masterfrom
jennirinker:multiproc_default

Conversation

@jennirinker

@jennirinker jennirinker commented Sep 8, 2019 •

Copy link
Copy Markdown

Resolving #332 .

This configuration change in JobQueueCluster changes the default processes per job so that they follow the same heuristic as dask (proc=cores for cores <= 4, otherwise it's the smallest factor greater than the square root of cores).

PR also includes modified documentation (though it doesn't explain the heuristic -- perhaps that should be done on dask's docs and we link it?).

@jennirinker jennirinker changed the title Resolving Issue #332 Default to multiprocesses instead of single process Sep 8, 2019

@willirath willirath left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great and is good to go from my point of view. Thanks!

We could think about adding a test that ensures the new behavior.

@mrocklin

mrocklin commented Sep 8, 2019 via email

Copy link
Copy Markdown
Member

@jennirinker

Copy link
Copy Markdown
Author

Ack, I already wrote and pushed the new test. Well, that's ok if this never gets merged, it was a good test-run for me on contributing.

Cluster(cores=4)


def test_default_workers():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could modify this further to cover all clusters:

@pytest.mark.parametrize(
    "Cluster",
    [PBSCluster, MoabCluster, SLURMCluster, SGECluster, LSFCluster, OARCluster],
)
def test_default_workers(Cluster):
    """For 6 cores, default is 1 workers with 3 procs, 2 threads/proc"""
    with Cluster(cores=6, memory="4GB") as cluster:
        assert " --nprocs 3" in cluster._command_template
        assert " --nthreads 2" in cluster._command_template

But let's only do this if there's agreement that this will be merged before the big rewrite.

@lesteve

lesteve commented Sep 9, 2019

Copy link
Copy Markdown
Member

Well, that's ok if this never gets merged, it was a good test-run for me on contributing.

Thanks a lot for the PR @jennirinker! I am confident that this will get merged since this is something we want to do as #332 indicates.

I agree with @mrocklin that this is a good idea to first merge #307. Once #307 is merged this PR may need to be tweaked a bit but I expect that it should not be too much work.

@lesteve

lesteve commented Sep 9, 2019

Copy link
Copy Markdown
Member

@jennirinker side-comment: Please use "Fix #issueNumber" in your PR description, this way the associated issue gets closed automatically when the PR is merged. For more details, look at this.

Using anything more fancy e.g. "resolving issue #issueNumber" does not work unfortunately. I updated your PR description.

@jennirinker

Copy link
Copy Markdown
Author

@lesteve Ah, thanks. I was close -- "resolve" instead of "resolving" and I would've had it. Next time.

@lesteve

lesteve commented Sep 9, 2019 •

Copy link
Copy Markdown
Member

No worries, this is the kind of caveats that trip everyone up once in a while ...

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.

4 participants