Yet Another eXchange Tool  0.9.0
test_perf.f90
1 
12 
13 !
14 ! Keywords:
15 ! Maintainer: Jörg Behrens <behrens@dkrz.de>
16 ! Moritz Hanke <hanke@dkrz.de>
17 ! Thomas Jahns <jahns@dkrz.de>
18 ! URL: https://doc.redmine.dkrz.de/yaxt/html/
19 !
20 ! Redistribution and use in source and binary forms, with or without
21 ! modification, are permitted provided that the following conditions are
22 ! met:
23 !
24 ! Redistributions of source code must retain the above copyright notice,
25 ! this list of conditions and the following disclaimer.
26 !
27 ! Redistributions in binary form must reproduce the above copyright
28 ! notice, this list of conditions and the following disclaimer in the
29 ! documentation and/or other materials provided with the distribution.
30 !
31 ! Neither the name of the DKRZ GmbH nor the names of its contributors
32 ! may be used to endorse or promote products derived from this software
33 ! without specific prior written permission.
34 !
35 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
36 ! IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
37 ! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38 ! PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
39 ! OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40 ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41 ! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42 ! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43 ! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44 ! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45 ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 !
47 
48 PROGRAM test_perf
49  USE mpi
51  & ut_transpose, ut_init_decomposition, &
54  & ut_init_transposition, xt_int_kind
55  USE ftest_common, ONLY: finish_mpi, init_mpi, treset, tstart, tstop, &
56  treport, timer, id_map, factorize, regular_deco, set_verbose, icmp
57  USE yaxt, ONLY: xt_finalize
58 
59  IMPLICIT NONE
60  ! global extents including halos:
61 
62  INTEGER, PARAMETER :: nlev = 30
63  INTEGER, PARAMETER :: undef_int = (huge(undef_int)-1)/2 - 1
64  INTEGER(xt_int_kind), PARAMETER :: undef_index = -1
65  INTEGER, PARAMETER :: nhalo = 1 ! 1dim. halo border size
66 
67  INTEGER, PARAMETER :: grid_kind_test = 1
68  INTEGER, PARAMETER :: grid_kind_toy = 2
69  INTEGER, PARAMETER :: grid_kind_tp10 = 3
70  INTEGER, PARAMETER :: grid_kind_tp04 = 4
71  INTEGER, PARAMETER :: grid_kind_tp6M = 5
72  INTEGER :: grid_kind = grid_kind_test
73 
74  CHARACTER(len=10) :: grid_label
75  INTEGER :: g_ie, g_je ! global domain extents
76  INTEGER :: ie, je, ke ! local extents, including halos
77  INTEGER :: p_ioff, p_joff ! offsets within global domain
78  INTEGER :: nprocx, nprocy ! process space extents
79  INTEGER :: nprocs ! == nprocx*nprocy
80  ! process rank, process coords within (0:, 0:) process space
81  INTEGER :: mype, mypx, mypy
82  LOGICAL :: lroot ! true only for proc 0
83  CHARACTER(len=*), PARAMETER :: filename = 'test_perf.f90'
84 
85  INTEGER, ALLOCATABLE :: g_id(:,:) ! global id
86  ! global "tripolar-like" toy bounds exchange
87  INTEGER, ALLOCATABLE :: g_tpex(:, :)
88  INTEGER :: template_tpex_2d, trans_tpex_2d
89  INTEGER :: template_tpex_3d, trans_tpex_3d
90 
91  INTEGER, ALLOCATABLE :: loc_id_2d(:,:), loc_tpex_2d(:,:)
92  INTEGER, ALLOCATABLE :: loc_id_3d(:,:,:), loc_tpex_3d(:,:,:)
93  INTEGER, ALLOCATABLE :: fval_2d(:,:), gval_2d(:,:)
94  INTEGER, ALLOCATABLE :: fval_3d(:,:,:), gval_3d(:,:,:)
95  INTEGER, ALLOCATABLE :: id_pos(:,:), pos3d_surf(:,:)
96  INTEGER :: surf_trans_tpex_2d
97  LOGICAL :: verbose
98 
99  TYPE(timer) :: t_all, t_surf_trans, t_exch_surf
100  TYPE(timer) :: t_template_2d, t_trans_2d, t_exch_2d
101  TYPE(timer) :: t_template_3d, t_trans_3d, t_exch_3d
102 
103  CALL treset(t_all, 'all')
104  CALL treset(t_surf_trans, 'surf_trans')
105  CALL treset(t_exch_surf, 'exch_surf')
106  CALL treset(t_template_2d, 'template_2d')
107  CALL treset(t_trans_2d, 'trans_2d')
108  CALL treset(t_exch_2d, 'exch_2d')
109  CALL treset(t_template_3d, 'template_3d')
110  CALL treset(t_trans_3d, 'trans_3d')
111  CALL treset(t_exch_3d, 'exch_3d')
112 
113  CALL init_mpi
114 
115  CALL tstart(t_all)
116 
117  ! mpi & decomposition & allocate mem:
118  CALL init_all
119 
120  ! full global index space:
121  CALL id_map(g_id)
122 
123  ! local window of global index space:
124  CALL get_window(g_id, loc_id_2d)
125 
126 
127  ! define bounds exchange for full global index space
128  CALL def_exchange(g_id, g_tpex)
129  DEALLOCATE(g_id)
130  ! local window of global bounds exchange:
131  CALL get_window(g_tpex, loc_tpex_2d)
132  DEALLOCATE(g_tpex)
133 
134  ! template: loc_id_2d -> loc_tpex_2d
135  CALL tstart(t_template_2d)
136  CALL gen_template_2d(loc_id_2d, loc_tpex_2d, template_tpex_2d)
137  CALL tstop(t_template_2d)
138 
139  ! transposition: loc_id_2d:data -> loc_tpex_2d:data
140  CALL tstart(t_trans_2d)
141  CALL gen_trans(template_tpex_2d, mpi_integer, mpi_integer, trans_tpex_2d)
142  CALL tstop(t_trans_2d)
143 
144 
145  ! test 2d-to-2d transposition:
146  fval_2d = loc_id_2d
147  CALL tstart(t_exch_2d)
148  CALL exchange2d_2d(trans_tpex_2d, fval_2d, gval_2d)
149  CALL tstop(t_exch_2d)
150  CALL icmp('2d to 2d check', gval_2d, loc_tpex_2d, mype)
151 
152  ! define positions of surface elements within (i,k,j) array
153  CALL id_map(id_pos)
154  CALL id_map(pos3d_surf)
155  CALL gen_pos3d_surf(pos3d_surf)
156 
157  ! generate surface transposition:
158  CALL tstart(t_surf_trans)
159  CALL gen_off_trans(template_tpex_2d, mpi_integer, id_pos(:,:)-1, &
160  mpi_integer, pos3d_surf(:,:)-1, surf_trans_tpex_2d)
161  CALL tstop(t_surf_trans)
162  DEALLOCATE(id_pos, pos3d_surf)
163 
164 
165  ! 2d to surface boundsexchange:
166  ALLOCATE(gval_3d(ie,nlev,je))
167  gval_3d = -1
168  CALL tstart(t_exch_surf)
169  CALL exchange2d_3d(surf_trans_tpex_2d, fval_2d, gval_3d)
170  CALL tstop(t_exch_surf)
171 
172  CALL icmp('surface check', gval_3d(:,1,:), loc_tpex_2d, mype)
173 
174  ! check sub surface:
175  CALL icmp('sub surface check', gval_3d(:,2,:), loc_tpex_2d*0-1, mype)
176 
177  ! cleanup 2d:
178  CALL ut_destroy_transposition_template(template_tpex_2d)
179  CALL ut_destroy_transposition(trans_tpex_2d)
180  CALL ut_destroy_transposition(surf_trans_tpex_2d)
181 
182  ! inflate 2d -> 3d
183  CALL inflate_idx(3, loc_id_2d, loc_id_3d)
184  DEALLOCATE(loc_id_2d)
185  CALL inflate_idx(3, loc_tpex_2d, loc_tpex_3d)
186  DEALLOCATE(loc_tpex_2d)
187 
188  ! template: loc_id_3d -> loc_tpex_3d
189  CALL tstart(t_template_3d)
190  CALL gen_template_3d(loc_id_3d, loc_tpex_3d, template_tpex_3d)
191  CALL tstop(t_template_3d)
192 
193  ! transposition: loc_id_3d:data -> loc_tpex_3d:data
194  CALL tstart(t_trans_3d)
195  CALL gen_trans(template_tpex_3d, mpi_integer, mpi_integer, trans_tpex_3d)
196  CALL tstop(t_trans_3d)
197 
198  ! test 3d-to-3d transposition:
199  DEALLOCATE(gval_3d)
200  ALLOCATE(fval_3d(ie,je,nlev), gval_3d(ie,je,nlev))
201  fval_3d = loc_id_3d
202  CALL tstart(t_exch_3d)
203  CALL exchange3d_3d(trans_tpex_3d, fval_3d, gval_3d)
204  CALL tstop(t_exch_3d)
205  DEALLOCATE(fval_3d)
206  CALL icmp('3d to 3d check', gval_3d, loc_tpex_3d, mype)
207  DEALLOCATE(gval_3d)
208 
209  ! cleanup 3d:
210  CALL ut_destroy_transposition_template(template_tpex_3d)
211  CALL ut_destroy_transposition(trans_tpex_3d)
212 
213  CALL tstop(t_all)
214 
215  IF (verbose) WRITE(0,*) 'timer report for nprocs=',nprocs
216 
217  CALL treport(t_all, trim(grid_label), mpi_comm_world)
218  CALL treport(t_surf_trans, trim(grid_label), mpi_comm_world)
219  CALL treport(t_exch_surf, trim(grid_label), mpi_comm_world)
220  CALL treport(t_template_2d, trim(grid_label), mpi_comm_world)
221  CALL treport(t_trans_2d, trim(grid_label), mpi_comm_world)
222  CALL treport(t_exch_2d, trim(grid_label), mpi_comm_world)
223  CALL treport(t_template_3d, trim(grid_label), mpi_comm_world)
224  CALL treport(t_trans_3d, trim(grid_label), mpi_comm_world)
225  CALL treport(t_exch_3d, trim(grid_label), mpi_comm_world)
226 
227  DEALLOCATE(loc_tpex_3d, loc_id_3d, fval_2d, gval_2d)
228  CALL xt_finalize
229  CALL finish_mpi
230 
231 CONTAINS
232 
233  SUBROUTINE inflate_idx(inflate_pos, idx_2d, idx_3d)
234  CHARACTER(len=*), PARAMETER :: context = 'test_perf::inflate_idx: '
235  INTEGER, INTENT(in) :: inflate_pos
236  INTEGER, INTENT(in) :: idx_2d(:,:)
237  INTEGER, ALLOCATABLE, INTENT(out) :: idx_3d(:,:,:)
238 
239  INTEGER :: i, j, k
240 
241  IF (inflate_pos == 3) THEN
242  ALLOCATE(idx_3d(ie, je, ke))
243  DO k=1,ke
244  DO j=1,je
245  DO i=1,ie
246  idx_3d(i,j,k) = idx_2d(i,j) + (k-1) * g_ie * g_je
247  ENDDO
248  ENDDO
249  ENDDO
250  ELSE
251  CALL ut_abort(context//' unsupported inflate position', &
252  filename, __line__)
253  ENDIF
254 
255  END SUBROUTINE inflate_idx
256 
257  SUBROUTINE gen_pos3d_surf(pos)
258  INTEGER, INTENT(inout) :: pos(:,:)
259  ! positions for zero based arrays (ECHAM grid point dim order)
260  ! old pos = i + j*ie
261  ! new pos = i + k*ie + j*ie*nlev
262  INTEGER :: ii,jj, i,j,k, p,q
263 
264  k = 0 ! surface
265  DO jj=1,je
266  DO ii=1,ie
267  p = pos(ii,jj) - 1 ! shift to 0-based index
268  j = p/ie
269  i = mod(p,ie)
270  q = i + k*ie + j*ie*nlev
271  pos(ii,jj) = q + 1 ! shift to 1-based index
272  ENDDO
273  ENDDO
274 
275  END SUBROUTINE gen_pos3d_surf
276 
277  SUBROUTINE init_all
278  CHARACTER(len=*), PARAMETER :: context = 'init_all: '
279  INTEGER :: ierror
280  CHARACTER(len=20) :: grid_str
281 
282  CALL get_environment_variable('YAXT_TEST_PERF_GRID', grid_str)
283 
284  verbose = .true.
285 
286  SELECT CASE (trim(adjustl(grid_str)))
287  CASE('TOY')
288  grid_kind = grid_kind_toy
289  grid_label = 'TOY'
290  g_ie = 66
291  g_je = 36
292  CASE('TP10')
293  grid_kind = grid_kind_tp10
294  grid_label = 'TP10'
295  g_ie = 362
296  g_je = 192
297  CASE('TP04')
298  grid_kind = grid_kind_tp04
299  grid_label = 'TP04'
300  g_ie = 802
301  g_je = 404
302  CASE('TP6M')
303  grid_kind = grid_kind_tp6m
304  grid_label = 'TP6M'
305  g_ie = 3602
306  g_je = 2394
307  CASE default
308  grid_kind = grid_kind_test
309  grid_label = 'TEST'
310  g_ie = 32
311  g_je = 12
312  verbose = .false.
313  END SELECT
314 
315  CALL mpi_comm_size(mpi_comm_world, nprocs, ierror)
316  IF (ierror /= mpi_success) CALL ut_abort(context//'MPI_COMM_SIZE failed', &
317  filename, __line__)
318 
319  CALL mpi_comm_rank(mpi_comm_world, mype, ierror)
320  IF (ierror /= mpi_success) CALL ut_abort(context//'MPI_COMM_RANK failed', &
321  filename, __line__)
322  IF (mype==0) THEN
323  lroot = .true.
324  ELSE
325  lroot = .false.
326  verbose = .false.
327  ENDIF
328  CALL set_verbose(verbose)
329  CALL factorize(nprocs, nprocx, nprocy)
330  IF (lroot .AND. verbose) WRITE(0,*) 'nprocx, nprocy=',nprocx, nprocy
331  IF (lroot .AND. verbose) WRITE(0,*) 'g_ie, g_je=',g_ie, g_je
332  mypy = mype / nprocx
333  mypx = mod(mype, nprocx)
334 
335  CALL deco
336  ke = nlev
337 
338  ALLOCATE(g_id(g_ie, g_je), g_tpex(g_ie, g_je))
339 
340  ALLOCATE(fval_2d(ie,je), gval_2d(ie,je))
341  ALLOCATE(loc_id_2d(ie,je), loc_tpex_2d(ie,je))
342  ALLOCATE(id_pos(ie,je), pos3d_surf(ie,je))
343 
344  fval_2d = undef_int
345  gval_2d = undef_int
346  loc_id_2d = undef_int
347  loc_tpex_2d = undef_int
348  id_pos = undef_int
349  pos3d_surf = undef_int
350 
351  CALL ut_init(decomp_size=30, comm_tmpl_size=30, comm_size=30, &
352  & debug_lvl=0, mode=ut_mode_dt_p2p, debug_unit=0)
353 
354  END SUBROUTINE init_all
355 
356  SUBROUTINE exchange2d_2d(itrans, f, g)
357  INTEGER, INTENT(in) :: itrans
358  INTEGER, TARGET, INTENT(in) :: f(:,:)
359  INTEGER, TARGET, INTENT(out) :: g(:,:)
360 
361  INTEGER, POINTER :: p_in, p_out
362 
363  p_in => f(1,1)
364  p_out=> g(1,1)
365 
366  CALL ut_transpose(p_in, itrans, comm_forward, p_out)
367 
368  END SUBROUTINE exchange2d_2d
369 
370  SUBROUTINE exchange3d_3d(itrans, f, g)
371  INTEGER, INTENT(in) :: itrans
372  INTEGER, TARGET, INTENT(in) :: f(:,:,:)
373  INTEGER, TARGET, INTENT(out) :: g(:,:,:)
374 
375  INTEGER, POINTER :: p_in, p_out
376 
377  p_in => f(1,1,1)
378  p_out=> g(1,1,1)
379 
380  CALL ut_transpose(p_in, itrans, comm_forward, p_out)
381 
382  END SUBROUTINE exchange3d_3d
383 
384 
385  SUBROUTINE exchange2d_3d(itrans, f, g)
386  INTEGER, INTENT(in) :: itrans
387  INTEGER, TARGET, INTENT(in) :: f(:,:)
388  INTEGER, TARGET, INTENT(out) :: g(:,:,:)
389 
390  INTEGER, POINTER :: p_in, p_out
391 
392  p_in => f(1,1)
393  p_out=> g(1,1,1)
394 
395  CALL ut_transpose(p_in, itrans, comm_forward, p_out)
396 
397  END SUBROUTINE exchange2d_3d
398 
399  SUBROUTINE gen_trans(itemp, send_dt, recv_dt, itrans)
400  INTEGER,INTENT(in) :: itemp, send_dt, recv_dt
401  INTEGER,INTENT(out) :: itrans
402 
403  INTEGER :: dt
404 
405  IF (send_dt /= recv_dt) &
406  CALL ut_abort('gen_trans: (send_dt /= recv_dt) unsupported', &
407  filename, __line__)
408  dt = send_dt
409  CALL ut_init_transposition(itemp, dt, itrans)
410 
411  END SUBROUTINE gen_trans
412 
413  SUBROUTINE gen_off_trans(itemp, send_dt, send_off, recv_dt, recv_off, itrans)
414  INTEGER,INTENT(in) :: itemp, send_dt, recv_dt
415  INTEGER,INTENT(in) :: send_off(:,:), recv_off(:,:)
416  INTEGER,INTENT(out) :: itrans
417 
418  INTEGER :: send_offsets(SIZE(send_off)), recv_offsets(SIZE(recv_off))
419 
420  send_offsets = reshape(send_off, (/SIZE(send_off)/) )
421  recv_offsets = reshape(recv_off, (/SIZE(recv_off)/) )
422 
423  CALL ut_init_transposition(itemp, send_offsets, recv_offsets, &
424  send_dt, recv_dt, itrans)
425 
426  END SUBROUTINE gen_off_trans
427 
428  SUBROUTINE get_window(gval, win)
429  INTEGER, INTENT(in) :: gval(:,:)
430  INTEGER, INTENT(out) :: win(:,:)
431 
432  INTEGER :: i, j, ig, jg
433 
434  DO j = 1, je
435  jg = p_joff + j
436  DO i = 1, ie
437  ig = p_ioff + i
438  win(i,j) = gval(ig,jg)
439  ENDDO
440  ENDDO
441 
442  END SUBROUTINE get_window
443 
444  SUBROUTINE gen_template_2d(local_src_idx, local_dst_idx, ihandle)
445  INTEGER, INTENT(in) :: local_src_idx(:,:)
446  INTEGER, INTENT(in) :: local_dst_idx(:,:)
447  INTEGER, INTENT(out) :: ihandle
448 
449  INTEGER :: src(SIZE(local_src_idx)), dst(size(local_dst_idx))
450 
451  INTEGER :: src_handle, dst_handle
452 
453  src = reshape( local_src_idx, (/SIZE(local_src_idx)/) )
454  dst = reshape( local_dst_idx, (/SIZE(local_dst_idx)/) )
455 
456  CALL ut_init_decomposition(src, g_ie * g_je, src_handle)
457  CALL ut_init_decomposition(dst, g_ie * g_je, dst_handle)
458 
459  CALL ut_init_oneway_transposition_template(src_handle, dst_handle, &
460  mpi_comm_world, ihandle)
461 
462  CALL ut_destroy_decomposition(dst_handle)
463  CALL ut_destroy_decomposition(src_handle)
464 
465  END SUBROUTINE gen_template_2d
466 
467  SUBROUTINE gen_template_3d(local_src_idx, local_dst_idx, ihandle)
468  INTEGER, INTENT(in) :: local_src_idx(:,:,:)
469  INTEGER, INTENT(in) :: local_dst_idx(:,:,:)
470  INTEGER, INTENT(out) :: ihandle
471 
472  INTEGER, ALLOCATABLE :: src(:), dst(:)
473  INTEGER :: src_handle, dst_handle
474 
475  ALLOCATE(src(SIZE(local_src_idx)), dst(SIZE(local_dst_idx)))
476 
477  src = reshape( local_src_idx, (/SIZE(local_src_idx)/) )
478  dst = reshape( local_dst_idx, (/SIZE(local_dst_idx)/) )
479 
480  CALL ut_init_decomposition(src, g_ie * g_je, src_handle)
481  CALL ut_init_decomposition(dst, g_ie * g_je, dst_handle)
482 
483  CALL ut_init_oneway_transposition_template(src_handle, dst_handle, &
484  mpi_comm_world, ihandle)
485 
486  CALL ut_destroy_decomposition(dst_handle)
487  CALL ut_destroy_decomposition(src_handle)
488 
489  END SUBROUTINE gen_template_3d
490 
491 
492  SUBROUTINE def_exchange(g_id, g_tpex)
493  INTEGER, INTENT(in) :: g_id(:, :)
494  INTEGER, INTENT(out) :: g_tpex(:, :)
495  LOGICAL, PARAMETER :: increased_north_halo = .false.
496  LOGICAL, PARAMETER :: with_north_halo = .true.
497  INTEGER :: i, j
498  INTEGER :: g_core_is, g_core_ie, g_core_js, g_core_je
499  INTEGER :: north_halo
500 
501  ! global core domain:
502  g_core_is = nhalo + 1
503  g_core_ie = g_ie-nhalo
504  g_core_js = nhalo + 1
505  g_core_je = g_je-nhalo
506 
507  ! global tripolar boundsexchange:
508  g_tpex = undef_index
509  g_tpex(g_core_is:g_core_ie, g_core_js:g_core_je) &
510  = g_id(g_core_is:g_core_ie, g_core_js:g_core_je)
511 
512  IF (with_north_halo) THEN
513 
514  ! north inversion, (maybe with increased north halo)
515  IF (increased_north_halo) THEN
516  north_halo = nhalo+1
517  ELSE
518  north_halo = nhalo
519  ENDIF
520 
521  IF (2*north_halo > g_core_je) &
522  CALL ut_abort('def_exchange: grid too small (or halo too large) &
523  &for tripolar north exchange', &
524  filename, __line__)
525  DO j = 1, north_halo
526  DO i = g_core_is, g_core_ie
527  g_tpex(i,j) = g_tpex(g_core_ie + (g_core_is-i), 2*north_halo + (1-j))
528  ENDDO
529  ENDDO
530 
531  ELSE
532 
533  DO j = 1, nhalo
534  DO i = nhalo+1, g_ie-nhalo
535  g_tpex(i,j) = g_id(i,j)
536  ENDDO
537  ENDDO
538 
539  ENDIF
540 
541  ! south: no change
542  DO j = g_core_je+1, g_je
543  DO i = nhalo+1, g_ie-nhalo
544  g_tpex(i,j) = g_id(i,j)
545  ENDDO
546  ENDDO
547 
548  ! PBC
549  DO j = 1, g_je
550  DO i = 1, nhalo
551  g_tpex(g_core_is-i,j) = g_tpex(g_core_ie+(1-i),j)
552  ENDDO
553  DO i = 1, nhalo
554  g_tpex(g_core_ie+i,j) = g_tpex(nhalo+i,j)
555  ENDDO
556  ENDDO
557 
558  CALL check_g_idx (g_tpex)
559 
560  END SUBROUTINE def_exchange
561 
562  SUBROUTINE check_g_idx(gidx)
563  INTEGER,INTENT(in) :: gidx(:,:)
564 
565  IF (any(gidx == undef_index)) THEN
566  CALL ut_abort('check_g_idx: check failed', filename, __line__)
567  ENDIF
568  END SUBROUTINE check_g_idx
569 
570  SUBROUTINE deco
571  INTEGER :: cx0(0:nprocx-1), cxn(0:nprocx-1)
572  INTEGER :: cy0(0:nprocy-1), cyn(0:nprocy-1)
573 
574  cx0 = 0
575  cxn = 0
576  CALL regular_deco(g_ie-2*nhalo, cx0, cxn)
577 
578  cy0 = 0
579  cyn = 0
580  CALL regular_deco(g_je-2*nhalo, cy0, cyn)
581 
582  ! process local deco variables:
583  ie = cxn(mypx) + 2*nhalo
584  je = cyn(mypy) + 2*nhalo
585  p_ioff = cx0(mypx)
586  p_joff = cy0(mypy)
587 
588  END SUBROUTINE deco
589 
590 END PROGRAM test_perf
591 !
592 ! Local Variables:
593 ! f90-continuation-indent: 5
594 ! coding: utf-8
595 ! indent-tabs-mode: nil
596 ! show-trailing-whitespace: t
597 ! require-trailing-newline: t
598 ! End:
599 !
Definition: xt_ut.f90:50
integer, parameter, public comm_forward
Definition: xt_ut.f90:76
subroutine, public ut_init_oneway_transposition_template(decomp_handle_in, decomp_handle_out, mpi_world, comm_tmpl_handle, check_unique)
Definition: xt_ut.f90:275
subroutine, public ut_init(decomp_size, comm_tmpl_size, comm_size, debug_lvl, mode, debug_unit)
Definition: xt_ut.f90:231
subroutine, public ut_abort(msg, source, line)
Definition: xt_ut.f90:217
subroutine, public ut_destroy_decomposition(handle)
Definition: xt_ut.f90:267
subroutine, public ut_destroy_transposition_template(handle)
Definition: xt_ut.f90:293
integer, parameter, public ut_mode_dt_p2p
Definition: xt_ut.f90:79
subroutine, public ut_destroy_transposition(handle)
Definition: xt_ut.f90:337
Definition: yaxt.f90:49
void xt_finalize(void)
Definition: xt_init.c:89