Skip to content

Commit

Permalink
Add test of verrou_plot_stat --time
Browse files Browse the repository at this point in the history
  • Loading branch information
lathuili-home committed Jun 13, 2024
1 parent dee2b2c commit e20a985
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions unitTest/ddStdOut/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export SHELL=bash

PYTHON=/usr/bin/python3

REP_LIST=dd.stdout dd.stdout.cpp dd.stdout.empty dd.stdout.debug dd.stdout.debug2 dd.stdout.sqrt dd.stdout.sqrt.listing dd.stdout.regroup dd.task
REP_LIST=dd.stdout dd.stdout.cpp dd.stdout.empty dd.stdout.debug dd.stdout.debug2 dd.stdout.sqrt dd.stdout.sqrt.listing dd.stdout.regroup dd.task time.png
#dd.stdout.emptyBis
NBRUN=5

Expand Down Expand Up @@ -64,6 +64,8 @@ dd.task: ./muller-task
CMD="./muller-task" verrou_dd_task --rep=dd.task --num-threads=6 --nruns=$(NBRUN) --seed=42 ddRun.sh extractOrCmp.py
./assertTask.py dd.task

time.png: muller
CMD="./muller" verrou_plot_stat --cache=clean -s 4 --num-threads=4 --rounding=nearest,random -p time.png --time ddRun.sh extractTime.py

clean:
rm -rf exclude.ex $(REP_LIST) muller sqrt muller-task
rm -rf exclude.ex $(REP_LIST) muller sqrt muller-task time.png
19 changes: 19 additions & 0 deletions unitTest/ddStdOut/extractTime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/python3
import sys
import os
import re

pattern=re.compile("it:\s+(\d+)\s+x2:\s*([\w.]*)[\w\s]*")

def extractTime(rep):
res=""
lines=(open(os.path.join(rep,"res.dat")).readlines())
for line in lines:
regexp=pattern.match(line)
if regexp!=None:
res+=(" ".join(regexp.groups()))+"\n"
return res[0:-1]

if __name__=="__main__":
if len(sys.argv)==2:
print(extractTime(sys.argv[1]))

0 comments on commit e20a985

Please sign in to comment.