New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
MEM_size_osxxlf.ksh in tags/nemo_v3_2/nemo_v3_2/NVTK/INSTALL/JOBS – NEMO

source: tags/nemo_v3_2/nemo_v3_2/NVTK/INSTALL/JOBS/MEM_size_osxxlf.ksh @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

File size: 3.9 KB
Line 
1#!/bin/ksh
2# $Id: MEM_size_osxxlf.ksh 1564 2009-07-31 12:31:31Z ctlod $
3##############################################################
4# Original : C. Talandier for NEMO team
5# Contact  : nemo_st@locean-ipsl.upmc.fr
6#
7# It is called by the assessment.ksh script for a
8# given configuration
9#
10# INPUT ARGS: 6
11#     - zmxcu  : (0/1) mon${CONF}_err file (do/do not) exist"
12#     - zxrs   : (0/1) Ref memory_size.txt file (do/do not) exist"
13#     - zxrm   : (0/1) Ref mon${CONF}_err file (do/do not) exist"
14#     - zexp   : experience name directory"
15#     - zconf  : configuration name"
16#     - zout   : output file name"
17#     - ztag   : tag name to which are compared files"
18#
19# WORK: It aims to :
20#
21#      - Treat output timing from the osxxlf target for
22#        mon, mpi runs
23#     *- compare it to a reference version
24#
25# * this step is performed only if a reference tag
26#   is specified with the -t option and if files exist.
27#   See the Makefile under ./config/NVTK directory
28#
29##############################################################
30#set -xv
31##############################################################
32
33# Get the name of the present script
34nscript=$( (basename $0) )
35
36#
37# help_CPU_time() To print help
38#
39function help_CPU_time
40{
41  echo "Usage: $nscript [-a] [-b] [-d] [-c] [-o] [-t]"
42  echo "Options: These are optional argument"
43  echo " -a : (0/1) mon${CONF}_err file (do/do not) exist"
44  echo " -b : (0/1) Ref memory_size.txt file (do/do not) exist"
45  echo " -d : (0/1) Ref mon${CONF}_err file (do/do not) exist"
46  echo " -e : experience name directory"
47  echo " -c : configuration name"
48  echo " -o : output file name"
49  echo " -t : tag name to which are compared files"
50  echo " their values are not taken)"
51  exit 1
52}
53
54# Initialization
55zmxcu=1
56zxrs=1
57zxrm=1
58zexp=
59zconf=
60zout=
61ztag=
62
63# Get arguments
64while getopts a:b:d:e:c:o:t: opt
65do
66  case "$opt" in
67    a) zmxcu="$OPTARG";;
68    b) zxrs="$OPTARG";;
69    d) zxrm="$OPTARG";;
70    e) zexp="$OPTARG";;
71    c) zconf="$OPTARG";;
72    o) zout="$OPTARG";;
73    t) ztag="$OPTARG";;
74    *) help_MEM_size;;
75  esac
76done
77
78# Check if results must be compared to the reference version
79test -n "${ztag}"
80evaltag=$?
81
82zfilecs='mon/LONG/${zexp}/memory_size.txt'
83zfilers='mon/LONG/${ztag}/memory_size.txt'
84
85# Select only appropriate lines
86grep -v Stack ${zfilecs} | head -1 > temp_cs_sck
87tail -1 ${zfilecs}                 > temp_cs_sic
88
89# Select only appropriate lines
90grep -v Stack ${zfilers} | head -1 > temp_rs_sck
91tail -1 ${zfilers}                 > temp_rs_sic
92
93# If reference version files exist
94if [ ${evaltag} == 0 -a ${zxrs} == 0 ] ;  then
95    # Get values from the reference tag
96    Mo_stack_ms=$( (awk '{print $5/(1024*1024) }' temp_rs_sck ) )
97    Mo_stati_ms=$( (awk '{print $5/(1024*1024) }' temp_rs_sic ) )
98
99    # Print: Variable long name | current version values | reference version values | variations
100    echo "                                                 " >> ${zout}
101    echo "                                      Version    " >> ${zout}
102    echo "             Memory          Current /       \ ${ztag}        Variation " >> ${zout}
103    awk ' { val=$5/(1024*1024) } {printf("%-9s %-16s %8.1f      |   %8.1f     |    %5.1f \n ", " ", "Stack     (Mo) :", val, inck, ((val-inck)/inck)*100 ) }' inck=${Mo_stack_ms} temp_cs_sck >> ${zout}
104    awk ' { val=$5/(1024*1024) } {printf("%-8s %-16s %8.1f      |   %8.1f     |    %5.1f \n ", " ", "Static    (Mo) :", val, inti, ((val-inti)/inti)*100 ) }' inti=${Mo_stati_ms} temp_cs_sic >> ${zout}
105else
106    # Print: Variable long name | current version values
107    echo "                                                 " >> ${zout}
108    echo "             Memory          Current version "     >> ${zout}
109    awk ' {printf("%-9s %-.16s %11.1f\n ", " ", "Stack     (Mo) :", $5/(1024*1024) ) }' temp_cs_sck >> ${zout}
110    awk ' {printf("%-8s %-.16s %11.1f\n ", " ", "Static    (Mo) :", $5/(1024*1024) ) }' temp_cs_sic >> ${zout}
111fi
112
Note: See TracBrowser for help on using the repository browser.