Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed single task execution #399

Open
amarzullo24 opened this issue Dec 30, 2020 · 2 comments
Open

Distributed single task execution #399

amarzullo24 opened this issue Dec 30, 2020 · 2 comments
Labels
question Further information is requested

Comments

@amarzullo24
Copy link

amarzullo24 commented Dec 30, 2020

Dear all,
I have a question regarding the execution of single tasks in different machines running Pydra.
More specifically, I was wondering whether tasks requiring high computational power can be distributed to more powerful (HPC) machines.

Reading the API documentation and following the interactive tutorial, I understood that an experimental distributed execution of single tasks could be achieved by using ConcurrentFutures, SLURM or Dask. However, I was not able to find any specific example about how to use it.

By setting the parameter of the Submitter plugin="dask", for example, a DaskWorker can be instantiated. However, is not clear whether this can be useful to achieve my goal.

Thanks in advance for your help!

@amarzullo24 amarzullo24 added the question Further information is requested label Dec 30, 2020
@djarecka
Copy link
Collaborator

djarecka commented Jan 6, 2021

Hi @emmeduz, thank you for your question. DaskWorker after recent changes is not well tested, but you should be able to use ConcurentFutures and Slurm. The task are automatically distributed for task wit splitter (see examples here) and for Workflows (see example here).
If some examples do not specify any plugin then ConcurentFutures (or cf) is used automatically.

Please let me know if this answer your question

@amarzullo24
Copy link
Author

Dear @djarecka, thank you for your prompt reply!
I have practiced with those examples, however it is not yet clear how the Slurm or ConcurrentFutures plugin can be exploited to distribute the task on different machines (e.g. I cannot find any example about how to specify the destination address).

I was studied a bit Dask, even if I know it is not well tested yet, and I found out a workaround as follows:

import nest_asyncio
import pydra
from dask.distributed import Client, LocalCluster

nest_asyncio.apply()

# define a pydra task
@pydra.mark.task

def f(x):
   return x + 1

task1 = f(x=0)

# create a Submitter using Dask as backend
with pydra.Submitter(plugin="dask", address='127.0.0.1:1234') as sub:
   sub(task1)

# gather the task execution results
task1.result()

Do you think is it possible doing something similar using Slurm or ConcurrentFutures?

Thanks for all your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants