generic case for partition

almost finish generic case of partition for any reducers