fix assign partitions earmarking function