obtain info about number of tasks before allocating memory