Skip to content

Instantly share code, notes, and snippets.

@vivek-bala
Created September 28, 2018 19:33
Show Gist options
  • Save vivek-bala/f07069c80217a467dd2c0305f89d8a33 to your computer and use it in GitHub Desktop.
Save vivek-bala/f07069c80217a467dd2c0305f89d8a33 to your computer and use it in GitHub Desktop.
from mpi4py import MPI
import socket
import subprocess
import sys
if __name__ == '__main__':
threads = sys.argv[1]
duration = sys.argv[2]
comm = MPI.COMM_WORLD
print "Hello! I'm rank %d from %d running on %s" % (comm.rank, comm.size, socket.gethostname())
subprocess.call(['/ccs/proj/bip149/stress-ng-0.09.34/stress-ng','-c', threads, '-t', duration])
comm.Barrier() # wait for everybody to synchronize _her
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment