#!/bin/csh -f
#
# run-check:  check the results directories to see that runs succeeded
#	I can't check to see that all runs are there, just that the
# ones which ran actually succeeded.
#
# this needs to be run from the source directory
#
# usage:  run-check [dir]...
# if no dirs, then it does all dirs.
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 3.0
#                              October 1996
#                          dfk@cs.dartmouth.edu

if ($#argv == 0) then
    echo using configs/
    set dirs=(configs/*)
else
    set dirs=($*)
endif

foreach dir ($dirs)
    if (! -d $dir/results) continue

    # try to make a list of *.out in $dir/results
    set files=(`ls $dir/results | grep '\.out$'`)
    if ($#files == 0) continue

    foreach run ($files)
	echo -n  $dir/results/$run  " " 
	cat $dir/results/$run | grep "Experiment complete" | wc -l 
#	cat $dir/results/$run | grep "Experiment complete" > /dev/null
#	if ($status != 0) echo  $dir/results/$run 
    end
end
