source: palm/trunk/SCRIPTS/palm_simple_run @ 1171

Last change on this file since 1171 was 1171, checked in by raasch, 11 years ago

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)

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1#!/bin/ksh
2#--------------------------------------------------------------------------------#
3# This file is part of PALM.
4#
5# PALM is free software: you can redistribute it and/or modify it under the terms
6# of the GNU General Public License as published by the Free Software Foundation,
7# either version 3 of the License, or (at your option) any later version.
8#
9# PALM is distributed in the hope that it will be useful, but WITHOUT ANY
10# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along with
14# PALM. If not, see <http://www.gnu.org/licenses/>.
15#
16# Copyright 1997-2012  Leibniz University Hannover
17#--------------------------------------------------------------------------------#
18#
19# Current revisions:
20# -----------------
21# new option -e which defines the execution command to be used to run PALM
22#
23# Former revisions:
24# -----------------
25# $Id: palm_simple_run 1171 2013-05-30 11:27:45Z raasch $
26#
27# 1046 2012-11-09 14:38:45Z maronga
28# 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
33
34
35#--------------------------------------------------------------------------------#
36# palm_simple_run - a simple method for running the palm code without
37#                   using the mrun script
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#--------------------------------------------------------------------------------#
46
47
48    # Variable declarations + default values
49 case=example_cbl
50 cpumax=999999
51 execute_for=unknown
52 localhost=unknown
53 localhost_realname=$(hostname)
54 mpi_procs=1
55 mpi_procs_per_node=1
56 openmp_threads=1
57
58 typeset -i  ii
59
60
61    # Read shellscript options
62 while  getopts  :c:e:l:n:p:t:  option
63 do
64   case  $option  in
65       (c)   case=$OPTARG;;
66       (e)   execute_for=$OPTARG;;
67       (l)   localhost=$OPTARG;;
68       (n)   mpi_procs_per_node=$OPTARG;;
69       (p)   mpi_procs=$OPTARG;;
70       (t)   openmp_threads=$OPTARG;;
71       (\?)  printf "\n  +++ unknown option $OPTARG \n"
72             printf "\n      allowed option are -c, -e, -l, -n, -p, -t \n"
73             exit;;
74   esac
75 done
76
77
78    # Find out the global svn revision number
79 global_revision=`svnversion ${palm_dir}trunk  2>/dev/null`
80 global_revision="Rev: $global_revision"
81
82
83    # Generate unique directory/files for this run
84 timedate="`date +%d.%b_%H:%M:%S`"
85 suffix=$case+$mpi_procs+$timedate
86 RUNDIR=OUTPUT.$suffix/
87
88 if [[ ! -d $RUNDIR ]]
89 then
90    mkdir $RUNDIR
91    echo "*** running in directory $RUNDIR"
92 else
93    echo "+++ ERROR: $RUNDIR exists\!   Must be unique.  Exiting."
94    exit
95 fi
96
97
98    # Check if palm has been installed and copy executable into the run
99    # directory
100 if [[ ! -f ${palm_dir}MAKE_DEPOSITORY_simple/palm ]]
101 then
102    echo "+++ ERROR: palm executable does not exist."
103    echo "           Please run \"palm_simple_install\"."
104    exit
105 else
106    cp  ${palm_dir}MAKE_DEPOSITORY_simple/palm  $RUNDIR/palm
107 fi
108
109
110    # Check, if parameter file exists and copy into the run directory
111 if [[ ! -f ${palm_dir}JOBS/${case}/INPUT/${case}_p3d ]]
112 then
113    echo "+++ ERROR: parameter file"
114    echo "           \"${palm_dir}JOBS/${case}/INPUT/${case}_p3d\""
115    echo "           does not exist."
116    exit
117 else
118    cp  ${palm_dir}JOBS/${case}/INPUT/${case}_p3d  $RUNDIR/PARIN
119 fi
120
121
122    # Switch to run directory
123 cd  $RUNDIR
124
125
126
127    # Create NAMELIST file containing environment values needed by palm
128 cat  >  ENVPAR  <<  %%END%%
129 &envpar  run_identifier = '$case', host = '$localhost',
130          write_binary = 'false', tasks_per_node = $mpi_procs_per_node,
131          maximum_cpu_time_allowed = ${cpumax}.,
132          revision = '$global_revision',
133          local_dvrserver_running = .FALSE. /
134
135%%END%%
136
137
138    # Coupled runs cannot be carried out with this simple run script
139 echo "no_coupling"  >  runfile_atmos
140
141
142    # Generate hostfile (if neccessary)
143 (( ii = 1 ))
144 while (( ii <= $mpi_procs ))
145 do
146    echo  $localhost_realname  >>  hostfile
147    (( ii = ii + 1 ))
148 done
149
150
151    # Set number of OpenMP threads
152 export OMP_NUM_THREADS=$openmp_threads
153
154
155
156    # Start palm run
157 echo "*** palm will be run:  MPI tasks: $mpi_procs   OpenMP thread: $OMP_NUM_THREADS"
158
159 case $execute_for in
160
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";;
166
167 esac
168
169 echo "*** palm finished"
170 echo "*** see"
171 echo "    \"$RUNDIR\""
172 echo "    for results"
Note: See TracBrowser for help on using the repository browser.