Changeset 2718 in /cluster/svnroot


Ignore:
Timestamp:
Oct 12, 2010 8:20:03 PM (10 years ago)
Author:
skylar
Message:

running more stuff through perl API (#520)

Location:
bccd-ng/branches/skylar-test_fw/trees/home/bccd/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-test_fw/trees/home/bccd/tests/bccd_test_suite.pm

    r2715 r2718  
    9797        my ($rc,$tempDirectory);
    9898        my @cmd;
     99        my($CMD,$STOREOUT);
    99100        print "$testdir/$testname.dat\n";
    100101        open(my $OUTPUT, '>', "$testdir/$testname.dat") or die "could not open data file: $!";
    101102        my $storeOutput = generate_storeOutput($testdir,$testname);
     103        my $path = getcwd();
     104
     105        open(my $STOREOUT, '>>', "$path/$testdir/$testname.dat") or
     106            croak "Can't open $path/$testdir/$testname.dat for append: $!\n";
    102107
    103108####Start test code####
    104         system("cd ~/$testname                          $storeOutput
    105                         make clean                      $storeOutput
    106                         make                            $storeOutput
    107                         xvfb-run -f $ENV{HOME}/.Xauthority -l mpirun -np 1 ~/$testname/$testname        $storeOutput
    108                         xvfb-run -f $ENV{HOME}/.Xauthority -l mpirun -np 2 ~/$testname/$testname        $storeOutput");
     109        chdir("$ENV{HOME}/$testname");
     110        system('make','clean');
     111        system('make');
     112        @cmd = ( 'xvfb-run', '-f', "$ENV{HOME}/.Xauthority",
     113                 '-l', 'mpirun', '-np', '1',
     114                 "$ENV{HOME}/$testname/$testname", '2>&1', );
     115       
     116        system(@cmd);
     117
     118        open($CMD, '-|',  @cmd) or
     119            croak "Can't run @cmd: $!\n";
     120
     121        while(my $line = <$CMD>) {
     122            chomp $line;
     123            print $STOREOUT "$line\n";
     124        }
     125        close($CMD);
     126
    109127        my $machines = line_match("$ENV{HOME}/machines",qr{^});
    110128#XXX This function is untested from here on.
     
    136154        }
    137155####End test code####
    138         close $OUTPUT
     156        close $STOREOUT;
     157        close $OUTPUT;
    139158}
    140159
  • bccd-ng/branches/skylar-test_fw/trees/home/bccd/tests/mpitest.sh

    r2371 r2718  
    11#!/bin/bash
     2
     3set -x
    24
    35if test -z "$1"; then
     
    79fi
    810
    9 TMPDIR=/tmp/`hostname -s`-$LOGNAME
     11TMPDIR=/tmp/$(hostname -s)-$LOGNAME
    1012MPIS="mpich2 openmpi"
    1113DISPLAY=1
     
    1416
    1517. /usr/local/Modules/3.2.6/init/bash
    16 module unload $MPIS
     18module unload ${MPIS}
    1719. ~/.bash_profile
    1820
    1921
    2022for i in $MPIS; do
    21         if [ "$i" == "openmpi" ]; then
     23        if [ "${i}" == "openmpi" ]; then
    2224                HOSTCMD="--hostfile"
    23         elif [ "$i" == "mpich2" ]; then
     25        elif [ "${i}" == "mpich2" ]; then
    2426                HOSTCMD="-machinefile"
    2527        else
     
    2931        echo "Testing $i"
    3032
    31         module unload $MPIS
    32         module load $i
     33        module unload ${MPIS}
     34        module load ${i}
    3335
    3436        bccd-snarfhosts
    3537
    36         cd ~/Gal
     38        cd ~/GalaxSee
    3739        echo "GalaxSee"
    3840        echo "  Building..."
     
    4042        make &> /dev/null && \
    4143        echo "  Syncing..." && \
    42         bccd-syncdir --ni ~/Gal ~/machines &> /dev/null && \
     44        bccd-syncdir --ni ~/GalaxSee ~/machines &> /dev/null && \
    4345        echo "  Running..." && \
    44         runmpi $HOSTCMD ~/machines -np $PROCS $TMPDIR/GalaxSee 100 100 1000 $DISPLAY
     46        runmpi ${HOSTCMD} ~/machines -np ${PROCS} \
     47            ${TMPDIR}/GalaxSee 100 100 1000 ${DISPLAY}
    4548
    4649        cd ~/Life
     
    5255        bccd-syncdir --ni ~/Life ~/machines &> /dev/null && \
    5356        echo "  Running..." && \
    54         runmpi $HOSTCMD ~/machines -np $PROCS $TMPDIR/Life 50 50 100 $DISPLAY
     57        runmpi ${HOSTCMD} ~/machines -np ${PROCS} \
     58            ${TMPDIR}/Life 50 50 100 ${DISPLAY}
    5559
    5660        cd ~/Param_space
     
    6266        bccd-syncdir --ni ~/Param_space ~/machines &> /dev/null && \
    6367        echo "  Running..." && \
    64         runmpi $HOSTCMD ~/machines -np $PROCS $TMPDIR/Param_space 100 100 100 $DISPLAY
     68        runmpi ${HOSTCMD} ~/machines -np ${PROCS} \
     69            ${TMPDIR}/Param_space 100 100 100 ${DISPLAY}
    6570done
    6671
Note: See TracChangeset for help on using the changeset viewer.