Skip to content
Snippets Groups Projects
Commit 01766fb4 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Add HTML anchors to the different sections of the task plot webpage.

parent d8dc315e
No related branches found
No related tags found
1 merge request!980Add HTML anchors to the different sections of the task plot webpage.
...@@ -57,9 +57,17 @@ parser.add_argument( ...@@ -57,9 +57,17 @@ parser.add_argument(
default="all", default="all",
action="store", action="store",
) )
parser.add_argument(
"--html",
dest="html",
help="Use html titles and anchors in the output (default: False)",
default=False,
action="store_true",
)
args = parser.parse_args() args = parser.parse_args()
infile = args.input infile = args.input
with_html = args.html
# Tasks and subtypes. Indexed as in tasks.h. # Tasks and subtypes. Indexed as in tasks.h.
TASKTYPES = [ TASKTYPES = [
...@@ -301,6 +309,8 @@ for rank in ranks: ...@@ -301,6 +309,8 @@ for rank in ranks:
sidtimes[my_sid] = [] sidtimes[my_sid] = []
sidtimes[my_sid].append(dt) sidtimes[my_sid].append(dt)
if with_html:
print('<div id="thread{}"></div>'.format(i))
print("# Thread : ", i) print("# Thread : ", i)
for key in sorted(tasktimes.keys()): for key in sorted(tasktimes.keys()):
taskmin = min(tasktimes[key]) taskmin = min(tasktimes[key])
...@@ -319,6 +329,8 @@ for rank in ranks: ...@@ -319,6 +329,8 @@ for rank in ranks:
) )
print() print()
if with_html:
print('<div id="all"></div>')
print("# All threads : ") print("# All threads : ")
for key in sorted(alltasktimes.keys()): for key in sorted(alltasktimes.keys()):
taskmin = min(alltasktimes[key]) taskmin = min(alltasktimes[key])
...@@ -338,6 +350,8 @@ for rank in ranks: ...@@ -338,6 +350,8 @@ for rank in ranks:
print() print()
# For pairs, show stuff sorted by SID # For pairs, show stuff sorted by SID
if with_html:
print('<div id="sid"></div>')
print("# By SID (all threads): ") print("# By SID (all threads): ")
print( print(
"# {0:<17s}: {1:>7s} {2:>9s} {3:>9s} {4:>9s} {5:>9s} {6:>9s}".format( "# {0:<17s}: {1:>7s} {2:>9s} {3:>9s} {4:>9s} {5:>9s} {6:>9s}".format(
...@@ -375,6 +389,8 @@ for rank in ranks: ...@@ -375,6 +389,8 @@ for rank in ranks:
# Dead times. # Dead times.
print("# Times not in tasks (deadtimes)") print("# Times not in tasks (deadtimes)")
print("# ------------------------------") print("# ------------------------------")
if with_html:
print('<div id="before"></div>')
print("# Time before first task:") print("# Time before first task:")
print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) print("# no. : {0:>9s} {1:>9s}".format("value", "percent"))
predeadtimes = [] predeadtimes = []
...@@ -410,6 +426,8 @@ for rank in ranks: ...@@ -410,6 +426,8 @@ for rank in ranks:
) )
print() print()
if with_html:
print('<div id="after"></div>')
print("# Time after last task:") print("# Time after last task:")
print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) print("# no. : {0:>9s} {1:>9s}".format("value", "percent"))
postdeadtimes = [] postdeadtimes = []
...@@ -446,6 +464,8 @@ for rank in ranks: ...@@ -446,6 +464,8 @@ for rank in ranks:
print() print()
# Time in engine, i.e. from first to last tasks. # Time in engine, i.e. from first to last tasks.
if with_html:
print('<div id="between"></div>')
print("# Time between tasks (engine deadtime):") print("# Time between tasks (engine deadtime):")
print( print(
"# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format(
...@@ -503,6 +523,8 @@ for rank in ranks: ...@@ -503,6 +523,8 @@ for rank in ranks:
print() print()
# All times in step. # All times in step.
if with_html:
print('<div id="dead"></div>')
print("# All deadtimes:") print("# All deadtimes:")
print( print(
"# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format(
......
...@@ -49,9 +49,17 @@ parser.add_argument( ...@@ -49,9 +49,17 @@ parser.add_argument(
default=False, default=False,
action="store_true", action="store_true",
) )
parser.add_argument(
"--html",
dest="html",
help="Use html titles and anchors in the output (default: False)",
default=False,
action="store_true",
)
args = parser.parse_args() args = parser.parse_args()
infile = args.input infile = args.input
with_html = args.html
# Read header. First two lines. # Read header. First two lines.
with open(infile) as infid: with open(infile) as infid:
...@@ -145,6 +153,8 @@ for i in threadids: ...@@ -145,6 +153,8 @@ for i in threadids:
alltasktimes[key] = [] alltasktimes[key] = []
alltasktimes[key].append(dt) alltasktimes[key].append(dt)
if with_html:
print('<div id="thread{}"></div>'.format(i))
print("# Thread : ", i) print("# Thread : ", i)
for key in sorted(tasktimes.keys()): for key in sorted(tasktimes.keys()):
taskmin = min(tasktimes[key]) taskmin = min(tasktimes[key])
...@@ -163,6 +173,8 @@ for i in threadids: ...@@ -163,6 +173,8 @@ for i in threadids:
) )
print() print()
if with_html:
print('<div id="all"></div>')
print("# All threads : ") print("# All threads : ")
for key in sorted(alltasktimes.keys()): for key in sorted(alltasktimes.keys()):
taskmin = min(alltasktimes[key]) taskmin = min(alltasktimes[key])
...@@ -184,6 +196,8 @@ print() ...@@ -184,6 +196,8 @@ print()
# Dead times. # Dead times.
print("# Times not in tasks (deadtimes)") print("# Times not in tasks (deadtimes)")
print("# ------------------------------") print("# ------------------------------")
if with_html:
print('<div id="before"></div>')
print("# Time before first task:") print("# Time before first task:")
print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) print("# no. : {0:>9s} {1:>9s}".format("value", "percent"))
predeadtimes = [] predeadtimes = []
...@@ -216,6 +230,8 @@ print( ...@@ -216,6 +230,8 @@ print(
) )
print() print()
if with_html:
print('<div id="after"></div>')
print("# Time after last task:") print("# Time after last task:")
print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) print("# no. : {0:>9s} {1:>9s}".format("value", "percent"))
postdeadtimes = [] postdeadtimes = []
...@@ -249,6 +265,8 @@ print( ...@@ -249,6 +265,8 @@ print(
print() print()
# Time in threadpool, i.e. from first to last tasks. # Time in threadpool, i.e. from first to last tasks.
if with_html:
print('<div id="between"></div>')
print("# Time between tasks (threadpool deadtime):") print("# Time between tasks (threadpool deadtime):")
print( print(
"# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format(
...@@ -303,6 +321,8 @@ print( ...@@ -303,6 +321,8 @@ print(
print() print()
# All times in step. # All times in step.
if with_html:
print('<div id="dead"></div>')
print("# All deadtimes:") print("# All deadtimes:")
print( print(
"# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format(
......
...@@ -60,7 +60,7 @@ done ...@@ -60,7 +60,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 "${SCRIPTHOME}/plot_tasks.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 " echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/plot_tasks.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 "
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_tasks.py \$0 > \$2.stats" echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_tasks.py --html \$0 > \$2.stats"
echo "Writing output index.html file" echo "Writing output index.html file"
# Construct document - serial. # Construct document - serial.
......
...@@ -66,7 +66,7 @@ nrank=$(($nrank-1)) ...@@ -66,7 +66,7 @@ nrank=$(($nrank-1))
echo "Processing thread info files..." echo "Processing thread info files..."
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/plot_tasks.py --expand 1 --limit $TIMERANGE \$0 \$2 " echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/plot_tasks.py --expand 1 --limit $TIMERANGE \$0 \$2 "
for i in $(seq 0 $nrank); do for i in $(seq 0 $nrank); do
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_tasks.py -r $i \$0 > \$2${i}.stats" echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_tasks.py -r $i --html \$0 > \$2${i}.stats"
done done
echo "Writing output index.html file" echo "Writing output index.html file"
......
...@@ -65,7 +65,7 @@ done ...@@ -65,7 +65,7 @@ done
# And process them, # And process them,
echo "Processing threadpool info files..." echo "Processing threadpool info files..."
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/plot_threadpool.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 " echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/plot_threadpool.py --expand 1 --limit $TIMERANGE --width 16 --height 4 \$0 \$2 "
echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_threadpool_tasks.py \$0 > \$2.stats" echo $list | xargs -P $NPROCS -n 3 /bin/bash -c "${SCRIPTHOME}/analyse_threadpool_tasks.py \$0 --html > \$2.stats"
echo "Writing output threadpool-index.html file" echo "Writing output threadpool-index.html file"
# Construct document - serial. # Construct document - serial.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment