Rosetta  2019.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
pyrosetta.mpi Namespace Reference

Functions

def mpi_init
 
def MPIJobDistributor
 

Function Documentation

def pyrosetta.mpi.mpi_init (   args,
  kargs 
)
def pyrosetta.mpi.MPIJobDistributor (   njobs,
  fun 
)
Execute fun across MPI nodes to complete njobs.
    arguments:
      - int: njobs
      - fun(int job) function to execute N'th job

    Example: suppose we have 64 decoys to generate using 4 MPI nodes.
    In this case we will need to call MPIJobDistributor(64, foo) and the following foo(...) calls will be made on each node:

    Node 0: for i in [0, 4,  8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60]: foo(i)
    Node 1: for i in [1, 5,  9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61]: foo(i)
    Node 2: for i in [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62]: foo(i)
    Node 3: for i in [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63]: foo(i)

References pyrosetta.tests.distributed.test_dask.format, ObjexxFCL.len(), basic::options::OptionKeys::in::file.list, and basic::options::OptionKeys::relax::range.range.