Ignore:
Timestamp:
Feb 9, 2011 2:25:15 PM (10 years ago)
Author:
raasch
Message:

New:
---

optional exchange of ghost points in synchronous mode via MPI_SENDRCV,
steered by d3par parameter synchronous_exchange
(cpu_statistics, exchange_horiz, modules, parin)

openMP-parallelization of pressure solver (fft-method) for 2d-domain-decomposition
(poisfft, transpose)

Changed:


Errors:


mpt bugfix for netCDF4 usage (mrun)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/transpose.f90

    r623 r683  
    44! Current revisions:
    55! -----------------
    6 !
     6! openMP parallelization of transpositions for 2d-domain-decomposition
    77!
    88! Former revisions:
     
    6161!-- Rearrange indices of input array in order to make data to be send
    6262!-- by MPI contiguous
     63!$OMP  PARALLEL PRIVATE ( i, j, k )
     64!$OMP  DO
    6365    DO  i = 0, nxa
    6466       DO  k = nzb_x, nzt_xa
     
    6870       ENDDO
    6971    ENDDO
     72!$OMP  END PARALLEL
    7073
    7174!
     
    8083!
    8184!-- Reorder transposed array
    82     m = 0
     85!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, ys )
     86!$OMP  DO
    8387    DO  l = 0, pdims(2) - 1
     88       m  = l * ( nxr_ya - nxl_y + 1 ) * ( nzt_ya - nzb_y + 1 ) * &
     89                ( nyn_xa - nys_x + 1 )
    8490       ys = 0 + l * ( nyn_xa - nys_x + 1 )
    8591       DO  i = nxl_y, nxr_ya
     
    9298       ENDDO
    9399    ENDDO
     100!$OMP  END PARALLEL
    94101
    95102#endif
     
    131138!
    132139!--    Reorder input array for transposition
    133        m = 0
     140!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, xs )
     141!$OMP  DO
    134142       DO  l = 0, pdims(1) - 1
     143          m  = l * ( nzt_xa - nzb_x + 1 ) * nnx * ( nyn_xa - nys_x + 1 )
    135144          xs = 0 + l * nnx
    136145          DO  k = nzb_x, nzt_xa
     
    143152          ENDDO
    144153       ENDDO
     154!$OMP  END PARALLEL
    145155
    146156!
     
    155165!
    156166!--    Reorder transposed array in a way that the z index is in first position
     167!$OMP  PARALLEL PRIVATE ( i, j, k )
     168!$OMP  DO
    157169       DO  k = 1, nza
    158170          DO  i = nxl, nxra
     
    162174          ENDDO
    163175       ENDDO
     176!$OMP  END PARALLEL
    164177    ELSE
    165178!
    166179!--    Reorder the array in a way that the z index is in first position
     180!$OMP  PARALLEL PRIVATE ( i, j, k )
     181!$OMP  DO
    167182       DO  i = nxl, nxra
    168183          DO  j = nys, nyna
     
    172187          ENDDO
    173188       ENDDO
    174 
     189!$OMP  END PARALLEL
     190
     191!$OMP  PARALLEL PRIVATE ( i, j, k )
     192!$OMP  DO
    175193       DO  k = 1, nza
    176194          DO  i = nxl, nxra
     
    180198          ENDDO
    181199       ENDDO
     200!$OMP  END PARALLEL
    182201
    183202    ENDIF
     
    218237!
    219238!-- Reorder input array for transposition
    220     m = 0
     239!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, ys )
     240!$OMP  DO
    221241    DO  l = 0, pdims(2) - 1
     242       m  = l * ( nxr_ya - nxl_y + 1 ) * ( nzt_ya - nzb_y + 1 ) * &
     243                ( nyn_xa - nys_x + 1 )
    222244       ys = 0 + l * ( nyn_xa - nys_x + 1 )
    223245       DO  i = nxl_y, nxr_ya
     
    230252       ENDDO
    231253    ENDDO
     254!$OMP  END PARALLEL
    232255
    233256!
     
    242265!
    243266!-- Reorder transposed array in a way that the x index is in first position
     267!$OMP  PARALLEL PRIVATE ( i, j, k )
     268!$OMP  DO
    244269    DO  i = 0, nxa
    245270       DO  k = nzb_x, nzt_xa
     
    249274       ENDDO
    250275    ENDDO
     276!$OMP  END PARALLEL
    251277
    252278#endif
     
    353379!-- Rearrange indices of input array in order to make data to be send
    354380!-- by MPI contiguous
     381!$OMP  PARALLEL PRIVATE ( i, j, k )
     382!$OMP  DO
    355383    DO  j = 0, nya
    356384       DO  k = nzb_y, nzt_ya
     
    360388       ENDDO
    361389    ENDDO
     390!$OMP  END PARALLEL
    362391
    363392!
     
    367396!-- of the data is necessary and no transposition has to be done.
    368397    IF ( pdims(1) == 1 )  THEN
     398!$OMP  PARALLEL PRIVATE ( i, j, k )
     399!$OMP  DO
    369400       DO  j = 0, nya
    370401          DO  k = nzb_y, nzt_ya
     
    374405          ENDDO
    375406       ENDDO
     407!$OMP  END PARALLEL
    376408       RETURN
    377409    ENDIF
     
    388420!
    389421!-- Reorder transposed array
    390     m = 0
     422!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, zs )
     423!$OMP  DO
    391424    DO  l = 0, pdims(1) - 1
     425       m  = l * ( nyn_za - nys_z + 1 ) * ( nzt_ya - nzb_y + 1 ) * &
     426                ( nxr_za - nxl_z + 1 )
    392427       zs = 1 + l * ( nzt_ya - nzb_y + 1 )
    393428       DO  j = nys_z, nyn_za
     
    400435       ENDDO
    401436    ENDDO
     437!$OMP  END PARALLEL
    402438
    403439#endif
     
    435471!-- Rearrange indices of input array in order to make data to be send
    436472!-- by MPI contiguous
     473!$OMP  PARALLEL PRIVATE ( i, j, k )
     474!$OMP  DO
    437475    DO  k = 1,nza
    438476       DO  i = nxl, nxra
     
    442480       ENDDO
    443481    ENDDO
     482!$OMP  END PARALLEL
    444483
    445484!
     
    449488!-- of the data is necessary and no transposition has to be done.
    450489    IF ( pdims(1) == 1 )  THEN
     490!$OMP  PARALLEL PRIVATE ( i, j, k )
     491!$OMP  DO
    451492       DO  k = 1, nza
    452493          DO  i = nxl, nxra
     
    456497          ENDDO
    457498       ENDDO
     499!$OMP  END PARALLEL
    458500       RETURN
    459501    ENDIF
     
    470512!
    471513!-- Reorder transposed array
    472     m = 0
     514!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, xs )
     515!$OMP  DO
    473516    DO  l = 0, pdims(1) - 1
     517       m  = l * ( nzt_xa - nzb_x + 1 ) * nnx * ( nyn_xa - nys_x + 1 )
    474518       xs = 0 + l * nnx
    475519       DO  k = nzb_x, nzt_xa
     
    482526       ENDDO
    483527    ENDDO
     528!$OMP  END PARALLEL
    484529
    485530#endif
     
    521566!
    522567!--    Reorder input array for transposition
    523        m = 0
     568!$OMP  PARALLEL PRIVATE ( i, j, k, l, m, zs )
     569!$OMP  DO
    524570       DO  l = 0, pdims(1) - 1
     571          m  = l * ( nyn_za - nys_z + 1 ) * ( nzt_ya - nzb_y + 1 ) * &
     572                   ( nxr_za - nxl_z + 1 )
    525573          zs = 1 + l * ( nzt_ya - nzb_y + 1 )
    526574          DO  j = nys_z, nyn_za
     
    533581          ENDDO
    534582       ENDDO
     583!$OMP  END PARALLEL
    535584
    536585!
     
    545594!
    546595!--    Reorder transposed array in a way that the y index is in first position
     596!$OMP  PARALLEL PRIVATE ( i, j, k )
     597!$OMP  DO
    547598       DO  j = 0, nya
    548599          DO  k = nzb_y, nzt_ya
     
    552603          ENDDO
    553604       ENDDO
     605!$OMP  END PARALLEL
    554606    ELSE
    555607!
    556608!--    Reorder the array in a way that the y index is in first position
     609!$OMP  PARALLEL PRIVATE ( i, j, k )
     610!$OMP  DO
    557611       DO  k = nzb_y, nzt_ya
    558612          DO  j = 0, nya
     
    562616          ENDDO
    563617       ENDDO
     618!$OMP  END PARALLEL
    564619!
    565620!--    Move data to output array
     621!$OMP  PARALLEL PRIVATE ( i, j, k )
     622!$OMP  DO
    566623       DO  k = nzb_y, nzt_ya
    567624          DO  i = nxl_y, nxr_ya
     
    571628          ENDDO
    572629       ENDDO
     630!$OMP  END PARALLEL
    573631
    574632    ENDIF
Note: See TracChangeset for help on using the changeset viewer.