schrodinger.application.desmond.autopartition module

A module to provide multiset partition, combination and processor topology decomposition.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.desmond.autopartition.all_multicomb(m)

Return all combinations for multiset m :type m: list of integer :param m: the array contains the maximum number of individual unique element

in the multiset.

schrodinger.application.desmond.autopartition.get_next_partition(factors)

A partition generator

Parameters

factors (list of integer) – a list of prime numbers

:return a three element tuple that represent the partition

@todo:

this algorithm is still not very efficient due to the generation of duplicate combination. A vector partition function with restricted growth order will be a better option.

schrodinger.application.desmond.autopartition.next_prime(n)

A prmie number generator that generates prime number less than or equal to n :type n: int :param n:

:return prime number

schrodinger.application.desmond.autopartition.get_prime_factors(n)

A function to generate all factorizations of a given integer n. :type n: int :param n: an integer to be factorized

:return a list of prime factors.

schrodinger.application.desmond.autopartition.auto_partition(dims, nproc)

A function to calculate best cpu partition based on dimension and number of processor. The object function to optimize:

Parameters
  • dims (list of integer) – simulation box

  • nproc (int) – number of cores

:return an three element integer array that represents the best partition.