Skip to content

Commit

Permalink
add tile-dist.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuang-jedi committed Sep 10, 2022
1 parent 211816c commit 6228ab4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
22 changes: 15 additions & 7 deletions parallel-stats-profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ def stats(self, flnm):
print('Filename ' + flnm + ' does not exit. Stop')
sys.exit(-1)

print('flnm:', flnm)
par_stats = {}
with open(flnm) as fp:
lines = fp.readlines()
#line = fp.readline()
num_lines = len(lines)
#print('Total number of lines: ', num_lines)
print('Total number of lines: ', num_lines)

nl = 0
while(nl < num_lines):
if(lines[nl].find('Parallel Timing Statistics') > 0):
#if(self.debug):
# print('Start Parallel Timing Statistics')
if(self.debug):
print('Start Parallel Timing Statistics')
nl, par_stats = self.parallel_time_stats(lines, nl)
nl += num_lines
nl += 1
Expand All @@ -190,9 +191,9 @@ def parallel_time_stats(self, lines, nl):
#print('Line ' + str(ns) + ': ' + line)

item = line.split(': ')
#print(item)
#print('item=', item)
namestr = item[0].strip()
#print(namestr)
#print('namestr:', namestr)
if(namestr.find('OOPS_STATS ') >= 0):
name = namestr[headleng:]
else:
Expand All @@ -202,6 +203,7 @@ def parallel_time_stats(self, lines, nl):
while(tstr.find(' ') > 0):
tstr = tstr.replace(' ', ' ')
tlist = tstr.split(' ')
#print('tlist:', tlist)

tinfo = {}
tinfo['min'] = float(tlist[0])
Expand All @@ -210,7 +212,7 @@ def parallel_time_stats(self, lines, nl):
#tinfo['percent'] = float(tlist[3])
#tinfo['imbalance'] = float(tlist[4])

#print('name: %s, avg: %f' %(name, tinfo['avg']))
print('name: %s, max: %f' %(name, tinfo['max']))

stats[name] = tinfo

Expand Down Expand Up @@ -255,12 +257,18 @@ def get_main_statstime(self, funclabels, funclist):
statspercent = np.zeros((il, kl))
for k in range(kl):
stats = self.parstatslist[k]
print('stats.keys():', stats.keys())
for i in range(il):
name = self.funclist[i]
if(name in stats.keys()):
statstime[i][k] = stats[name]['max']*0.001/60.0
print('k: %d, i: %d, %s: %f' %(k, i, name, statstime[i][k]))

if('util::Timers::Total' in stats.keys()):
totalmax = stats['util::Timers::Total']['max']*0.001/60.0
else:
totalmax = 1000.0

totalmax = stats['util::Timers::Total']['max']*0.001/60.0
for i in range(il):
statspercent[i][k] = 100.0*statstime[i][k]/totalmax

Expand Down
18 changes: 18 additions & 0 deletions tile-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -x

temp_dir=/work2/noaa/gsienkf/weihuang/jedi/run
nodelist=(1 2 4 8)
corelist=(36 72 144 288)

for i in ${!nodelist[@]}
do
workdir=${temp_dir}/run_80.40t${nodelist[$i]}n_${corelist[$i]}p/stdoutNerr
imgname=dist_${nodelist[$i]}n.png

python tile-dist.py --output=1 \
--workdir=${workdir} \
--imagename=${imgname}
done

5 changes: 4 additions & 1 deletion timingobserver
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
workdir=/work2/noaa/gsienkf/weihuang/jedi/per_core_timing/run
#caselist=(halo_aircraft)
#caselist=(anna_roundRobin_aircraft)
caselist=(anna_halo_aircraft anna_roundRobin_aircraft halo_aircraft roundRobin_aircraft)
#caselist=(anna_halo_aircraft anna_roundRobin_aircraft halo_aircraft roundRobin_aircraft)
#caselist=(anna_halo_aircraft_2 anna_roundRobin_aircraft_2)
#caselist=(solver_halo_aircraft)
caselist=(solver_RoundRobin_aircraft)

for i in ${!caselist[@]}
do
Expand Down

0 comments on commit 6228ab4

Please sign in to comment.