again, rewrite of the autopartitioner.
Merge remote-tracking branch 'origin/rewriting_autopartitioner' into rewriting_autopartitioner