autodetect cluster count