-
Notifications
You must be signed in to change notification settings - Fork 3
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
[documentation] Example usage help needed #381
Comments
import subprocess
from executorlib import Executor
def run_external():
return subprocess.check_output("mpiexec -n 4 hostname", shell=True)
with Executor(max_cores=4, backend="local") as exe:
future = exe.submit(run_external, resource_dict={"cores": 1})
print(future.result()) The import subprocess
import flux.job
from executorlib import Executor
def run_external():
return subprocess.check_output("mpiexec -n 4 hostname", shell=True)
with flux.job.FluxExecutor() as flux_exe:
with Executor(max_cores=4, executor=flux_exe) as exe:
future = exe.submit(run_external, resource_dict={"threads_per_core": 4})
print(future.result()) It is important that we define Finally, on flux to validate your resource usage you can use:
This should print something like:
|
I added a separate section in the updated documentation to discuss the interface to external executables: |
Thanks for this nice package
I want to run a command line tool with the following run command
mpiexec -n 4 tool_name inputfile
from a jupyter notebook on my workstation. Is executorlib the right tool for this? If so, would it be possible to give a small example on how this can be run?Thanks!
The text was updated successfully, but these errors were encountered: