#!/bin/csh -f
#
# lusuite: spit out a suite for a given set of LU-decomposition
#    config directories
#
set usage='usage: lusuite luconfig...  > suitefile'
#
# 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 < 1) then
    echo "$usage"
    exit 1
endif

set dirs=($*)

set top=`echo $cwd | sed -e 's|.*dfk|/u/dfk|' -e 's|/u/dfk/.*run|/u/dfk/run|'`

foreach dir ($dirs)
    if (! -d $dir) continue
#    if (! -x $dir/proteus && ! -x $dir/proteus.gz) continue

    echo ""
    echo "# ------ $dir -------"

#    echo "gunzip $dir/proteus.gz" 
    echo "mkdir $dir/results" 

    set Nio=8
    foreach Ncomp (8)
	if ( $dir =~ *contig* ) then
	        echo "cd $top/$dir; run-lu -v $Nio $Ncomp"
	else
	        echo "cd $top/$dir; run-lu    $Nio $Ncomp"
	endif
    end

#    echo "gzip $dir/proteus"

end

echo ""
foreach dir ($dirs)
    echo "update-lu $dir"
end

echo "mail -s 'suite finished' $user < /dev/null" 
