PARLGRAN: parallelism granularity selection for scheduling task chains on dynamically reconfigurable architectures