added code for partitioned distributed tasks - not yet tested