Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 39 additions & 4 deletions Validation/Process_All_Output.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
#!/bin/bash

# This script contains a list of validation sets whose results are to be copied to the 'out' repository.
# The script checks to see that every case within each validation set has run successfully.
# The script also checks to see if older versions of the results might accidentally overwrite newer versions.

# This function scans the '_git.txt' files within a given directory and converts the git hash to a Unix time stamp.

GET_UNIX_TIME()
{
gitrevisions=$TEMPDIR/gitrevisions.$$
cat $1/*git.txt 2> /dev/null | sort -u > $gitrevisions
gitrev=`head -1 $gitrevisions`
gitdate2=0
if [ "$gitrev" != "" ] ; then
gitrevshort=`echo $gitrev | awk -F - '{print $(NF-1)}' | sed 's/^g//'`
gitdate2=`git show -s --format=%at $gitrevshort | head -1 | awk '{print $1}'`
fi
rm $gitrevisions
}

# This function takes a validation set and determines whether or not it should be processed.

PROCESS()
{
case=$1
casedir=$FIREMODELS/out/$case
GET_UNIX_TIME $casedir
out_date=$gitdate2
curdir=`pwd`
casedir=$case/Current_Results
GET_UNIX_TIME $casedir
new_date=$gitdate2
cd $case
nout=`ls -l Current_Results/*.out |& grep -v cannot | wc -l`
nfds=`ls -l Current_Results/*.fds |& grep -v cannot | wc -l`
Expand All @@ -15,6 +42,8 @@ PROCESS()
status="***error: $case cases not run"
if [ $nfds -gt 0 ] && [ $nfds -gt $nout ]; then
status="***error: some $case cases did not run or are not complete"
elif [ $out_date \> $new_date ]; then
status="***error: existing output is newer than the cases being processed"
else
if [ $nout -gt 0 ] && [ $nout -gt $nsuccess ]; then
status="some $case cases failed"
Expand All @@ -33,11 +62,17 @@ PROCESS()
cd $curdir
}

# This list of active validation data sets is used by Validationbot
# to automatically run validation cases on a regular basis.
# Define some directories.

TEMPDIR=$HOME/temp
if [ ! -d $TEMPDIR ]; then
mkdir $TEMPDIR
fi

FIREMODELS=../..

# There should exist a line entry for every directory under Validation.
# If the case is under development, simply comment out the line.
# There should exist a line entry for every directory in the Validation directory of the fds repository.
# If the case is under development, simply comment out the line below.

PROCESS Arup_Tunnel
PROCESS ATF_Corridors
Expand Down
Loading