JDFTx  1.7.0
TaskDivision Class Reference

Helper for optimally dividing a specified number of (equal) tasks over MPI. More...

#include <MPIUtil.h>

Public Member Functions

 TaskDivision (size_t nTasks=0, const MPIUtil *mpiUtil=0)
 
void init (size_t nTasks, const MPIUtil *mpiUtil)
 
size_t start () const
 Task number that current process should start on.
 
size_t stop () const
 Task number that current process should stop before (non-inclusive)
 
size_t start (int iProc) const
 Task number that the specified process should start on.
 
size_t stop (int iProc) const
 Task number that the specified process should stop before (non-inclusive)
 
bool isMine (size_t task) const
 Whether current process handle this task number.
 
template<typename T >
void myRange (T &start, T &stop) const
 retrieve range of processes for current task (templated to support other integer types for task range)
 
int whose (size_t task) const
 Which process number should handle this task number.
 

Detailed Description

Helper for optimally dividing a specified number of (equal) tasks over MPI.


The documentation for this class was generated from the following file: