Skip to content

Commit

Permalink
Merge pull request #20385 from dmitrijus/fastHadd_testfix
Browse files Browse the repository at this point in the history
Fix fastHadd tests
  • Loading branch information
cmsbuild committed Sep 5, 2017
2 parents bd6edc8 + 9382a17 commit b9e4992
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions DQMServices/Components/test/run_fastHadd_tests.sh
Expand Up @@ -6,15 +6,16 @@ cumPBFile='prova.pb'
cumPBFile_inROOT='provaPB.root'
cumPBFileThreaded='provaThreaded.pb'
cumPBFileThreaded_inROOT='provaPBThreaded.root'
numThreads=4
numGroup=$(( (numFiles+numThreads-1)/numThreads ))
numThreads=3
timecmd='/usr/bin/time -f %E'

clean_up() {
set_up() {
echo "Removing previous ROOT and PB files"

rm -fr *.root
rm -fr *.pb
rm -fr fastHaddTests
mkdir fastHaddTests
cd fastHaddTests

return 0
}

Expand All @@ -24,7 +25,7 @@ generate() {
python ${LOCAL_TEST_DIR}/test_fastHaddMerge.py -a produce -n $numFiles 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -36,10 +37,10 @@ convertROOT2PB() {
for file in $(ls Merge*root)
do
fastHadd encode -o `basename $file .root`.pb $file
# cmsRun convertRoot2PB.py $file &> /dev/null
if [ $? -ne 0 ]; then
exit $?
fi
# cmsRun convertRoot2PB.py $file &> /dev/null
if [ $? -ne 0 ]; then
exit $?
fi
done

return 0
Expand All @@ -49,13 +50,13 @@ hadd_merge() {
echo "Merging with hadd"

if [ -e "$cumRootFile" ]; then
rm $cumRootFile
rm $cumRootFile
fi

$timecmd hadd $cumRootFile $(ls Merge*.root) 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -67,7 +68,7 @@ check_hadd() {
python ${LOCAL_TEST_DIR}/test_fastHaddMerge.py -a check -n $numFiles -c $cumRootFile 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -79,7 +80,7 @@ fasthadd_merge() {
$timecmd fastHadd -d add -o $cumPBFile $(ls Merge*.pb) 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -91,7 +92,7 @@ convertPB2ROOT() {
fastHadd -d convert -o $cumPBFile_inROOT $cumPBFile 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -103,19 +104,19 @@ check_fasthadd() {
python ${LOCAL_TEST_DIR}/test_fastHaddMerge.py -a check -n $numFiles -c $cumPBFile_inROOT 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
}

fasthadd_parallel_merge() {
echo "Merging with parallel fastHadd, $numThreads threads with $numGroup groups"
echo "Merging with parallel fastHadd, $numThreads threads"

$timecmd python ${LOCAL_TEST_DIR}/fastParallelHadd.py -j $numThreads -g $numGroup -o $cumPBFileThreaded $(ls Merge*.pb) 2>&1 > /dev/null
$timecmd fastHadd -d add -j $numThreads -o $cumPBFileThreaded $(ls Merge*.pb) 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
Expand All @@ -127,7 +128,7 @@ convert() {
fastHadd -d convert -o $cumPBFileThreaded_inROOT $cumPBFileThreaded 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi
}

Expand All @@ -137,13 +138,14 @@ check_fasthadd_parallel() {
python ${LOCAL_TEST_DIR}/test_fastHaddMerge.py -a check -n $numFiles -c $cumPBFileThreaded_inROOT 2>&1 > /dev/null

if [ $? -ne 0 ]; then
exit $?
exit $?
fi

return 0
}

clean_up
set_up

generate
convertROOT2PB
hadd_merge
Expand Down

0 comments on commit b9e4992

Please sign in to comment.