diff --git a/examples/EAGLE_low_z/EAGLE_6/run.sh b/examples/EAGLE_low_z/EAGLE_6/run.sh index 47dbd952549137d8c2baab8c22361a227eb35ca9..9786d8062e12a8292f1967e122bb1f8b94354074 100755 --- a/examples/EAGLE_low_z/EAGLE_6/run.sh +++ b/examples/EAGLE_low_z/EAGLE_6/run.sh @@ -7,5 +7,5 @@ then ./getIC.sh fi -../../swift --cosmology --hydro --self-gravity --stars --threads=16 eagle_6.yml 2>&1 | tee output.log +../../swift --hydro --threads=4 -n 16 -y 1 eagle_6.yml 2>&1 | tee output.log diff --git a/tools/task_plots/analyse_tasks.py b/tools/task_plots/analyse_tasks.py index 8ba0c6ee5389a7427b6d096f444ddeb15362d71e..c093d18c2dba6bed0a22e9f7279285b45817445d 100755 --- a/tools/task_plots/analyse_tasks.py +++ b/tools/task_plots/analyse_tasks.py @@ -57,9 +57,17 @@ parser.add_argument( default="all", 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() infile = args.input +with_html = args.html # Tasks and subtypes. Indexed as in tasks.h. TASKTYPES = [ @@ -301,6 +309,8 @@ for rank in ranks: sidtimes[my_sid] = [] sidtimes[my_sid].append(dt) + if with_html: + print('<div id="thread{}"></div>'.format(i)) print("# Thread : ", i) for key in sorted(tasktimes.keys()): taskmin = min(tasktimes[key]) @@ -319,6 +329,8 @@ for rank in ranks: ) print() + if with_html: + print('<div id="all"></div>') print("# All threads : ") for key in sorted(alltasktimes.keys()): taskmin = min(alltasktimes[key]) @@ -338,6 +350,8 @@ for rank in ranks: print() # For pairs, show stuff sorted by SID + if with_html: + print('<div id="sid"></div>') print("# By SID (all threads): ") print( "# {0:<17s}: {1:>7s} {2:>9s} {3:>9s} {4:>9s} {5:>9s} {6:>9s}".format( @@ -375,6 +389,8 @@ for rank in ranks: # Dead times. print("# Times not in tasks (deadtimes)") print("# ------------------------------") + if with_html: + print('<div id="before"></div>') print("# Time before first task:") print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) predeadtimes = [] @@ -410,6 +426,8 @@ for rank in ranks: ) print() + if with_html: + print('<div id="after"></div>') print("# Time after last task:") print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) postdeadtimes = [] @@ -446,6 +464,8 @@ for rank in ranks: print() # 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( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( @@ -503,6 +523,8 @@ for rank in ranks: print() # All times in step. + if with_html: + print('<div id="dead"></div>') print("# All deadtimes:") print( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( diff --git a/tools/task_plots/analyse_threadpool_tasks.py b/tools/task_plots/analyse_threadpool_tasks.py index af8d88dc1d4dc319fe7506d604e550de22a55a81..425f6bb62e207908f88b748122ff4215e5f1f269 100755 --- a/tools/task_plots/analyse_threadpool_tasks.py +++ b/tools/task_plots/analyse_threadpool_tasks.py @@ -49,9 +49,17 @@ parser.add_argument( default=False, 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() infile = args.input +with_html = args.html # Read header. First two lines. with open(infile) as infid: @@ -145,6 +153,8 @@ for i in threadids: alltasktimes[key] = [] alltasktimes[key].append(dt) + if with_html: + print('<div id="thread{}"></div>'.format(i)) print("# Thread : ", i) for key in sorted(tasktimes.keys()): taskmin = min(tasktimes[key]) @@ -163,6 +173,8 @@ for i in threadids: ) print() +if with_html: + print('<div id="all"></div>') print("# All threads : ") for key in sorted(alltasktimes.keys()): taskmin = min(alltasktimes[key]) @@ -184,6 +196,8 @@ print() # Dead times. print("# Times not in tasks (deadtimes)") print("# ------------------------------") +if with_html: + print('<div id="before"></div>') print("# Time before first task:") print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) predeadtimes = [] @@ -216,6 +230,8 @@ print( ) print() +if with_html: + print('<div id="after"></div>') print("# Time after last task:") print("# no. : {0:>9s} {1:>9s}".format("value", "percent")) postdeadtimes = [] @@ -249,6 +265,8 @@ print( print() # 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( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( @@ -303,6 +321,8 @@ print( print() # All times in step. +if with_html: + print('<div id="dead"></div>') print("# All deadtimes:") print( "# no. : {0:>9s} {1:>9s} {2:>9s} {3:>9s} {4:>9s} {5:>9s}".format( diff --git a/tools/task_plots/process_plot_tasks b/tools/task_plots/process_plot_tasks index 4df04ab46ba38f6346b8e857ba5002317520d3c6..54bb86fb414cb87ccbe2b7c93b18f010e77be465 100755 --- a/tools/task_plots/process_plot_tasks +++ b/tools/task_plots/process_plot_tasks @@ -60,7 +60,7 @@ done # And process them, 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}/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" # Construct document - serial. @@ -88,6 +88,7 @@ EOF <img src="step${s}r${i}.png"> <pre> EOF +echo "<nav>Jump to: <a href="#all">all threads</a> <a href="#dead">dead times</a></nav>" >> step${s}r${i}.html cat step${s}r${i}.stats >> step${s}r${i}.html cat <<EOF >> step${s}r${i}.html </body> diff --git a/tools/task_plots/process_plot_tasks_MPI b/tools/task_plots/process_plot_tasks_MPI index 736aad05b98aea619f79e2b2114815c8e0fbaa1c..d1a3c3c6685cebf0e24ecc355f286e4d26d6dd25 100755 --- a/tools/task_plots/process_plot_tasks_MPI +++ b/tools/task_plots/process_plot_tasks_MPI @@ -66,7 +66,7 @@ nrank=$(($nrank-1)) 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 " 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 echo "Writing output index.html file" @@ -110,6 +110,7 @@ EOF3 <img src="step${s}r${i}.png"> <pre> EOF2 +echo "<nav>Jump to: <a href="#all">all threads</a> <a href="#dead">dead times</a></nav>" >> step${s}r${i}.html cat step${s}r${i}.stats >> step${s}r${i}.html cat <<EOF2 >> step${s}r${i}.html </pre> diff --git a/tools/task_plots/process_plot_threadpool b/tools/task_plots/process_plot_threadpool index 0076ec1c4efc96d4a1dc5f9164cca2dd1b19ed5f..b1238b3668067f17b98099f6287fa63fec5d2395 100755 --- a/tools/task_plots/process_plot_threadpool +++ b/tools/task_plots/process_plot_threadpool @@ -65,7 +65,7 @@ done # And process them, 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}/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" # Construct document - serial.