Skip to content

Run on clusters using Dask - #13

Merged
ale94mleon merged 5 commits into
ale94mleon:release/v4.0.0from
w8jcik:add/dask
Aug 8, 2025
Merged

Run on clusters using Dask#13
ale94mleon merged 5 commits into
ale94mleon:release/v4.0.0from
w8jcik:add/dask

Conversation

@w8jcik

@w8jcik w8jcik commented Jul 31, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@w8jcik w8jcik changed the title Draft: Run on clusters using Dask Run on clusters using Dask Aug 1, 2025

@ale94mleon ale94mleon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The same popc = runner.run(self.__costfunc__, args_list) logic can be applied to utils.Local.

Comment thread src/moldrug/runner.py Outdated
elif mode in [RunnerMode.MULTIPROCESSING]:
assert thread_count is None and process_count is not None and dask_cluster is None, "Only process count is needed."
elif mode in [RunnerMode.DASK_LOCAL]:
assert (thread_count is not None or process_count is None) and dask_cluster is None, "Only process count and/or thread count are needed."

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

(thread_count is not None or process_count is not None)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread src/moldrug/utils.py
def __call__(self, njobs: int = 1, runner: Optional[Runner] = None):
"""Call definition

Parameters

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Description of runner parameter is missed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

Comment thread docs/source/CHANGELOG.md Outdated

- Cluster configuration can be provided to calculate cost function on multiple nodes of a cluster.
Cluster support requires installation of optional packages related to Dask, a package set called `cluster`.
```

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Add an empty line and "```python"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, pip install moldrug[cluster] is not Python code. I assume you mean sh

Added

```sh

@ale94mleon
ale94mleon changed the base branch from main to release/v4.0.0 August 8, 2025 12:10
@ale94mleon ale94mleon added this to the v4.0.0 milestone Aug 8, 2025
@w8jcik

w8jcik commented Aug 8, 2025

Copy link
Copy Markdown
Contributor Author

Added runner to utils.Local.

@w8jcik
w8jcik requested a review from ale94mleon August 8, 2025 14:03
@ale94mleon

Copy link
Copy Markdown
Owner

I tried out RunnerMode.DASK_LOCAL.

from moldrug import utils
from moldrug.runner import RunnerMode, Runner

ga = utils.GA(<initialization>)

runner_instance = Runner(
    mode=RunnerMode.DASK_LOCAL,
    process_count=6
)

ga(runner=runner_instance)

And I get the warning

UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 54889 instead

Every time a new generation is evaluated.

@ale94mleon ale94mleon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

All solved.

@ale94mleon
ale94mleon merged commit d939168 into ale94mleon:release/v4.0.0 Aug 8, 2025
1 check failed
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