read num partitions from main