/[MITgcm]/MITgcm/pkg/compon_communic/mitcomponent_tile_register.F
ViewVC logotype

Contents of /MITgcm/pkg/compon_communic/mitcomponent_tile_register.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Wed Nov 27 21:53:04 2013 UTC (10 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.2: +47 -46 lines
- change component tile registration (cpl_register.F in both compon_interf
  and mitcomponent_tile_register.F) to pass the full list of tiles
  information (including bi,bj) in 1 vector (instead of in a bi,bj matrix).
- improve report of tile registration results to log file.

1 C $Header: /u/gcmpack/MITgcm/pkg/compon_communic/mitcomponent_tile_register.F,v 1.2 2007/10/08 23:58:20 jmc Exp $
2 C $Name: $
3
4 !=======================================================================
5 subroutine MITCOMPONENT_tile_register( num_tiles, iReg )
6 implicit none
7
8 ! MPI variables
9 #include "mpif.h"
10 c integer myid, numprocs, ierr, rc
11
12 ! Predefined constants/arrays
13 #include "CPLR_SIG.h"
14
15 ! Arguments
16 integer num_tiles
17 integer iReg(6,num_tiles)
18
19 ! Functions
20 integer mitcplr_match_comp
21 integer generate_tag
22 external mitcplr_match_comp
23 external generate_tag
24
25 ! Local
26 c integer bi, bj
27 integer n
28 integer count, datatype, dest, tag, comm, ierr
29 integer ibuf(MAX_IBUF)
30
31 ! ------------------------------------------------------------------
32
33 write(LogUnit,'(A,I6,A,2I4)')
34 & 'MITCOMPONENT_tile_register (pId=', my_rank_in_local,
35 & '): Starts ; num_tiles=', num_tiles
36
37 if (num_tiles.lt.1)
38 & STOP 'MITCOMPONENT_tile_register: num_tiles < 1'
39 if (num_tiles.gt.MAX_TILES)
40 & STOP 'MITCOMPONENT_tile_register: num_tiles > MAX_TILES'
41
42 my_num_tiles = num_tiles
43 do n=1,num_tiles
44 my_tile_bi(n) = iReg(1,n)
45 my_tile_bj(n) = iReg(2,n)
46 my_tile_nx(n) = iReg(3,n)
47 my_tile_ny(n) = iReg(4,n)
48 my_tile_i0(n) = iReg(5,n)
49 my_tile_j0(n) = iReg(6,n)
50 write(LogUnit,'(A,I5,A,2I4,A,2I5,A,2I8)')
51 & ' tile #', n,
52 & ' ; bi,bj=', iReg(1,n), iReg(2,n),
53 & ' ; Ni,Nj=', iReg(3,n), iReg(4,n),
54 & ' ; Io,Jo=', iReg(5,n), iReg(6,n)
55 enddo
56
57 ! Set up buffer
58 ibuf(1) = num_tiles
59
60 ! Send message
61 count=1
62 datatype=MPI_INTEGER
63 dest=my_coupler_rank
64 tag=generate_tag(112,my_rank_in_global,'Register Tiles')
65 comm=MPI_COMM_myglobal
66
67 call MPI_Send( ibuf, count, datatype, dest, tag, comm, ierr )
68
69 if (ierr.ne.0) then
70 write(LogUnit,*) 'MITCOMPONENT_tile_register: rank(W,G,L)=',
71 & my_rank_in_world,my_rank_in_global,my_rank_in_local,
72 & ' ierr=',ierr
73 STOP 'MITCOMPONENT_tile_register: MPI_Send failed'
74 endif
75
76 do n=1,my_num_tiles
77
78 ! Set up buffer
79 c bi = my_tile_bi(n)
80 c bj = my_tile_bj(n)
81 ibuf(1) = my_tile_nx(n)
82 ibuf(2) = my_tile_ny(n)
83 ibuf(3) = my_tile_i0(n)
84 ibuf(4) = my_tile_j0(n)
85
86 ! Send message
87 count=4
88 datatype=MPI_INTEGER
89 dest=my_coupler_rank
90 tag=generate_tag(113,n,'Register each tile')
91 comm=MPI_COMM_myglobal
92
93 call MPI_Send( ibuf, count, datatype, dest, tag, comm, ierr )
94
95 if (ierr.ne.0) then
96 write(LogUnit,*) 'MITCOMPONENT_tile_register: rank(W,G,L)=',
97 & my_rank_in_world,my_rank_in_global,my_rank_in_local,
98 & ' ierr=',ierr
99 STOP 'MITCOMPONENT_tile_register: MPI_Send failed'
100 endif
101
102 enddo
103
104 write(LogUnit,'(A,I6,A,2I4)')
105 & 'MITCOMPONENT_tile_register (pId=', my_rank_in_local, '): done'
106
107 ! ------------------------------------------------------------------
108 call flush(LogUnit)
109 return
110 end
111 !=======================================================================

  ViewVC Help
Powered by ViewVC 1.1.22