1

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?

  • What do you mean by *"with quantiles"*? How do quantiles look in your code? Do you want to compute the quantiles of a distributed set on numbers? It is much more difficult. – Vladimir F Героям слава Oct 04 '17 at 13:25
  • Each processor produces an array of real numbers of dimension N (say N=1000) . I want to calculate the median (or some other quantiles) in the merged array of dimension N * NP (say N=1000, NP=8 processors, N*NP=8000). I don't see how to do this without sharing the 8000 numbers to the root which seems quite inefficient. Sorry if that was not clear – grande mundo Oct 04 '17 at 13:49
  • 3
    See https://stackoverflow.com/questions/3888036/finding-median-of-large-set-of-numbers-too-big-to-fit-into-memory – Vladimir F Героям слава Oct 04 '17 at 14:14

0 Answers0