Calculating simplicial and persistent homology in a distributed manner