Let say I have n processors. each produce a list of numbers. I would like to calculate the quantile of the merged list. Is there any way to do that without transferring all the sublist to the master.
To fix idea for the mean it is very easy.
IF (my_id.EQ.root_process) THEN
! ..... calculate its part of sum_sh
DO an_id = 1,np ! collect all the partial sh from slave
CALL MPI_RECV( partial_sh, nsh, MPI_REAL, MPI_ANY_SOURCE, &
& MPI_ANY_TAG, MPI_COMM_WORLD, status, ierr)
sum_sh = sum_sh+partial_sh
end DO
ELSE
! calculate partial sh
CALL MPI_SEND( partial_sh, nsh,&MPI_REAL,root_process,return_data_tag, MPI_COMM_WORLD, ierr)
END IF
Is there a way to do the same with quantiles?