Changeset 43

Show
Ignore:
Timestamp:
08/29/07 18:16:52 (1 year ago)
Author:
pernet
Message:

Updating the benchmark section to make it work with fflas-ffpack

Files:
1 added
1 removed
18 modified

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.Rule

    r42 r43  
    33############################ 
    44ATLAS_CXX=-I/home/cpernet/Logiciels/ATLAS_Opteron64/include/ 
    5 ATLAS_LIB=-L/home/cpernet/Logiciels/ATLAS_Opteron64/lib   -lcblas -latlas 
     5ATLAS_LIB=-L/home/cpernet/Logiciels/ATLAS_Opteron64/lib   -llapack -lcblas -latlas  
    66GOTO_LIB=-L/home/cpernet/Logiciels/GotoBLAS  -lgoto  
    77FFLAS_FFPACK_PATH=/home/cpernet/Logiciels/fflas-ffpack 
  • benchmark/graph/graph_report.sh

    r42 r43  
    7676 
    7777## TRIANGULAR MATRIX INVERSION 
    78 f_funct=trinverse 
     78f_funct=ftrtri 
    7979n_funct=dtrtri 
    8080perl make_graph_file.pl ${TEST_PATH}/ATLAS/timing-check-${f_base}-${PRIME}.txt \ 
  • benchmark/html/html_report.sh

    r42 r43  
    1111read ARCHI_DESCR 
    1212 
    13 TEST_DIR=`ls $HOME_PATH/Target/$ARCHI -I CVS -I GOTO -I ATLAS -I compilation.log | tail -n 1` 
     13TEST_DIR=`ls $HOME_PATH/Target/$ARCHI  -I GOTO -I ATLAS -I compilation.log -I report.xml| tail -n 1` 
    1414echo "Processing testing directory [$TEST_DIR]" 
    1515 
    1616TEST_PATH="$HOME_PATH/Target/$ARCHI/$TEST_DIR" 
     17 
    1718PRIME=65521 
    1819 
     
    3435 
    3536${CURRENT_PATH}/process.sh "Multiple Triangular System Solving"    timing-check-dtrsm-${PRIME}.txt \ 
    36                                                                    timing-check-ftrsm-${PRIME}.txt  >> ${XML_FILE} 
     37                                                                   timing-check-ftrsm-${PRIME}.txt >> ${XML_FILE} 
    3738 
    3839${CURRENT_PATH}/process.sh "Matrix Inversion"             timing-check-dgetri-${PRIME}.txt \ 
     
    4041 
    4142${CURRENT_PATH}/process.sh "Triangular Matrix Inversion"  timing-check-dtrtri-${PRIME}.txt \ 
    42                                                           timing-check-trinverse-${PRIME}.txt >> ${XML_FILE} 
     43                                                          timing-check-ftrtri-${PRIME}.txt >> ${XML_FILE} 
    4344echo "</benchmark>" >> ${XML_FILE} 
    4445 
  • benchmark/html/process.sh

    r42 r43  
    88 
    99 
     10echo `pwd` 
    1011echo  "<test name=\"$1\">" 
    1112echo -n "<prime> " 
  • benchmark/run.sh

    r42 r43  
    7676    echo "Compiling BLAS_LAPACK with GOTO..." 
    7777    echo "Compiling BLAS_LAPACK with GOTO..."  >> ${TARGET_PATH}/compilation.log 
    78 #    make -k GOTO_LINK=true && echo "compilation done" && echo 
     78    make -k GOTO_LINK=true && echo "compilation done" && echo 
    7979     
    8080     
     
    9090    echo "Compiling FFLAS_FFPACK with ATLAS..." 
    9191    echo "Compiling FFLAS_FFPACK with ATLAS..."  >> ${TARGET_PATH}/compilation.log 
    92     make -k ATLAS_LINK=true && echo "compilation done" && echo 
     92   make -k ATLAS_LINK=true && echo "compilation done" && echo 
    9393    cd  ${CURRENT_PATH}/src/BLAS_LAPACK 
    9494    echo "Compiling BLAS_LAPACK with ATLAS..." 
    9595    echo "Compiling BLAS_LAPACK with ATLAS..."  >> ${TARGET_PATH}/compilation.log 
    96 #    make -k ATLAS_LINK=true && echo "compilation done" && echo 
     96    make -k ATLAS_LINK=true && echo "compilation done" && echo 
    9797else 
    9898    echo "Skipping compilation..." 
     
    116116${TEST_SRC_PATH}/mesure-FFLAS_FFPACK.sh 
    117117echo "running BLAS_LAPACK tests with GOTO..." 
    118 #${TEST_SRC_PATH}/mesure-BLAS_LAPACK.sh 
     118${TEST_SRC_PATH}/mesure-BLAS_LAPACK.sh 
    119119 
    120120 
     
    127127echo "running FFLAS_FFPACK tests with ATLAS..." 
    128128${TEST_SRC_PATH}/mesure-FFLAS_FFPACK.sh 
    129 #echo "running BLAS_LAPACK tests with ATLAS..." 
     129echo "running BLAS_LAPACK tests with ATLAS..." 
    130130${TEST_SRC_PATH}/mesure-BLAS_LAPACK.sh 
  • benchmark/src/BLAS_LAPACK/check-dgemm.C

    r42 r43  
    44 
    55#include "fflas-ffpack/fflas.h" 
    6 #include "fflas-ffpack/modular-centered.h" 
     6#include "fflas-ffpack/modular-balanced.h" 
     7#include "Matio.h" 
    78#include "timer.h" 
    89 
     
    1415 
    1516  int    p    = atoi(argv[1]); 
    16   size_t n    = atoi(argv[2]); 
     17  int n    = atoi(argv[2]); 
    1718  size_t iter = atoi(argv[3]); 
    1819   
     
    2223       
    2324  Field F(p); 
    24   Element one; 
     25  Element one, zero; 
    2526  F.init(one, 1.0); 
     27  F.init(zero, 0.0); 
    2628   
    27   Element * C = new Element[n*n]; 
    28  
    2929  Timer chrono; 
    3030  double time=0.0, time2=0.0; 
    3131  int singular; 
    3232   
    33   Element * A; 
    34   Element * B; 
     33  Element * A, * B, * C; 
    3534 
    3635  for (size_t i=0;i<iter;++i){ 
     
    5655    } 
    5756 
    58  
     57    C = new Element[n*n]; 
     58     
    5959    chrono.clear(); 
    6060    chrono.start(); 
    61     FFLAS::fgemm (F, FFLAS::FflasNoTrans, FFLAS::FflasNoTrans, n,n,n, one, 
    62                   A, n, B, n, zero, C); 
     61    cblas_dgemm (CblasRowMajor, CblasNoTrans, CblasNoTrans, n,n,n, one, 
     62                 A, n, B, n, zero, C,n); 
    6363    chrono.stop(); 
    6464    time+=chrono.usertime(); 
  • benchmark/src/BLAS_LAPACK/check-dgetrf.C

    r42 r43  
    11#include <iostream> 
     2#include <vector> 
    23 
    34 
    4 #include "linbox-config.h" 
    5 #undef __LINBOX_HAVE_NTL 
    6 #undef __LINBOX_HAVE_GIVARO 
    75#ifndef __LINBOX_HAVE_DGETRF  
    86#define __LINBOX_HAVE_DGETRF 1 
    97#endif 
    10 #include "linbox/matrix/blas-matrix.h" 
    11 #include "linbox/algorithms/blas-domain.h" 
    12 #include "linbox/field/modular.h" 
    13 #include "linbox/util/timer.h" 
     8#include "fflas-ffpack/fflas.h" 
     9#include "fflas-ffpack/modular-balanced.h" 
     10#include "timer.h" 
     11#include "Matio.h" 
    1412 
    15  
    16 using namespace LinBox; 
    1713using namespace std; 
    1814 
     
    2218 
    2319  int    p    = atoi(argv[1]); 
    24   size_t n    = atoi(argv[2]); 
     20  int n    = atoi(argv[2]); 
    2521  size_t iter = atoi(argv[3]); 
    2622   
     
    3026       
    3127  Field F(p); 
    32   BlasMatrixDomain<Field> BMD(F); 
    33   BlasMatrix<Element> A (n,n); 
     28  Element * A; 
    3429 
    35   LinBox::Timer chrono; 
     30  Timer chrono; 
    3631  double time=0.0; 
    3732  int singular; 
     
    3934  for (size_t i=0;i<iter;++i){ 
    4035    if (argc > 4){ 
    41       fstream osA(argv[4]);     
    42       A.read(osA,F); 
    43       osA.close(); 
     36      A = read_field (F, argv[4], &n,&n); 
    4437    } 
    4538    else{ 
     39      A = new Element[n*n]; 
    4640      Field::RandIter G(F); 
    47       BlasMatrix<Element>::RawIterator it = A.rawBegin(); 
    48       for (; it != A.rawEnd();++it) 
    49         G.random(*it);       
     41      for (size_t i=0; i<n*n; ++i) 
     42        G.random(*(A+i)); 
    5043    } 
    5144  
    5245    chrono.clear(); 
    5346    chrono.start(); 
    54     clapack_dgetrf(CblasRowMajor,n,n,A.getPointer(),n,&Piv[0]); 
     47    clapack_dgetrf(CblasRowMajor,n,n,A,n,&Piv[0]); 
    5548    chrono.stop(); 
    5649  
  • benchmark/src/BLAS_LAPACK/check-dgetri.C

    r42 r43  
    11#include <iostream> 
     2#include <vector> 
     3 
     4#ifndef __LINBOX_HAVE_DGETRF  
     5#define __LINBOX_HAVE_DGETRF 1 
     6#endif 
     7 
     8#ifndef __LINBOX_HAVE_DGETRI  
     9#define __LINBOX_HAVE_DGETRI 1 
     10#endif 
     11#ifndef __LINBOX_HAVE_DTRTRI 
     12#define __LINBOX_HAVE_DTRTRI 1 
     13#endif 
     14#ifndef __LINBOX_AUTOIMPLEMENT_DGETRI 
     15#define __LINBOX_AUTOIMPLEMENT_DGETRI 1 
     16#endif 
    217 
    318 
     19#include "fflas-ffpack/fflas.h" 
     20#include "fflas-ffpack/modular-balanced.h" 
     21#include "timer.h" 
     22#include "Matio.h" 
    423 
    5 #include "linbox-config.h" 
    6 #undef __LINBOX_HAVE_NTL 
    7 #undef __LINBOX_HAVE_GIVARO 
    8 #ifndef __LINBOX_HAVE_DGETRI  
    9 #define __LINBOX_HAVE_DGETRI  
    10 #endif 
    11 #include "linbox/matrix/blas-matrix.h" 
    12 #include "linbox/algorithms/blas-domain.h" 
    13 #include "linbox/field/modular.h" 
    14 #include "linbox/util/timer.h" 
    15  
    16 using namespace LinBox; 
    1724using namespace std; 
    1825 
    1926int main(int argc, char** argv) { 
    20  
     27   
    2128  // parameter: p, n, iteration, file 
    22  
     29   
    2330  int    p    = atoi(argv[1]); 
    24   size_t n    = atoi(argv[2]); 
     31  int n    = atoi(argv[2]); 
    2532  size_t iter = atoi(argv[3]); 
    2633   
    27  
     34   
    2835  typedef Modular<double> Field; 
    2936  typedef Field::Element Element; 
    30        
     37  vector<int> Piv(n,0); 
     38 
    3139  Field F(p); 
     40  Field::Element * A; 
    3241   
    33   LinBox::Timer chrono; 
     42  Timer chrono; 
    3443  double time=0.0; 
    3544  int singular; 
    36   std::vector<int> Piv(n,0); 
    37   BlasMatrix<Element> A (n,n); 
     45   
     46  for (size_t i=0;i<iter;++i){ 
     47    if (argc > 4){ 
     48      A = read_field(F, argv[4],  &n, &n); 
     49    } else { 
     50      A = new Element[n*n];       
     51      Field::RandIter G(F); 
     52      for (size_t i=0; i<n*n; ++i) 
     53        G.random(*(A+i)); 
    3854 
    39   for (size_t i=0;i<iter;++i){ 
    40      if (argc > 4){ 
    41       fstream osA(argv[4]);     
    42       A.read(osA,F); 
    43       osA.close(); 
    4455    } 
    45     else{ 
    46       Field::RandIter G(F); 
    47       BlasMatrix<Element>::RawIterator it = A.rawBegin(); 
    48       for (; it != A.rawEnd();++it) 
    49         G.random(*it);       
    50     } 
    51   
     56    int nullity=0; 
    5257    chrono.clear(); 
    5358    chrono.start(); 
    54     clapack_dgetrf(CblasRowMajor,n,n,A.getPointer(),n,&Piv[0]); 
    55     clapack_dgetri(CblasRowMajor,n,A.getPointer(),n,&Piv[0]); 
     59    clapack_dgetrf(CblasRowMajor,n,n,A,n,&Piv[0]); 
     60    clapack_dgetri(CblasRowMajor,n,A,n,&Piv[0]); 
     61 
    5662    chrono.stop(); 
    57   
     63     
    5864    time+=chrono.usertime(); 
    59   
     65    delete[] A; 
    6066  } 
    61    
     67 
    6268  cerr<<"n: "<<n<<" p: "<<p<<" time: "<<time/iter<<endl; 
    6369 
    64    
     70 
    6571  return 0; 
    6672} 
    6773 
    6874 
     75 
     76 
  • benchmark/src/BLAS_LAPACK/check-dtrsm.C

    r42 r43  
    11#include <iostream> 
    22 
    3 //#define __LINBOX_CONFIGURATION 
    4 //#include <linbox/config-blas.h> 
     3#include "fflas-ffpack/fflas.h" 
     4#include "fflas-ffpack/modular-balanced.h" 
     5#include "timer.h" 
     6#include "Matio.h" 
    57 
    6 #include "linbox-config.h" 
    7 #undef __LINBOX_HAVE_NTL 
    8 #undef __LINBOX_HAVE_GIVARO 
    9 #include "linbox/matrix/blas-matrix.h" 
    10 #include "linbox/algorithms/blas-domain.h" 
    11 #include "linbox/field/modular.h" 
    12 #include "linbox/util/timer.h" 
    13  
    14 using namespace LinBox; 
    158using namespace std; 
    169 
     
    1912  // parameter: p, n, iteration, file1, file2 
    2013 
    21   if (argc != 4) 
    22     std::cout<<"usage: <p> <dim> <iter>\n"; 
    23  
    2414  int    p    = atoi(argv[1]); 
    25   size_t n    = atoi(argv[2]); 
     15  int n    = atoi(argv[2]); 
    2616  size_t iter = atoi(argv[3]); 
    2717   
     
    3121       
    3222  Field F(p); 
    33   BlasMatrixDomain<Field> BMD(F); 
    34   BlasMatrix<Element> A(n,n), B(n,n); 
    35  
    36   LinBox::Timer chrono; 
     23  Element one; 
     24  F.init(one, 1.0); 
     25  Element * A; 
     26  Element * B; 
     27   
     28  Timer chrono; 
    3729  double time=0.0; 
    3830  int singular; 
    3931   
    4032  for (size_t i=0;i<iter;++i){ 
     33    Field::RandIter G(F); 
    4134    if (argc > 4){ 
    42       fstream osA(argv[4]);     
    43       A.read(osA,F); 
    44       osA.close(); 
     35        A = read_field (F, argv[4], &n, &n);     
    4536    } 
    4637    else{ 
    47       Field::RandIter G(F); 
    48       BlasMatrix<Element>::RawIterator it = A.rawBegin(); 
    49       for (; it != A.rawEnd();++it) 
    50         G.random(*it);       
     38      A = new Element[n*n]; 
     39      for (size_t i = 0; i< n*n; ++i) 
     40        G.random(*(A+i));       
    5141    } 
    5242 
    53  
    5443    if (argc == 6){ 
    55       fstream osB(argv[5]);       
    56       B.read(osB,F); 
    57       osB.close(); 
     44      B = read_field (F, argv[5], &n, &n);     
    5845    } 
    5946    else{ 
     47      B = new Element[n*n]; 
    6048      Field::RandIter G(F); 
    61       BlasMatrix<Element>::RawIterator it = B.rawBegin(); 
    62       for (; it != B.rawEnd();++it) 
    63         G.random(*it); 
     49      for (size_t i=0 ; i< n*n; ++i) 
     50        G.random(*(A+i)); 
    6451    } 
    65    
     52         
     53    for (size_t k=0;k<n;++k) 
     54      while (F.isZero( G.random(*(A+k*(n+1))))); 
     55     
    6656    chrono.clear(); 
    6757    chrono.start(); 
    68     cblas_dtrsm(CblasRowMajor, CblasLeft, CblasLower, CblasNoTrans, 
    69                 CblasUnit, n, n, 1.0, A.getPointer(), n, B.getPointer(), n); 
     58    cblas_dtrsm (CblasRowMajor, CblasLeft, CblasLower, CblasNoTrans, 
     59                 CblasNonUnit, n,n, one, A, n, B, n); 
     60     
    7061    chrono.stop(); 
    7162    time+=chrono.usertime(); 
     63    delete[] A; 
     64    delete[] B; 
    7265     
    7366  } 
  • benchmark/src/BLAS_LAPACK/check-dtrtri.C

    r42 r43  
    11#include <iostream> 
    22 
    3 #include "linbox-config.h" 
    4 #undef __LINBOX_HAVE_NTL 
    5 #undef __LINBOX_HAVE_GIVARO 
    63#define __LINBOX_HAVE_DTRTRI 1 
    7 #include "linbox/matrix/blas-matrix.h" 
    8 #include "linbox/algorithms/blas-domain.h" 
    9 #include "linbox/field/modular.h" 
    10 #include "linbox/util/timer.h" 
    114 
    12 //extern "C" { 
    13 //#include "atlas_lapack.h" 
    14 //#include "atlas_enum.h" 
    15 //#include "clapack.h" 
    16 //  int ATL_dtrtriRL(const enum ATLAS_DIAG Diag, const int N, double *A, const int lda); 
    17 //} 
     5#include "fflas-ffpack/modular-balanced.h" 
     6#include "fflas-ffpack/ffpack.h" 
     7#include "timer.h" 
     8#include "Matio.h" 
    189 
    19 using namespace LinBox; 
    2010using namespace std; 
    2111 
    2212int main(int argc, char** argv) { 
    23  
     13   
    2414  // parameter: p, n, iteration, file 
    25  
     15   
    2616  int    p    = atoi(argv[1]); 
    27   size_t n    = atoi(argv[2]); 
     17  int n    = atoi(argv[2]); 
    2818  size_t iter = atoi(argv[3]); 
    2919   
    30  
     20   
    3121  typedef Modular<double> Field; 
    3222  typedef Field::Element Element; 
    33        
     23   
    3424  Field F(p); 
     25  Element * A; 
    3526   
    36   LinBox::Timer chrono; 
     27  Timer chrono; 
    3728  double time=0.0; 
    3829  int singular; 
    39   BlasMatrix<Element> A (n,n); 
     30   
     31  Field::RandIter G(F); 
    4032  for (size_t i=0;i<iter;++i){ 
     33    if (argc > 4){ 
     34      A = read_field (F, argv[4], &n, &n);     
     35    } else { 
     36      A = new Element[n*n]; 
     37      for (size_t i=0; i< n*n; ++i) 
     38        G.random(*(A+i)); 
     39    }       
     40    for (size_t k=0;k<n;++k) 
     41      while (F.isZero( G.random(*(A+k*(n+1))))); 
    4142     
    42     if (argc > 4){ 
    43       fstream osA(argv[4]);     
    44       A.read(osA,F); 
    45       osA.close(); 
    46     } 
    47     else{ 
    48       Field::RandIter G(F); 
    49       BlasMatrix<Element>::RawIterator it = A.rawBegin(); 
    50       for (; it != A.rawEnd();++it) 
    51         G.random(*it);       
    52     } 
    53   
    54     for (size_t k=0;k<n;++k)     
    55       A.setEntry(k,k,1); 
    56   
    5743    chrono.clear(); 
    58     chrono.start();        
    59     //ATL_dtrtriRL(CblasUnit,n,A.getWritePointer(),n); 
    60     clapack_dtrtri(CblasRowMajor,CblasLower, CblasUnit,n,A.getWritePointer(),n); 
     44    chrono.start(); 
     45    clapack_dtrtri(CblasRowMajor,CblasUpper, CblasNonUnit,n,A,n); 
    6146    chrono.stop(); 
    62   
     47     
    6348    time+=chrono.usertime(); 
    64   
     49    delete[] A; 
     50     
    6551  } 
    6652 
  • benchmark/src/FFLAS_FFPACK/check-fgemm.C

    r42 r43  
    2626  F.init(one, 1.0); 
    2727  F.init(zero,0.0); 
    28   Element * C = new Element[n*n]; 
    2928 
    3029  Timer chrono; 
     
    3231  int singular; 
    3332   
    34   Element * A; 
    35   Element * B; 
     33  Element * A, * B, * C; 
    3634 
    3735  for (size_t i=0;i<iter;++i){ 
  • benchmark/src/FFLAS_FFPACK/check-ftrsm.C

    r42 r43  
    3636    } 
    3737    else{ 
     38      A = new Element[n*n]; 
    3839      for (size_t i = 0; i< n*n; ++i) 
    3940        G.random(*(A+i));       
     
    4445    } 
    4546    else{ 
     47      B = new Element[n*n]; 
    4648      Field::RandIter G(F); 
    4749      for (size_t i=0 ; i< n*n; ++i) 
  • benchmark/src/FFLAS_FFPACK/check-lqup.C

    r42 r43  
    3434    } 
    3535    else{ 
     36      A = new Element[n*n]; 
    3637      Field::RandIter G(F); 
    3738      for (size_t i=0; i< n*n; ++i) 
  • benchmark/test-src/mesure-FFLAS_FFPACK.sh

    r42 r43  
    88    ${TEST_SRC_PATH}/mesure.sh check-inverse   $p  
    99    ${TEST_SRC_PATH}/mesure.sh check-ftrsm     $p  
    10     ${TEST_SRC_PATH}/mesure.sh check-trinverse $p  
     10    ${TEST_SRC_PATH}/mesure.sh check-ftrtri $p  
    1111done 
  • benchmark/test-src/parameter.in

    r42 r43  
    1 500    10  
    2 1000   5  
    3 2000   5   
    4 3000   3   
     1300    5 
     2500    2  
     31000   1  
     42000   1 
     55000   1 
     610000  1 
     715000  1 
  • include/config-blas.h

    r40 r43  
    6666extern "C" { 
    6767   
    68 #if HAVE_DGETRF 
    69         void dgetrf_(const int *, const int *, double *, const int *, int *, int *); 
    70 #endif 
    71 #if HAVE_DGETRI