1 | include(dom.inc)
2 |
3 | SUBROUTINE pmm_sendpartition(i_buffer, i_buffersize, iproc)
4 |
5 | ! ================================================================!
6 | ! !
7 | ! pmm_sendpartition.F : Do MPI calls to send partition data from !
8 | ! master to slaves !
9 | ! !
10 | ! out : !
11 | ! !
12 | ! author : J. AMAYA (october 2007) !
13 | ! !
14 | ! ================================================================!
15 |
16 | USE mod_pmm
17 | #ifdef USEPALM
18 | USE palmlib
19 | #endif
20 |
21 | IMPLICIT NONE
22 |
23 | include 'pmm_constants.h'
24 |
25 | ! IN
26 | DOM_INT :: i_buffersize, iproc
27 |
28 | DOM_INT, DIMENSION(i_buffersize) :: i_buffer
29 |
30 | ! LOCAL
31 | DOM_INT :: ierr
32 |
33 | ! -----------------------!
34 | ! Send buffers to slaves !
35 | ! -----------------------!
36 |
37 | WRITE(*,*) " (",pmm_rank,") Sending partition to slave ",iproc-1
38 | ! print*, " (",pmm_rank,") ", i_buffer
39 |
40 | IF ((iproc-1).eq.PMM_HOST) THEN
41 | ! print*, " (",pmm_rank,") partition with copy for master"
42 | CALL slave_partition(i_buffer, i_buffersize)
43 | ELSE
44 | ! print*, " (",pmm_rank,") partition with send for slaves"
45 | #ifdef USEPALM
46 | CALL MPI_SEND(i_buffer, i_buffersize, MPI_INTEGER, iproc-1, &
47 | & PMM_PARTITION, PL_COMM_EXEC , ierr)
48 | #else
49 | CALL MPI_SEND(i_buffer, i_buffersize, MPI_INTEGER, iproc-1, &
50 | & PMM_PARTITION, MPI_COMM_WORLD, ierr)
51 | #endif
52 | ENDIF
53 |
54 | END SUBROUTINE pmm_sendpartition
pmm_sendpartition.F could be called by: