Changeset 1171


Ignore:
Timestamp:
May 30, 2013 11:27:45 AM (11 years ago)
Author:
raasch
Message:

New:
---

use_reference-case activated in accelerator version. (buoyancy, diffusion_e)
new option -e which defines the execution command to be used to run PALM,
compiler options for pgi/openacc added (palm_simple_run)
parameter sets for openACC benchmarks added (trunk/EXAMPLES/benchmark_acc)

Changed:


split of prognostic_equations deactivated (time_integration)

Errors:


bugfix: diss array is allocated with full size if accelerator boards are used (init_3d_model)

Location:
palm/trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palm_simple_run

    r1047 r1171  
    1919# Current revisions:
    2020# -----------------
     21# new option -e which defines the execution command to be used to run PALM
    2122#
    2223# Former revisions:
     
    2627# 1046 2012-11-09 14:38:45Z maronga
    2728# code put under GPL (PALM 3.9)
     29#
     30# 29/08/11 - BjornW - Adapted for lcflow (ForWind cluster in Oldenburg)
     31# 18/03/10 - Siggi  - Some comments changed
     32# 25/01/10 - Siggi  - Generating the first version
    2833
     34
     35#--------------------------------------------------------------------------------#
    2936# palm_simple_run - a simple method for running the palm code without
    3037#                   using the mrun script
    31      # This script runs the palm code in a unique subdirectory (OUTPUT...,
    32      # current time/date and number of processors are part of the subdirectory
    33      # name).
    34      # It requires that palm has been installed with command
    35      # palm_simple_install and that the executable palm has been created
    36      # with make in directory  ...../MAKE_DEPOSITORY_simple
    37 
    38      # Last changes:
    39      # 25/01/10 - Siggi  - Generating the first version
    40      # 18/03/10 - Siggi  - Some comments changed
    41      # 29/08/11 - BjornW - Adapted for lcflow (ForWind cluster in Oldenburg)
     38#
     39# This script runs the palm code in a unique subdirectory (OUTPUT...,
     40# current time/date and number of processors are part of the subdirectory
     41# name).
     42# It requires that palm has been installed with command
     43# palm_simple_install and that the executable palm has been created
     44# with make in directory  ...../MAKE_DEPOSITORY_simple
     45#--------------------------------------------------------------------------------#
    4246
    4347
     
    4549 case=example_cbl
    4650 cpumax=999999
     51 execute_for=unknown
    4752 localhost=unknown
    4853 localhost_realname=$(hostname)
     
    5560
    5661    # Read shellscript options
    57  while  getopts  :c:l:n:p:t:  option
     62 while  getopts  :c:e:l:n:p:t:  option
    5863 do
    5964   case  $option  in
    6065       (c)   case=$OPTARG;;
     66       (e)   execute_for=$OPTARG;;
    6167       (l)   localhost=$OPTARG;;
    6268       (n)   mpi_procs_per_node=$OPTARG;;
     
    6470       (t)   openmp_threads=$OPTARG;;
    6571       (\?)  printf "\n  +++ unknown option $OPTARG \n"
    66              printf "\n      allowed option are -d, -f, -l, -s \n"
     72             printf "\n      allowed option are -c, -e, -l, -n, -p, -t \n"
    6773             exit;;
    6874   esac
     
    122128 cat  >  ENVPAR  <<  %%END%%
    123129 &envpar  run_identifier = '$case', host = '$localhost',
    124           write_binary = false, tasks_per_node = $mpi_procs_per_node,
     130          write_binary = 'false', tasks_per_node = $mpi_procs_per_node,
    125131          maximum_cpu_time_allowed = ${cpumax}.,
    126132          revision = '$global_revision',
     
    151157 echo "*** palm will be run:  MPI tasks: $mpi_procs   OpenMP thread: $OMP_NUM_THREADS"
    152158
    153 # IMUK:
    154  mpiexec  -machinefile hostfile  -n $mpi_procs  ./palm  < runfile_atmos
     159 case $execute_for in
    155160
    156 # SGI-MPT HLRN:
    157 # mpiexec_mpt  -np $mpi_procs  ./palm  < runfile_atmos
     161    (imuk)         mpiexec  -machinefile hostfile  -n $mpi_procs  ./palm  < runfile_atmos;;
     162    (sgi-mpt)      mpiexec_mpt  -np $mpi_procs  ./palm  < runfile_atmos;;
     163    (hpc-flow)     mpiexec  -machinefile $TMPDIR/machines -n $mpi_procs  -env I_MPI_FABRICS shm:ofa ./palm  < runfile_atmos;;
     164    (pgi-openacc)  ./palm;;
     165    (*)      echo "+++ -e option to define execution command is missing";;
    158166
    159 # HPC-FLOW (ForWind):
    160 # mpiexec  -machinefile $TMPDIR/machines -n $mpi_procs  -env I_MPI_FABRICS shm:ofa ./palm  < runfile_atmos
    161 
     167 esac
    162168
    163169 echo "*** palm finished"
  • palm/trunk/SOURCE/buoyancy.f90

    r1154 r1171  
    2020! Currrent revisions:
    2121! -----------------
    22 !
     22! openacc statements added to use_reference-case in accelerator version
    2323!
    2424! Former revisions:
     
    225225!--       Normal case: horizontal surface
    226226          IF ( use_reference )  THEN
     227             !$acc kernels present( nzb_s_inner, hom, tend, var )
     228             !$acc loop
    227229             DO  i = i_left, i_right
    228230                DO  j = j_south, j_north
     231                   !$acc loop independent vector(32)
    229232                   DO  k = nzb_s_inner(j,i)+1, nzt-1
    230233                      tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * &
     
    236239                ENDDO
    237240             ENDDO
     241             !$acc end kernels
    238242          ELSE
    239243             !$acc kernels present( nzb_s_inner, hom, tend, var )
  • palm/trunk/SOURCE/diffusion_e.f90

    r1132 r1171  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! use_reference-case activated in accelerator version
    2323!
    2424! Former revisions:
     
    317317!--    runtime errors occur with -C hopt on NEC
    318318       IF ( use_reference )  THEN
    319           STOP '+++ use_reference not implemented in diffusion_e_acc'
    320 !          DO  i = nxl, nxr
    321 !             DO  j = nys, nyn
    322 !                DO  k = nzb_s_inner(j,i)+1, nzt
    323 !
    324 !--                Calculate the mixing length (for dissipation)
    325 !                   dvar_dz = atmos_ocean_sign * &
    326 !                             ( var(k+1,j,i) - var(k-1,j,i) ) * dd2zu(k)
    327 !                   IF ( dvar_dz > 0.0 ) THEN
    328 !                      l_stable = 0.76 * SQRT( e(k,j,i) ) / &
    329 !                                 SQRT( g / var_reference * dvar_dz ) + 1E-5
    330 !                   ELSE
    331 !                      l_stable = l_grid(k)
    332 !                   ENDIF
    333 !
    334 !--                Adjustment of the mixing length
    335 !                   IF ( wall_adjustment )  THEN
    336 !                      l(k,j)  = MIN( wall_adjustment_factor *          &
    337 !                                     ( zu(k) - zw(nzb_s_inner(j,i)) ), &
    338 !                                     l_grid(k), l_stable )
    339 !                      ll(k,j) = MIN( wall_adjustment_factor *          &
    340 !                                     ( zu(k) - zw(nzb_s_inner(j,i)) ), &
    341 !                                     l_grid(k) )
    342 !                   ELSE
    343 !                      l(k,j)  = MIN( l_grid(k), l_stable )
    344 !                      ll(k,j) = l_grid(k)
    345 !                   ENDIF
    346 !
    347 !                ENDDO
    348 !             ENDDO
    349 !
    350 !
    351 !--          Calculate the tendency terms
    352 !             DO  j = nys, nyn
    353 !                DO  k = nzb_s_inner(j,i)+1, nzt
    354 !
    355 !                    dissipation(k,j) = ( 0.19 + 0.74 * l(k,j) / ll(k,j) ) * &
    356 !                                       e(k,j,i) * SQRT( e(k,j,i) ) / l(k,j)
    357 !
    358 !                    tend(k,j,i) = tend(k,j,i)                                  &
    359 !                                        + (                                    &
    360 !                          ( km(k,j,i)+km(k,j,i+1) ) * ( e(k,j,i+1)-e(k,j,i) )  &
    361 !                        - ( km(k,j,i)+km(k,j,i-1) ) * ( e(k,j,i)-e(k,j,i-1) )  &
    362 !                                          ) * ddx2                             &
    363 !                                        + (                                    &
    364 !                          ( km(k,j,i)+km(k,j+1,i) ) * ( e(k,j+1,i)-e(k,j,i) )  &
    365 !                        - ( km(k,j,i)+km(k,j-1,i) ) * ( e(k,j,i)-e(k,j-1,i) )  &
    366 !                                          ) * ddy2                             &
    367 !                                        + (                                    &
    368 !               ( km(k,j,i)+km(k+1,j,i) ) * ( e(k+1,j,i)-e(k,j,i) ) * ddzu(k+1) &
    369 !             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
    370 !                                          ) * ddzw(k)                          &
    371 !                             - dissipation(k,j)
    372 !
    373 !                ENDDO
    374 !             ENDDO
    375 !
    376 !
    377 !--          Store dissipation if needed for calculating the sgs particle
    378 !--          velocities
    379 !             IF ( use_sgs_for_particles  .OR.  wang_kernel )  THEN
    380 !                DO  j = nys, nyn
    381 !                   DO  k = nzb_s_inner(j,i)+1, nzt
    382 !                      diss(k,j,i) = dissipation(k,j)
    383 !                   ENDDO
    384 !                ENDDO
    385 !             ENDIF
    386 !
    387 !          ENDDO
    388 !
     319
     320          !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
     321          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
     322          !$acc loop
     323          DO  i = i_left, i_right
     324             DO  j = j_south, j_north
     325                !$acc loop vector( 32 )
     326                DO  k = 1, nzt
     327
     328                   IF ( k > nzb_s_inner(j,i) )  THEN
     329!
     330!--                   Calculate the mixing length (for dissipation)
     331                      dvar_dz = atmos_ocean_sign * &
     332                                ( var(k+1,j,i) - var(k-1,j,i) ) * dd2zu(k)
     333                      IF ( dvar_dz > 0.0 ) THEN
     334                         l_stable = 0.76 * SQRT( e(k,j,i) ) / &
     335                                    SQRT( g / var_reference * dvar_dz ) + 1E-5
     336                      ELSE
     337                         l_stable = l_grid(k)
     338                      ENDIF
     339!
     340!--                   Adjustment of the mixing length
     341                      IF ( wall_adjustment )  THEN
     342                         l  = MIN( wall_adjustment_factor *          &
     343                                   ( zu(k) - zw(nzb_s_inner(j,i)) ), &
     344                                   l_grid(k), l_stable )
     345                         ll = MIN( wall_adjustment_factor *          &
     346                                   ( zu(k) - zw(nzb_s_inner(j,i)) ), &
     347                                   l_grid(k) )
     348                      ELSE
     349                         l  = MIN( l_grid(k), l_stable )
     350                         ll = l_grid(k)
     351                      ENDIF
     352!
     353!--                   Calculate the tendency terms
     354                      dissipation = ( 0.19 + 0.74 * l / ll ) * &
     355                                    e(k,j,i) * SQRT( e(k,j,i) ) / l
     356
     357                      tend(k,j,i) = tend(k,j,i)                                  &
     358                                        + (                                    &
     359                          ( km(k,j,i)+km(k,j,i+1) ) * ( e(k,j,i+1)-e(k,j,i) )  &
     360                        - ( km(k,j,i)+km(k,j,i-1) ) * ( e(k,j,i)-e(k,j,i-1) )  &
     361                                          ) * ddx2                             &
     362                                        + (                                    &
     363                          ( km(k,j,i)+km(k,j+1,i) ) * ( e(k,j+1,i)-e(k,j,i) )  &
     364                        - ( km(k,j,i)+km(k,j-1,i) ) * ( e(k,j,i)-e(k,j-1,i) )  &
     365                                          ) * ddy2                             &
     366                                        + (                                    &
     367               ( km(k,j,i)+km(k+1,j,i) ) * ( e(k+1,j,i)-e(k,j,i) ) * ddzu(k+1) &
     368             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
     369                                          ) * ddzw(k)                          &
     370                                  - dissipation
     371
     372!
     373!--                   Store dissipation if needed for calculating the sgs particle
     374!--                   velocities
     375                      IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.      &
     376                           turbulence )  THEN
     377                         diss(k,j,i) = dissipation
     378                      ENDIF
     379
     380                   ENDIF
     381
     382                ENDDO
     383             ENDDO
     384          ENDDO
     385          !$acc end kernels
     386
    389387       ELSE
    390388
     
    439437             - ( km(k,j,i)+km(k-1,j,i) ) * ( e(k,j,i)-e(k-1,j,i) ) * ddzu(k)   &
    440438                                          ) * ddzw(k)                          &
    441                              - dissipation
     439                                  - dissipation
    442440
    443441!
  • palm/trunk/SOURCE/init_3d_model.f90

    r1160 r1171  
    2323! Current revisions:
    2424! ------------------
    25 !
     25! diss array is allocated with full size if accelerator boards are used
    2626!
    2727! Former revisions:
     
    3434! 1153 2013-05-10 14:33:08Z raasch
    3535! diss array is allocated with dummy elements even if it is not needed
    36 ! (required by PGI 12.3 / CUDA 5.0)
     36! (required by PGI 13.4 / CUDA 5.0)
    3737!
    3838! 1115 2013-03-26 18:16:16Z hoffmann
     
    507507!-- 3D-array for storing the dissipation, needed for calculating the sgs
    508508!-- particle velocities
    509     IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence )  THEN
     509    IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence  .OR.  &
     510         num_acc_per_node > 0 )  THEN
     511       print*, '*** allocating diss'
    510512       ALLOCATE( diss(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    511     ELSE
    512        ALLOCATE( diss(2,2,2) )
    513513    ENDIF
    514514
  • palm/trunk/SOURCE/time_integration.f90

    r1132 r1171  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! split of prognostic_equations deactivated (comment lines)
    2323!
    2424! Former revisions:
     
    245245             CALL prognostic_equations_vector
    246246          ELSEIF ( loop_optimization == 'acc' )  THEN
    247 !             i_left  = nxl;         i_right = nxr
     247             i_left  = nxl;         i_right = nxr
     248             j_south = nys;         j_north = nyn
     249             CALL prognostic_equations_acc
     250
     251!             i_left  = nxl;         i_right = nxl+nbgp-1
    248252!             j_south = nys;         j_north = nyn
    249253!             CALL prognostic_equations_acc
    250 
    251              i_left  = nxl;         i_right = nxl+nbgp-1
    252              j_south = nys;         j_north = nyn
    253              CALL prognostic_equations_acc
    254              i_left  = nxr-nbgp+1;  i_right = nxr
    255              j_south = nys;         j_north = nyn
    256              CALL prognostic_equations_acc
     254!             i_left  = nxr-nbgp+1;  i_right = nxr
     255!             j_south = nys;         j_north = nyn
     256!             CALL prognostic_equations_acc
    257257
    258258!
     
    310310             ENDIF
    311311
    312              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    313              j_south = nys;         j_north = nys+nbgp-1
    314              CALL prognostic_equations_acc
    315              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    316              j_south = nyn-nbgp+1;  j_north = nyn
    317              CALL prognostic_equations_acc
     312!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     313!             j_south = nys;         j_north = nys+nbgp-1
     314!             CALL prognostic_equations_acc
     315!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     316!             j_south = nyn-nbgp+1;  j_north = nyn
     317!             CALL prognostic_equations_acc
    318318
    319319             IF ( background_communication )  THEN
     
    374374             ENDIF
    375375
    376              i_left  = nxl+nbgp;    i_right = nxr-nbgp
    377              j_south = nys+nbgp;    j_north = nyn-nbgp
    378              CALL prognostic_equations_acc
     376!             i_left  = nxl+nbgp;    i_right = nxr-nbgp
     377!             j_south = nys+nbgp;    j_north = nyn-nbgp
     378!             CALL prognostic_equations_acc
    379379
    380380             IF ( background_communication )  THEN
Note: See TracChangeset for help on using the changeset viewer.