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",
# A number of colours for the various types. Recycled when there are
# more task types than colours...
colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"sienna", "aquamarine", "bisque", "blue", "green", "brown",
"purple", "moccasin", "olivedrab", "chartreuse", "darksage",
"darkgreen", "green", "mediumseagreen", "mediumaquamarine",
"darkslategrey", "mediumturquoise", "black", "cadetblue", "skyblue",
"red", "slategray", "gold", "slateblue", "blueviolet",
"mediumorchid", "firebrick", "magenta", "hotpink", "pink"]
"sienna", "aquamarine", "bisque", "blue", "green", "lightgreen",
"brown", "purple", "moccasin", "olivedrab", "chartreuse",
"darksage", "darkgreen", "green", "mediumseagreen",
"mediumaquamarine", "darkslategrey", "mediumturquoise",
"black", "cadetblue", "skyblue", "red", "slategray", "gold",
"slateblue", "blueviolet", "mediumorchid", "firebrick",
"magenta", "hotpink", "pink", "orange", "lightgreen"]
maxcolours = len(colours)
# Set colours of task/subtype.
......
......@@ -95,9 +95,10 @@ pl.rcParams.update(PLOT_PARAMS)
# Tasks and subtypes. Indexed as in tasks.h.
TASKTYPES = ["none", "sort", "self", "pair", "sub_self", "sub_pair",
"init_grav", "ghost", "extra_ghost", "drift", "kick1", "kick2",
"timestep", "send", "recv", "grav_top_level", "grav_long_range",
"grav_mm", "grav_down", "cooling", "sourceterms", "count"]
"init_grav", "ghost", "extra_ghost", "drift_part", "drift_gpart",
"kick1", "kick2", "timestep", "send", "recv", "grav_top_level",
"grav_long_range", "grav_mm", "grav_down", "cooling",
"sourceterms", "count"]
SUBTYPES = ["none", "density", "gradient", "force", "grav", "external_grav",
"tend", "xv", "rho", "gpart", "multipole", "spart", "count"]
......@@ -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
# more task types than colours...
colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"sienna", "aquamarine", "bisque", "blue", "green", "brown",
"purple", "mocassin", "olivedrab", "chartreuse", "darksage",
"darkgreen", "green", "mediumseagreen", "mediumaquamarine",
"darkslategrey", "mediumturquoise", "black", "cadetblue", "skyblue",
"red", "slategray", "gold", "slateblue", "blueviolet",
"mediumorchid", "firebrick", "magenta", "hotpink", "pink",
"orange", "lightgreen"]
"sienna", "aquamarine", "bisque", "blue", "green", "lightgreen",
"brown", "purple", "moccasin", "olivedrab", "chartreuse",
"darksage", "darkgreen", "green", "mediumseagreen",
"mediumaquamarine", "darkslategrey", "mediumturquoise",
"black", "cadetblue", "skyblue", "red", "slategray", "gold",
"slateblue", "blueviolet", "mediumorchid", "firebrick",
"magenta", "hotpink", "pink", "orange", "lightgreen"]
maxcolours = len(colours)
# Set colours of task/subtype.
......@@ -141,9 +141,9 @@ for task in SUBTYPES:
# For fiddling with colours...
if args.verbose:
print "#Selected colours:"
for task in TASKCOLOURS.keys():
for task in sorted(TASKCOLOURS.keys()):
print "# " + task + ": " + TASKCOLOURS[task]
for task in SUBCOLOURS.keys():
for task in sorted(SUBCOLOURS.keys()):
print "# " + task + ": " + SUBCOLOURS[task]
# Read input.
......@@ -171,12 +171,14 @@ delta_t = delta_t * CPU_CLOCK
if delta_t == 0:
for rank in range(nranks):
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:
delta_t = dt
print "Data range: ", delta_t / CPU_CLOCK, "ms"
# Once more doing the real gather and plots this time.
for rank in range(nranks):
data = sdata[sdata[:,0] == rank]
......@@ -186,6 +188,8 @@ for rank in range(nranks):
tic_step = int(full_step[5])
toc_step = int(full_step[6])
data = data[1:,:]
typesseen = []
nethread = 0
# Dummy image for ranks that have no tasks.
if data.size == 0:
......
......@@ -57,6 +57,7 @@ done
# And process them,
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 "./analyse_tasks.py \$0 > \$2.stats"
echo "Writing output index.html file"
# Construct document - serial.
......@@ -75,8 +76,21 @@ echo $list | xargs -n 3 | while read f s g; do
<h2>Step $s</h2>
EOF
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
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
cat <<EOF >> index.html
......
......@@ -62,6 +62,7 @@ nrank=$(($nrank-1))
# And process them,
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 "./analyse_tasks_MPI.py \$0 > \$2.stats"
echo "Writing output index.html file"
# Construct document - serial.
......@@ -78,12 +79,31 @@ EOF
echo $list | xargs -n 3 | while read f s g; do
cat <<EOF >> index.html
<h2>Step $s</h2>
<ul style="list-style-type:none">
<li>
EOF
for i in $(seq 0 $nrank); do
cat <<EOF >> index.html
<a href="step${s}r${i}.png"><img src="step${s}r${i}.png" width=400px/></a>
EOF
cat <<EOF2 >> index.html
<a href="step${s}r${i}.html"><img src="step${s}r${i}.png" width=400px/></a>
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
cat <<EOF >> index.html
</li>
</ul>
EOF
done
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