slave_return.F [SRC] [CPP] [JOB] [SCAN]
SOURCES / MAIN / SLAVE



   1 | include(dom.inc)
   2 | 
   3 |       SUBROUTINE slave_return(Gtot, Htot, Lotot, Lbtot, Q_rtot,         &
   4 |      &                        ncells, nfacemax)
   5 | 
   6 | !       ================================================================!
   7 | !                                                                       !
   8 | !       slave_return.F: Sends the resulting vectors to the master proc. !
   9 | !                                                                       !
  10 | !       out           :                                                 !
  11 | !                                                                       !
  12 | !       author        : J. AMAYA (october 2007)                         !
  13 | !                                                                       !
  14 | !       ================================================================!
  15 | 
  16 |         USE mod_pmm
  17 | 
  18 |         IMPLICIT NONE
  19 | 
  20 |         include 'pmm_constants.h'
  21 | 
  22 | !       IN
  23 |         DOM_INT   :: ncells, nfacemax
  24 |         DOM_REAL,DIMENSION(3,ncells)          :: Q_rtot
  25 |         DOM_REAL,DIMENSION(ncells)            :: Gtot, Lbtot
  26 |         DOM_REAL,DIMENSION(nfacemax,ncells)   :: Lotot, Htot
  27 | 
  28 | !       LOCAL
  29 |         DOM_INT   :: ierr
  30 |         DOM_INT   :: i
  31 | 
  32 | !       ----------------!
  33 | !       Testing results !
  34 | !       ----------------!
  35 | !       DO i=1,ncells
  36 | !         print*, " (",pmm_rank,") Lbtot(",i,")=", Lbtot(i)
  37 | !       ENDDO
  38 | !       DO i=1,ncells
  39 | !         print*, " (",pmm_rank,") Gtot(",i,")=", Gtot(i)
  40 | !       ENDDO
  41 | 
  42 | !       --------------------------------------------------!
  43 | !       Send vectors only if it is not the master process !
  44 | !       --------------------------------------------------!
  45 | 
  46 |         IF (pmm_rank.ne.PMM_HOST) THEN
  47 | !         print*, " (",pmm_rank,") MPI sending results"
  48 |           CALL MPI_SEND(pmm_rank, 1, MPI_INTEGER, PMM_HOST, PMM_RETURN, &
  49 |      &                  MPI_COMM_WORLD, ierr)
  50 |           CALL MPI_SEND(Gtot, ncells, MPI_DOUBLE_PRECISION, PMM_HOST,   &
  51 |      &                  PMM_RETURN, MPI_COMM_WORLD, ierr)
  52 |           CALL MPI_SEND(Htot, ncells*nfacemax, MPI_DOUBLE_PRECISION,    &
  53 |      &                  PMM_HOST, PMM_RETURN, MPI_COMM_WORLD, ierr)
  54 |           CALL MPI_SEND(Lotot, ncells*nfacemax, MPI_DOUBLE_PRECISION,   &
  55 |      &                  PMM_HOST, PMM_RETURN, MPI_COMM_WORLD, ierr)
  56 |           CALL MPI_SEND(Lbtot, ncells, MPI_DOUBLE_PRECISION, PMM_HOST,  &
  57 |      &                  PMM_RETURN, MPI_COMM_WORLD, ierr)
  58 |           CALL MPI_SEND(Q_rtot, 3*ncells, MPI_DOUBLE_PRECISION,         &
  59 |      &                  PMM_HOST, PMM_RETURN, MPI_COMM_WORLD, ierr)
  60 | 
  61 |         ELSE
  62 | !         print*,  " MASTER (slave_return) >> Lbmax =", MAXVAL(Lbtot)
  63 |           CALL master_integrate(Gtot, Htot, Lotot, Lbtot, Q_rtot,       &
  64 |      &                          PMM_HOST)
  65 |         ENDIF
  66 | 
  67 |       END SUBROUTINE slave_return


slave_return.F could be called by:
Makefile [SOURCES] - 125 - 209
slave.F [SOURCES/MAIN/SLAVE] - 453