From 7c05033b79838183040aa9041113b1c01609f6ed Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 9 Oct 2020 21:27:46 -0400 Subject: [PATCH] Add verilator_gantt warning when too few cpus (#2590) --- bin/verilator_gantt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/verilator_gantt b/bin/verilator_gantt index ddd7f2434..46f70dfaf 100755 --- a/bin/verilator_gantt +++ b/bin/verilator_gantt @@ -156,7 +156,8 @@ sub report { print "\nAnalysis:\n"; printf " Total threads = %d\n", $nthreads; printf " Total mtasks = %d\n", scalar(keys %Mtasks); - printf " Total cpus used = %d\n", scalar(keys %{$Global{cpus}}); + my $ncpus = scalar(keys %{$Global{cpus}}); + printf " Total cpus used = %d\n", $ncpus; printf " Total yields = %d\n", $Global{stats}{yields}; printf " Total eval time = %d rdtsc ticks\n", $Global{last_end}; printf " Longest mtask time = %d rdtsc ticks\n", $long_mtask_time; @@ -206,6 +207,12 @@ sub report { print " stddev = " . ($stddev) . "\n"; print " e ^ stddev = " . exp($stddev). "\n"; print "\n"; + + if ($nthreads > $ncpus) { + print "%Warning: There were fewer CPUs ($ncpus) then threads ($nthreads).\n"; + print " : See docs on use of numactl.\n"; + print "\n"; + } } sub report_graph {