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

Script job support MPI run #637

Merged
merged 3 commits into from Jan 25, 2022
Merged

Script job support MPI run #637

merged 3 commits into from Jan 25, 2022

Conversation

jan-janssen
Copy link
Member

Based on our discussion I extended the script job class to support MPI4py to at least have a quick way to use pyiron for an high throughput study.

import os
from pyiron_base import Project

script_py = """\
from mpi4py import MPI

comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()

print(size, rank)
"""

file_name = "test.py"
with open(file_name, "w") as f:
    f.writelines(script_py)

pr = Project("test")
job = pr.create.job.ScriptJob("script")
job.script_path = os.path.abspath(file_name)
job.server.cores = 2
job.enable_mpi4py()
job.run()

jan-janssen and others added 3 commits January 17, 2022 09:00
```
import os
from pyiron_base import Project

script_py = """\
from mpi4py import MPI

comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()

print(size, rank)
"""

file_name = "test.py"
with open(file_name, "w") as f:
    f.writelines(script_py)

pr = Project("test")
job = pr.create.job.ScriptJob("script")
job.script_path = os.path.abspath(file_name)
job.server.cores = 2
job.enable_mpi4py()
job.run()
```
@jan-janssen jan-janssen merged commit f696ca0 into master Jan 25, 2022
@delete-merged-branch delete-merged-branch bot deleted the script_mpirun branch January 25, 2022 03:43
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.

None yet

1 participant