Skip to content
Snippets Groups Projects
run-matrix-solvers-benchmark 2.97 KiB
Newer Older
  • Learn to ignore specific revisions
  • #!/usr/bin/env bash
    
    BASE="ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/"
                    
    
    MATRIX_SOLVERS_BENCHMARK="tnl-matrix-solvers-benchmark-dbg"
    
    STOP_TIME="1"
    
    export CUDA_PROFILE=0
    export CUDA_PROFILE_CONFIG="$TNL_SOURCE_DIR/tests/cuda-profiler.conf"
    PROCESS_CUDA_PROFILE="$TNL_SOURCE_DIR/tests/process-cuda-profile.pl"
    
    source ./matrix-market
    source ./florida-matrix-market
    
    
    export TNL_SPARSE_MATRIX_CHECK_CFG_DESC_FILE="$TNL_SOURCE_DIR/tests/tnl-sparse-matrix-check.cfg.desc"
    
    #MM_MATRICES=""
    #FLORIDA_MM_MATRICES=""
    
    
    for link in $MM_MATRICES;
    do
       echo "###############################################################################################"
       matrix=matrices`echo $link | sed 's/ftp:\/\/math.nist.gov\/pub//'`
       unzipped_matrix=`echo $matrix | sed 's/.gz//'`
       if test ! -e $matrix;
       then
          echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first."
          #echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first." >> sparse-matrix-benchmark.log            
       else
          if test ! -e $unzipped_matrix.double.bin.bz2;
          then
             echo "Missing $unzipped_matrix.double.bin.bz2 !!! Run the script 'convert-matrices'."
             #echo "Missing $unzipped_matrix.double.bin.bz2 !!! Run the script 'convert-matrices'."  >> sparse-matrix-benchmark.log
          else
             gunzip -f $matrix
             echo "Checking with the matrix $unzipped_matrix in double precison ..."
             export CUDA_PROFILE_LOG=$unzipped_matrix.double.log 
             $MATRIX_SOLVERS_BENCHMARK --input-file $unzipped_matrix.double.bin.bz2 --input-mtx-file $unzipped_matrix --log-file sparse-matrix-benchmark-double.log --stop-time $STOP_TIME --verbose 1
             gzip $unzipped_matrix
          fi          
       fi
    done
    
    for link in $FLORIDA_MM_MATRICES;
    do
       matrix=matrices`echo $link | sed 's/http:\/\/www.cise.ufl.edu\/research\/sparse//'`
       if test ! -e $matrix;
       then      
          echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first."
          #echo "Matrix $matrix is missing !!! Run the script 'get-matrices' first." >> sparse-matrix-benchmark.log
       else
         DIRNAME=`dirname $matrix`
         FILENAME=`basename $matrix`
         cd $DIRNAME
         tar zxvf $FILENAME
         cd $IWD
         SUBDIRNAME=`echo $FILENAME | sed 's/.tar.gz//'`
         rm -f $DIRNAME/$SUBDIRNAME/*_b.mtx # these are usualy in array format
         for file in $DIRNAME/$SUBDIRNAME/*.mtx;
         do
             echo "###############################################################################################"
             if test ! -e $file.double.bin.bz2;
             then
                echo "Missing $file.double.bin.bz2 !!! Run the script 'convert-matrices'."
             else   
                echo "Checking with the matrix $file ..."
                $MATRIX_SOLVERS_BENCHMARK --input-file $file.double.bin.bz2 --input-mtx-file $file --log-file sparse-matrix-benchmark-double.log --stop-time $STOP_TIME --verbose 1                        
             fi                           
             rm $file         
          done
       fi
    done