コード例 #1
0
import numpy as np

from jobqueue_features.clusters import CustomSLURMCluster
from jobqueue_features.decorators import on_cluster, mpi_task
from jobqueue_features.mpi_wrapper import mpi_wrap
from jobqueue_features.functions import set_default_cluster

# import logging
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

HSW = True
KNL = True
GPU = True


set_default_cluster(CustomSLURMCluster)

if GPU:
    GROMACS_gpu_cluster = CustomSLURMCluster(
        name="GROMACS_gpu_cluster",
        walltime="00:15:00",
        nodes=2,
        mpi_mode=True,
        fork_mpi=True,
        queue_type="gpus",
        maximum_scale=5,
        env_extra=[
            "module --force purge",
            "module use /usr/local/software/jureca/OtherStages",
            "module load Stages/Devel-2019a",
            "module load Intel",
コード例 #2
0
from __future__ import print_function
import time

from jobqueue_features.decorators import on_cluster, task
from jobqueue_features.functions import set_default_cluster
from jobqueue_features.clusters import CustomSLURMCluster

# import logging
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

# set_default_cluster(LocalCluster)  # set LocalCluster as default cluster type
set_default_cluster(
    CustomSLURMCluster)  # set CustomSLURMCluster as default cluster type


@on_cluster()
@task()
def square(x):
    return x**2


@on_cluster(cluster_id="other",
            cluster=CustomSLURMCluster(name="other", walltime="00:04:00"))
@task(cluster_id="other")
def inc(x):
    return x + 1


def main():
    sq_tasks = list(map(square, range(1, 11)))
    inc_tasks = list(map(inc, range(1, 11)))
コード例 #3
0
from __future__ import print_function
import os

from dask.distributed import LocalCluster

from jobqueue_features.decorators import on_cluster, mpi_task
from jobqueue_features.mpi_wrapper import mpi_wrap, MPIEXEC
from jobqueue_features.functions import set_default_cluster

# import logging
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

set_default_cluster(LocalCluster)


@mpi_task()
def mpi_wrap_task(**kwargs):
    return mpi_wrap(**kwargs)


@on_cluster()
def main():
    script_path = os.path.join(os.path.dirname(__file__), "resources",
                               "helloworld.py")
    t = mpi_wrap_task(executable="python",
                      exec_args=script_path,
                      mpi_launcher=MPIEXEC)
    print(t.result())


if __name__ == "__main__":
コード例 #4
0
from __future__ import print_function
import time

from dask.distributed import LocalCluster

from jobqueue_features.decorators import on_cluster, task
from jobqueue_features.functions import set_default_cluster

# import logging
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

set_default_cluster(LocalCluster)  # set LocalCluster as default cluster type


@task()
def square(x):
    return x**2


@on_cluster()
def main():
    sq_tasks = list(map(square, range(1, 11)))
    print([t.result() for t in sq_tasks])


if __name__ == "__main__":
    start = time.time()
    main()
    print("Executed in {}".format(time.time() - start))