The TELEMAC-MASCARET system  trunk
p_allgatherv_i.F
Go to the documentation of this file.
1 ! *************************
2  SUBROUTINE p_allgatherv_i
3 ! *************************
4 !
5  &(send_buffer, send_count, recv_buffer,
6  & recv_count, displs, ierr)
7 !
8 !***********************************************************************
9 ! PARALLEL V6P3 21/08/2010
10 !***********************************************************************
11 !
12 !brief Gathers data from all tasks and deliver the combined data to all tasks
13 !
14 !warning THIS ROUTINE MUST BE CALLED BY ALL THE NODES/PROCESSORS,
15 !+ OTHERWISE THE PROGRAM WILL "HANG"
16 !
17 !history AUDOUIN YOANN
18 !+ 25/04/2013
19 !+
20 !+ CREATED
21 !
22 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 !
26  IMPLICIT NONE
27 !
28 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
29 !
30  INTEGER, INTENT(IN) :: SEND_BUFFER(*)
31  INTEGER, INTENT(IN) :: SEND_COUNT
32  INTEGER, INTENT(INOUT) :: RECV_BUFFER(*)
33  INTEGER, INTENT(IN) :: RECV_COUNT(*)
34  INTEGER, INTENT(IN) :: DISPLS(*)
35  INTEGER, INTENT(OUT) :: IERR
36 !
37 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 !
39  ierr = 0
40  recv_buffer(1) = 0
41 #if defined HAVE_MPI
42  CALL mpi_allgatherv(send_buffer, send_count, mpi_integer,
43  & recv_buffer, recv_count,
44  & displs, mpi_integer, comm, ierr)
45 !
46  IF(ierr.NE.0) THEN
47  WRITE(lu,*) 'P_ALLGATHERV_I: ERROR IN MPI_BARRIER'
48  WRITE(lu,*) 'MPI ERROR ',ierr
49  CALL plante(1)
50  stop
51  ENDIF
52  RETURN
53 #else
54  WRITE(lu,*) 'CALL OF P_ALLGATHERV_I '//
55  & 'IN ITS VOID VERSION'
56 #endif
57 !
58 !-----------------------------------------------------------------------
59 !
60  END
61 
integer, parameter mpi_integer
subroutine p_allgatherv_i(SEND_BUFFER, SEND_COUNT, RECV_BUFFER, RECV_COUNT, DISPLS, IERR)
Definition: p_allgatherv_i.F:8