Skip to content

Instantly share code, notes, and snippets.

@basnijholt
Last active December 13, 2019 14:41
Show Gist options
  • Select an option

  • Save basnijholt/02ecc6f95abc687a925c23c6ee83e84a to your computer and use it in GitHub Desktop.

Select an option

Save basnijholt/02ecc6f95abc687a925c23c6ee83e84a to your computer and use it in GitHub Desktop.
testing-mpi4py
from mpi4py.futures import MPIPoolExecutor
def test(x):
import time
time.sleep(1)
return x
if __name__ == '__main__':
with MPIPoolExecutor() as executor:
image = executor.map(test, range(60*60))
#!/bin/sh
#PBS -l nodes=3:ppn=20
#PBS -V
#PBS -N mpi4py-test
cd $PBS_O_WORKDIR
. ~/.bashrc
mpiexec -n 60 python -m mpi4py.futures mpi4py-test.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment