pygsti.tools.mpitools.processor_group_size

pygsti.tools.mpitools.processor_group_size#

processor_group_size(nprocs, number_of_tasks)#

Find the number of groups to divide nprocs processors into to tackle number_of_tasks tasks.

When number_of_tasks > nprocs the smallest integer multiple of nprocs is returned that equals or exceeds number_of_tasks is returned.

When number_of_tasks < nprocs the smallest divisor of nprocs that equals or exceeds number_of_tasks is returned.

Parameters:
  • nprocs (int) – The number of processors to divide into groups.

  • number_of_tasks (int or float) – The number of tasks to perform, which can also be seen as the desired number of processor groups. If a floating point value is given the next highest integer is used.

Return type:

int