C ------ CUBEEXCH.F77 ------------------------------------ 26.03.91 ----- C (c) M.Pester C -------------------------------------------------------- 31.03.92 ----- C --- CUBE_EXCH: Distribute N words from each process to each other C (GLOBAL EXCHANGE ALGORITHM) C sort by the process number IP C SUBROUTINE CUBE_EXCH(N,WORDS,Y,IP) C -- Input : N, WORDS(N), IProcessor (sorting) C -- Output: Y(N,Nproc) INCLUDE 'include/trnet.inc' DIMENSION WORDS(N), Y(1) NT=N NR=IP IS=IP*N+1 CALL VIcopy(N,Y(IS),1,WORDS,1) DO 10 L=1,NCUBE IS=NR*NT+1 IR=IEOR(NR,1)*NT+1 CALL EXCHNG(L,NT,Y(IS),Y(IR)) NT=ISHFT(NT, 1) NR=ISHFT(NR,-1) 10 CONTINUE RETURN END