Commit 67b8bacd authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed scripts convert-matrices and draw-matrices

The tnl-matrix-convert and tnl-grid-view tools are not part of TNL
anymore. Both scripts were moved to the tnl-legacy repository.
parent a3c3c468
Loading
Loading
Loading
Loading
+0 −148
Original line number Diff line number Diff line
#!/usr/bin/env bash

BASE="ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/"
                
PWD=`pwd`
TNL_MATRIX_CONVERT="tnl-matrix-convert --verify no"
IWD="$PWD"

#source ../tnl-env-variables
#export TNL_SPARSE_MATRIX_CHECK_CFG_DESC_FILE="$TNL_SOURCE_DIR/tests/tnl-sparse-matrix-check.cfg.desc"

source matrix-market
source florida-matrix-market


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."      
   else
      if test ! -e $unzipped_matrix.float.bin.bz2;
      then
         #echo "Converting $unzipped_matrix.float.bin.bz2 ..."
         gunzip -f $matrix
         $TNL_MATRIX_CONVERT --input-file $unzipped_matrix --output-file $unzipped_matrix.float.bin.bz2 --precision float --verbose yes --verify no
         gzip $unzipped_matrix
      else
         echo "Matrix $unzipped_matrix.float.bin.bz2 was already converted."         
      fi
      
      #######
      ## AMD ordering
      ###      
      #if test ! -e $unzipped_matrix.amd.float.bin.bz2;
      #then
      #   #echo "Converting $unzipped_matrix.amd.float.bin.bz2 ..."
      #   gunzip -f $matrix
      #   if test ! -e $unzipped_matrix.amd;
      #   then 
      #      echo "Ordering the matrix ..."
      #      ./reorder-csr -A -g 32 -i $unzipped_matrix -o $unzipped_matrix.amd
      #   fi        
      #   $TNL_MATRIX_CONVERT --input-file $unzipped_matrix.amd --output-file $unzipped_matrix.amd.float.bin.bz2 --precision float --verbose yes --verify no
      #   #rm $unzipped_matrix.amd
      #   gzip $unzipped_matrix
      #else
      #   echo "Matrix amd-$unzipped_matrix.float.bin.bz2 was already converted."         
      #fi
      
      if test ! -e $unzipped_matrix.double.bin.bz2;
      then
         #echo "Converting $matrix ..."
         gunzip -f $matrix
         $TNL_MATRIX_CONVERT --input-file $unzipped_matrix --output-file $unzipped_matrix.double.bin.bz2 --precision double --verbose yes --verify no
         gzip $unzipped_matrix
      else
         echo "Matrix $unzipped_matrix.double.bin.bz2 was already converted."         
      fi

      #######
      ## AMD ordering
      ###      
      #if test ! -e $unzipped_matrix.amd.double.bin.bz2;
      #then
      #   #echo "Converting $unzipped_matrix.amd.double.bin.bz2 ..."
      #   gunzip -f $matrix
      #   if test ! -e $unzipped_matrix.amd
      #   then 
      #      echo "Ordering the matrix ..."
      #      ./reorder-csr -A -g 32 -i $unzipped_matrix -o $unzipped_matrix.amd
      #   fi        
      #   $TNL_MATRIX_CONVERT --input-file $unzipped_matrix.amd --output-file $unzipped_matrix.amd.double.bin.bz2 --precision double --verbose yes --verify no
      #   #rm $unzipped_matrix.amd
      #   gzip $unzipped_matrix
      #else
      #   echo "Matrix $unzipped_matrix.amd.double.bin.bz2 was already converted."         
      #fi         
   fi
done

for link in $FLORIDA_MM_MATRICES;
do
   echo "###############################################################################"
   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."
   else
      DIRNAME=`dirname $matrix`
      FILENAME=`basename $matrix`
      cd $DIRNAME
      echo "Unpacking $FILENAME"
      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
         if test ! -e $file.float.bin.bz2;
         then
            #echo "Converting matrix $file.float.bin.bz2 ..."
            $TNL_MATRIX_CONVERT --input-file $file --output-file $file.float.bin.bz2 --precision float --verbose yes --verify no
         else
            echo "Matrix $file.float.bin.bz2 was already converted."             
         fi
         if test ! -e $file.double.bin.bz2;
         then
            #echo "Converting matrix $file.double.bin.bz2 ..."
            $TNL_MATRIX_CONVERT --input-file $file --output-file $file.double.bin.bz2 --precision double --verbose yes --verify no
         else
            echo "Matrix $file.double.bin.bz2 was already converted."             
         fi         

         #######
         ## AMD ordering
         ###         
         #if test ! -e $file.amd.float.bin.bz2;
         #then
         #   echo "Converting matrix $file.amd.float.bin.bz2 ..."
         #   if test ! -e $file.amd;
         #   then
         #      ./reorder-csr -A -g 32 -i $file -o $file.amd
         #   fi
         #   $TNL_MATRIX_CONVERT --input-file $file.amd --output-file $file.amd.float.bin.bz2 --precision float --verbose yes --verify no
         #   #rm $file.amd
         #else
         #   echo "Matrix $file.amd.float.bin.bz2 was already converted."             
         #fi
         #if test ! -e $file.amd.double.bin.bz2;
         #then
         #   echo "Converting matrix $file.amd.double.bin.bz2 ..."
         #   if test ! -e $file.amd;
         #   then 
         #      ./reorder-csr -A -g 32 -i $file -o $file.amd
         #   fi
         #   $TNL_MATRIX_CONVERT --input-file $file.amd --output-file $file.amd.double.bin.bz2 --precision double --verbose yes --verify no
         #   #rm $file.amd
         #else
         #   echo "Matrix $file.amd.double.bin.bz2 was already converted."             
         #fi                                          
         #rm $file
      done
   fi
done
+0 −140
Original line number Diff line number Diff line
#!/usr/bin/env bash

VERBOSE="yes"

PWD=`pwd`
TNL_MATRIX_DRAW="tnl-grid-view"
IWD="$PWD"

#source ../tnl-env-variables
#export TNL_SPARSE_MATRIX_CHECK_CFG_DESC_FILE="$TNL_SOURCE_DIR/tests/tnl-sparse-matrix-check.cfg.desc"

source matrix-market
source florida-matrix-market

draw_matrix()
{
   # $1 - matrix name

   if test ! -e $1.pdf;
   then
      echo "Drawing $1.pdf"
      $TNL_MATRIX_DRAW --input-files $1.double.bin.bz2 --output-files $1.eps --output-format eps --verbose $VERBOSE
      epstopdf $1.eps            
      rm $1.eps
   else
      echo "$1.pdf exists -- SKIPPING."
   fi
   
   for sort in "" sort.;
   do
      for group_size in 16 32 64;
      do
         bool_sort="no"
         if test x$sort = xsort.;
         then
            bool_sort="yes"
         fi
         if test ! -e $1.${sort}rgcsr-$group_size.pdf;
         then
            echo "Drawing $1.${sort}rgcsr-$group_size.pdf"
            $TNL_MATRIX_DRAW --input-files $1.double.bin.bz2 \
                             --output-files $1.${sort}rgcsr-$group_size.eps \
                             --output-format eps \
                             --matrix-format rg-csr \
                             --matrix-group-size $group_size \
                             --sort-matrix $bool_sort \
                             --verbose $VERBOSE
            epstopdf $1.${sort}rgcsr-$group_size.eps            
            rm $1.${sort}rgcsr-$group_size.eps
         else
            echo "$1.${sort}rgcsr-$group_size.pdf exists -- SKIPPING."
         fi
      done


      for chunk_size in 1 2 4 8 16 32;
      do
         for cuda_block_size in 16 32 64 128 256;
         do        
            if test ! -e $1.${sort}argcsr-$chunk_size-$cuda_block_size.pdf;
            then
               echo "Drawing $1.${sort}argcsr-$chunk_size-$cuda_block_size.pdf"
               $TNL_MATRIX_DRAW --input-files $1.double.bin.bz2 \
                                --output-files $1.${sort}argcsr-$chunk_size-$cuda_block_size.eps \
                                --output-format eps \
                                --matrix-format arg-csr \
                                --desired-matrix-chunk-size $chunk_size \
                                --cuda-block-size $cuda_block_size \
                                --sort-matrix $bool_sort \
                                --verbose $VERBOSE
               epstopdf $1.${sort}argcsr-$chunk_size-$cuda_block_size.eps            
               rm $1.${sort}argcsr-$chunk_size-$cuda_block_size.eps
            else
               echo "$1.${sort}argcsr-$chunk_size-$cuda_block_size.pdf exists -- SKIPPING."
            fi
         done
      done
   done   
   
}

for link in $MM_MATRICES;
do
   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."      
   else
      if test -e $unzipped_matrix.double.bin.bz2;         
      then
         draw_matrix $unzipped_matrix        
      else         
         echo "Matrix $unzipped_matrix.double.bin.bz2 is missing - run the script convert-matrices first."         
      fi
      
      if test -e $unzipped_matrix.amd.double.bin.bz2;         
      then
         draw_matrix $unzipped_matrix.amd        
      else         
         echo "Matrix $unzipped_matrix.amd.double.bin.bz2 is missing - run the script convert-matrices first."         
      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."
   else
      DIRNAME=`dirname $matrix`
      FILENAME=`basename $matrix`
      cd $DIRNAME
      echo "Unpacking $FILENAME"
      tar zxvf $FILENAME
      cd $IWD
      SUBDIRNAME=`echo $FILENAME | sed 's/.tar.gz//'`
      rm -f $DIRNAME/$SUBDIRNAME/*_b.mtx # these are usually in array format
      for file in $DIRNAME/$SUBDIRNAME/*.mtx;
      do
         if test -e $file.double.bin.bz2;
         then
            draw_matrix $file
         else
            echo "Matrix $file.double.bin.bz2 is missing - run the script convert-matrices first."             
         fi
         
         if test -e $file.amd.double.bin.bz2;
         then
            draw_matrix $file.amd
         else
            echo "Matrix $file.amd.double.bin.bz2 is missing - run the script convert-matrices first."             
         fi         
      done
   fi
done