heat: add ctf stage to analyze mode times
This commit is contained in:
parent
972be56eed
commit
854707103c
@ -6,6 +6,7 @@
|
||||
, stages
|
||||
, garlicTools
|
||||
, enablePerf ? false
|
||||
, enableCTF ? false
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
@ -14,8 +15,12 @@ with garlicTools;
|
||||
let
|
||||
# Initial variable configuration
|
||||
varConf = with bsc; {
|
||||
cbs = range2 8 4096;
|
||||
rbs = range2 32 4096;
|
||||
#cbs = range2 32 4096;
|
||||
#rbs = range2 32 4096;
|
||||
cbs = [ 64 256 1024 4096 ];
|
||||
rbs = [ 32 128 512 1024 ];
|
||||
#cbs = [ 4096 ];
|
||||
#rbs = [ 32 ];
|
||||
};
|
||||
|
||||
machineConfig = targetMachine.config;
|
||||
@ -38,7 +43,7 @@ let
|
||||
gitBranch = "garlic/tampi+isend+oss+task";
|
||||
|
||||
# Repeat the execution of each unit 30 times
|
||||
loops = 10;
|
||||
loops = 1;
|
||||
|
||||
# Resources
|
||||
qos = "debug";
|
||||
@ -61,6 +66,56 @@ let
|
||||
"-e cycles,instructions,cache-references,cache-misses";
|
||||
};
|
||||
|
||||
ctf = {nextStage, conf, ...}: with conf; stages.exec {
|
||||
inherit nextStage;
|
||||
env = ''
|
||||
export NANOS6_CONFIG_OVERRIDE="version.instrument=ctf,\
|
||||
instrument.ctf.converter.enabled=false"
|
||||
'';
|
||||
# Only one process converts the trace, otherwise use:
|
||||
# if [ $SLURM_PROCID == 0 ]; then
|
||||
# ...
|
||||
# fi
|
||||
post = ''
|
||||
if [ $SLURM_PROCID == 0 ]; then
|
||||
sleep 2
|
||||
for tracedir in trace_*; do
|
||||
offset=$(grep 'offset =' $tracedir/ctf/ust/uid/1000/64-bit/metadata | \
|
||||
grep -o '[0-9]*')
|
||||
echo "offset = $offset"
|
||||
|
||||
start_time=$(awk '/^start_time / {print $2}' stdout.log)
|
||||
end_time=$(awk '/^end_time / {print $2}' stdout.log)
|
||||
|
||||
begin=$(awk "BEGIN{print $start_time*1e9 - $offset}")
|
||||
end=$(awk "BEGIN{print $end_time*1e9 - $offset}")
|
||||
|
||||
echo "only events between $begin and $end"
|
||||
|
||||
${bsc.cn6}/bin/cn6 -s $tracedir
|
||||
|
||||
awk -F: "NR==1 {print} \$6 >= $begin && \$6 <= $end" $tracedir/prv/trace.prv |\
|
||||
${bsc.cn6}/bin/dur 6400025 0 |\
|
||||
awk '{s+=$1} END {print s}' >> .garlic/time_mode_dead.csv &
|
||||
|
||||
awk -F: "NR==1 {print} \$6 >= $begin && \$6 <= $end" $tracedir/prv/trace.prv |\
|
||||
${bsc.cn6}/bin/dur 6400025 1 |\
|
||||
awk '{s+=$1} END {print s}' >> .garlic/time_mode_runtime.csv &
|
||||
|
||||
awk -F: "NR==1 {print} \$6 >= $begin && \$6 <= $end" $tracedir/prv/trace.prv |\
|
||||
${bsc.cn6}/bin/dur 6400025 3 |\
|
||||
awk '{s+=$1} END {print s}' >> .garlic/time_mode_task.csv &
|
||||
|
||||
wait
|
||||
|
||||
# Remove the traces at the end, as they are huge
|
||||
rm -rf $tracedir
|
||||
#cp -a $tracedir .garlic/
|
||||
done
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
exec = {nextStage, conf, ...}: stages.exec {
|
||||
inherit nextStage;
|
||||
argv = [
|
||||
@ -83,6 +138,7 @@ let
|
||||
|
||||
pipeline = stdexp.stdPipeline ++
|
||||
(optional enablePerf perf) ++
|
||||
(optional enableCTF ctf) ++
|
||||
[ exec program ];
|
||||
|
||||
in
|
||||
|
@ -66,6 +66,7 @@
|
||||
heat = rec {
|
||||
granul = callPackage ./heat/granul.nix { };
|
||||
cache = granul.override { enablePerf = true; };
|
||||
ctf = cache.override { enableCTF = true; };
|
||||
};
|
||||
|
||||
bigsort = rec {
|
||||
|
Loading…
Reference in New Issue
Block a user