Skip to content
Snippets Groups Projects
Commit 8150b930 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Use new analysis scripts in the processing (click on image to see stats plus larger image)

Add a colour to keep similarity to previous scheme
parent 44bb964b
No related branches found
No related tags found
1 merge request!347Update task dump processing
...@@ -106,14 +106,14 @@ FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force", ...@@ -106,14 +106,14 @@ FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force",
# A number of colours for the various types. Recycled when there are # A number of colours for the various types. Recycled when there are
# more task types than colours... # more task types than colours...
colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue", colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"sienna", "aquamarine", "bisque", "blue", "green", "brown", "sienna", "aquamarine", "bisque", "blue", "green", "lightgreen",
"purple", "moccasin", "olivedrab", "chartreuse", "darksage", "brown", "purple", "moccasin", "olivedrab", "chartreuse",
"darkgreen", "green", "mediumseagreen", "mediumaquamarine", "darksage", "darkgreen", "green", "mediumseagreen",
"darkslategrey", "mediumturquoise", "black", "cadetblue", "skyblue", "mediumaquamarine", "darkslategrey", "mediumturquoise",
"red", "slategray", "gold", "slateblue", "blueviolet", "black", "cadetblue", "skyblue", "red", "slategray", "gold",
"mediumorchid", "firebrick", "magenta", "hotpink", "pink"] "slateblue", "blueviolet", "mediumorchid", "firebrick",
"magenta", "hotpink", "pink", "orange", "lightgreen"]
maxcolours = len(colours) maxcolours = len(colours)
# Set colours of task/subtype. # Set colours of task/subtype.
......
...@@ -95,9 +95,10 @@ pl.rcParams.update(PLOT_PARAMS) ...@@ -95,9 +95,10 @@ pl.rcParams.update(PLOT_PARAMS)
# Tasks and subtypes. Indexed as in tasks.h. # Tasks and subtypes. Indexed as in tasks.h.
TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair", TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair",
"init_grav", "ghost", "extra_ghost", "drift", "kick1", "kick2", "init_grav", "ghost", "extra_ghost", "drift_part", "drift_gpart",
"timestep", "send", "recv", "grav_top_level", "grav_long_range", "kick1", "kick2", "timestep", "send", "recv", "grav_top_level",
"grav_mm", "grav_down", "cooling", "sourceterms", "count"] "grav_long_range", "grav_mm", "grav_down", "cooling",
"sourceterms", "count"]
SUBTYPES = ["none", "density", "gradient", "force", "grav", "external_grav", SUBTYPES = ["none", "density", "gradient", "force", "grav", "external_grav",
"tend", "xv", "rho", "gpart", "multipole", "spart", "count"] "tend", "xv", "rho", "gpart", "multipole", "spart", "count"]
...@@ -111,15 +112,14 @@ FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force", ...@@ -111,15 +112,14 @@ FULLTYPES = ["self/force", "self/density", "self/grav", "sub_self/force",
# A number of colours for the various types. Recycled when there are # A number of colours for the various types. Recycled when there are
# more task types than colours... # more task types than colours...
colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue", colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"sienna", "aquamarine", "bisque", "blue", "green", "brown", "sienna", "aquamarine", "bisque", "blue", "green", "lightgreen",
"purple", "mocassin", "olivedrab", "chartreuse", "darksage", "brown", "purple", "moccasin", "olivedrab", "chartreuse",
"darkgreen", "green", "mediumseagreen", "mediumaquamarine", "darksage", "darkgreen", "green", "mediumseagreen",
"darkslategrey", "mediumturquoise", "black", "cadetblue", "skyblue", "mediumaquamarine", "darkslategrey", "mediumturquoise",
"red", "slategray", "gold", "slateblue", "blueviolet", "black", "cadetblue", "skyblue", "red", "slategray", "gold",
"mediumorchid", "firebrick", "magenta", "hotpink", "pink", "slateblue", "blueviolet", "mediumorchid", "firebrick",
"orange", "lightgreen"] "magenta", "hotpink", "pink", "orange", "lightgreen"]
maxcolours = len(colours) maxcolours = len(colours)
# Set colours of task/subtype. # Set colours of task/subtype.
...@@ -141,9 +141,9 @@ for task in SUBTYPES: ...@@ -141,9 +141,9 @@ for task in SUBTYPES:
# For fiddling with colours... # For fiddling with colours...
if args.verbose: if args.verbose:
print "#Selected colours:" print "#Selected colours:"
for task in TASKCOLOURS.keys(): for task in sorted(TASKCOLOURS.keys()):
print "# " + task + ": " + TASKCOLOURS[task] print "# " + task + ": " + TASKCOLOURS[task]
for task in SUBCOLOURS.keys(): for task in sorted(SUBCOLOURS.keys()):
print "# " + task + ": " + SUBCOLOURS[task] print "# " + task + ": " + SUBCOLOURS[task]
# Read input. # Read input.
...@@ -171,12 +171,14 @@ delta_t = delta_t * CPU_CLOCK ...@@ -171,12 +171,14 @@ delta_t = delta_t * CPU_CLOCK
if delta_t == 0: if delta_t == 0:
for rank in range(nranks): for rank in range(nranks):
data = sdata[sdata[:,0] == rank] data = sdata[sdata[:,0] == rank]
dt = max(data[:,6]) - min(data[:,5]) full_step = data[0,:]
tic_step = int(full_step[5])
toc_step = int(full_step[6])
dt = toc_step - tic_step
if dt > delta_t: if dt > delta_t:
delta_t = dt delta_t = dt
print "Data range: ", delta_t / CPU_CLOCK, "ms" print "Data range: ", delta_t / CPU_CLOCK, "ms"
# Once more doing the real gather and plots this time. # Once more doing the real gather and plots this time.
for rank in range(nranks): for rank in range(nranks):
data = sdata[sdata[:,0] == rank] data = sdata[sdata[:,0] == rank]
...@@ -186,6 +188,8 @@ for rank in range(nranks): ...@@ -186,6 +188,8 @@ for rank in range(nranks):
tic_step = int(full_step[5]) tic_step = int(full_step[5])
toc_step = int(full_step[6]) toc_step = int(full_step[6])
data = data[1:,:] data = data[1:,:]
typesseen = []
nethread = 0
# Dummy image for ranks that have no tasks. # Dummy image for ranks that have no tasks.
if data.size == 0: if data.size == 0:
......
...@@ -57,6 +57,7 @@ done ...@@ -57,6 +57,7 @@ done
# And process them, # And process them,
echo "Processing thread info files..." echo "Processing thread info files..."
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./plot_tasks.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 " echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./plot_tasks.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 "
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./analyse_tasks.py \$0 > \$2.stats"
echo "Writing output index.html file" echo "Writing output index.html file"
# Construct document - serial. # Construct document - serial.
...@@ -75,8 +76,21 @@ echo $list | xargs -n 3 | while read f s g; do ...@@ -75,8 +76,21 @@ echo $list | xargs -n 3 | while read f s g; do
<h2>Step $s</h2> <h2>Step $s</h2>
EOF EOF
cat <<EOF >> index.html cat <<EOF >> index.html
<a href="step${s}r${i}.png"><img src="step${s}r${i}.png" width=400px/></a> <a href="step${s}r${i}.html"><img src="step${s}r${i}.png" width=400px/></a>
EOF EOF
cat <<EOF > step${s}r${i}.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<img src="step${s}r${i}.png">
<pre>
EOF
cat step${s}r${i}.stats >> step${s}r${i}.html
cat <<EOF >> step${s}r${i}.html
</body>
</html>
EOF
done done
cat <<EOF >> index.html cat <<EOF >> index.html
......
...@@ -62,6 +62,7 @@ nrank=$(($nrank-1)) ...@@ -62,6 +62,7 @@ nrank=$(($nrank-1))
# And process them, # And process them,
echo "Processing thread info files..." echo "Processing thread info files..."
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./plot_tasks_MPI.py --expand 1 --limit $TIMERANGE \$0 \$2 " echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./plot_tasks_MPI.py --expand 1 --limit $TIMERANGE \$0 \$2 "
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "./analyse_tasks_MPI.py \$0 > \$2.stats"
echo "Writing output index.html file" echo "Writing output index.html file"
# Construct document - serial. # Construct document - serial.
...@@ -78,12 +79,31 @@ EOF ...@@ -78,12 +79,31 @@ EOF
echo $list | xargs -n 3 | while read f s g; do echo $list | xargs -n 3 | while read f s g; do
cat <<EOF >> index.html cat <<EOF >> index.html
<h2>Step $s</h2> <h2>Step $s</h2>
<ul style="list-style-type:none">
<li>
EOF EOF
for i in $(seq 0 $nrank); do for i in $(seq 0 $nrank); do
cat <<EOF >> index.html cat <<EOF2 >> index.html
<a href="step${s}r${i}.png"><img src="step${s}r${i}.png" width=400px/></a> <a href="step${s}r${i}.html"><img src="step${s}r${i}.png" width=400px/></a>
EOF EOF2
cat <<EOF2 > step${s}r${i}.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<img src="step${s}r${i}.png">
<pre>
EOF2
cat step${s}r.stats >> step${s}r${i}.html
cat <<EOF2 >> step${s}r${i}.html
</pre>
</body>
</html>
EOF2
done done
cat <<EOF >> index.html
</li>
</ul>
EOF
done done
cat <<EOF >> index.html cat <<EOF >> index.html
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment