1 | #!/bin/bash |
---|
2 | #! |
---|
3 | # @ shell = /usr/bin/ksh |
---|
4 | # @ job_name = MPI_config |
---|
5 | # @ output = out.$(job_name).$(jobid) |
---|
6 | # @ error = err.$(job_name).$(jobid) |
---|
7 | # @ job_type = parallel |
---|
8 | # @ total_tasks = NPROCS |
---|
9 | # @ wall_clock_limit = 0:30:00 |
---|
10 | # @ resources = ConsumableMemory(1562mb) |
---|
11 | # @ class = parallel |
---|
12 | # @ node_usage = shared |
---|
13 | # @ notification = error |
---|
14 | # @ task_affinity = core |
---|
15 | # @ group = science |
---|
16 | # @ queue |
---|
17 | |
---|
18 | ulimit -c unlimited |
---|
19 | ulimit -s unlimited |
---|
20 | # |
---|
21 | # Test specific settings. Do not hand edit these lines; the fcm_job.sh script will set these |
---|
22 | # (via sed operating on this template job file). |
---|
23 | # |
---|
24 | OCEANCORES=NPROCS |
---|
25 | export SETTE_DIR=DEF_SETTE_DIR |
---|
26 | |
---|
27 | ############################################################### |
---|
28 | # |
---|
29 | # set up mpp computing environment |
---|
30 | # |
---|
31 | # Local settings for machine IBM Power7 (hpc2e at UK Met Office) |
---|
32 | # |
---|
33 | export MPIRUN="poe -pgmodel $MP_PGMMODEL -n $OCEANCORES -cmdfile" |
---|
34 | |
---|
35 | # |
---|
36 | # load sette functions (only post_test_tidyup needed) |
---|
37 | # |
---|
38 | . ${SETTE_DIR}/all_functions.sh |
---|
39 | |
---|
40 | # Don't remove neither change the following comment line |
---|
41 | # BODY |
---|
42 | |
---|
43 | |
---|
44 | # |
---|
45 | # These variables are needed by post_test_tidyup function in all_functions.sh |
---|
46 | # |
---|
47 | export EXE_DIR=DEF_EXE_DIR |
---|
48 | export INPUT_DIR=DEF_INPUT_DIR |
---|
49 | export CONFIG_DIR=DEF_CONFIG_DIR |
---|
50 | export TOOLS_DIR=DEF_TOOLS_DIR |
---|
51 | export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION |
---|
52 | export NEW_CONF=DEF_NEW_CONF |
---|
53 | export CMP_NAM=DEF_CMP_NAM |
---|
54 | export TEST_NAME=DEF_TEST_NAME |
---|
55 | # |
---|
56 | # end of set up |
---|
57 | |
---|
58 | |
---|
59 | ############################################################### |
---|
60 | # |
---|
61 | # change to the working directory |
---|
62 | # |
---|
63 | cd ${EXE_DIR} |
---|
64 | |
---|
65 | echo Running on host `hostname` |
---|
66 | echo Time is `date` |
---|
67 | echo Directory is `pwd` |
---|
68 | # |
---|
69 | # Run the parallel MPI executable |
---|
70 | # |
---|
71 | if [ MPI_FLAG == "yes" ]; then |
---|
72 | n=1 |
---|
73 | echo "./opa" > ./alltasks |
---|
74 | while [ $n -lt $OCEANCORES ] |
---|
75 | do |
---|
76 | echo "./opa" >> ./alltasks |
---|
77 | n=$(( $n + 1 )) |
---|
78 | done |
---|
79 | time ${MPIRUN} ./alltasks |
---|
80 | else |
---|
81 | time ./opa |
---|
82 | fi |
---|
83 | |
---|
84 | |
---|
85 | # |
---|
86 | post_test_tidyup |
---|
87 | |
---|
88 | # END_BODY |
---|
89 | # Don't remove neither change the previous comment line |
---|
90 | |
---|
91 | exit |
---|