schrodinger.application.desmond.autopartition module

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

Copyright Schrodinger, LLC. All rights reserved.


Return all combinations for multiset m


m (list of integer) – the array contains the maximum number of individual unique element in the multiset.


A partition generator


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


a three element tuple that represent the partition


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.


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

:return prime number


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:

  • dims (list of integer) – simulation box

  • nproc (int) – number of cores

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