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

[testing] Compare to parsl #91

Open
jan-janssen opened this issue Jun 14, 2023 · 0 comments
Open

[testing] Compare to parsl #91

jan-janssen opened this issue Jun 14, 2023 · 0 comments

Comments

@jan-janssen
Copy link
Member

jan-janssen commented Jun 14, 2023

#!/bin/env python3

import os

import parsl
from parsl.app.app import python_app, bash_app
from parsl.config import Config
from parsl.channels import LocalChannel
from parsl.providers import SlurmProvider
from parsl.executors import FluxExecutor
from parsl.launchers import SimpleLauncher
from parsl.addresses import address_by_hostname
from parsl.data_provider.files import File

# Update to import config for your machine
config = Config(
    executors=[
        FluxExecutor(
            label="hera_flux",
#            launch_cmd='{flux} start -v 2 {python} {manager} {protocol} {hostname} {port}', 
            launch_cmd='srun --tasks-per-node=1 ' + FluxExecutor.DEFAULT_LAUNCH_CMD,
            provider=SlurmProvider(
                channel=LocalChannel(),
                nodes_per_block=2,
                init_blocks=1,
                partition='pdebug',
                walltime='00:10:00',
                launcher=SimpleLauncher(),
            ),
        )
    ],
)




parsl.load(config)

remote = False
shared_dir = "/usr/workspace/corbett8/Flux/"


@python_app
def py_mpi(parsl_resource_specification={}):
    from mpi4py import MPI

    return MPI.COMM_WORLD.Get_size(), MPI.COMM_WORLD.Get_rank()



print(py_mpi(parsl_resource_specification={"num_tasks": 6}).result())

parsl.clear()
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

No branches or pull requests

1 participant