Skip to content

Instantly share code, notes, and snippets.

@definitelyuncertain
definitelyuncertain / test-ray.py
Created January 23, 2019 07:10
Using ray with MPI: A simple counter object whose value is incremented in succession by 4 MPI processes
# Run as: mpirun -np <# of threads> python test-ray.py
from mpi4py import MPI
import os, sys, time
import numpy as np
import ray
@ray.remote
class Counter(object):
def __init__(self):