/[escript]/trunk/paso/profiling/Test.c
ViewVC logotype

Diff of /trunk/paso/profiling/Test.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2160 by artak, Tue Dec 16 03:29:54 2008 UTC revision 2165 by artak, Tue Dec 16 05:32:43 2008 UTC
# Line 2  Line 2 
2  #include "paso/Common.h"  #include "paso/Common.h"
3  #include "paso/Solver.h"  #include "paso/Solver.h"
4  #include "paso/SystemMatrix.h"  #include "paso/SystemMatrix.h"
5  #include "paso/Paso_tests.h"  #include "Paso_tests.h"
6    
7  int main (int argc, char *argv[]) {  int main (int argc, char *argv[]) {
8      Paso_SystemMatrix *A = NULL;      Paso_SystemMatrix *A = NULL;
9      double *b,*x,S;      double *b,*x;
10      dim_t i,n;      dim_t i,n,level=1;
11        
12      if (argc<2) {      if (argc<2) {
13          fprintf(stderr,"Please enter the filename\n");          fprintf(stderr,"Please enter the filename\n");
14          return -1;              return -1;    
15      }      }
16    
17        if (argc==3) {
18          level=atoi(argv[2]);
19        }
20            
21      A=MEMALLOC(1,Paso_SystemMatrix);      A=MEMALLOC(1,Paso_SystemMatrix);
22        
23      A=Paso_SystemMatrix_loadMM_toCSR(argv[1]);      A=Paso_SystemMatrix_loadMM_toCSR(argv[1]);
24      if (A==NULL) {      if (A==NULL) {
25        printf("CSR Matrix not Loaded\n");        fprintf(stderr,"CSR Matrix not Loaded\n");
26        return 0;        return 0;
27      }      }
28      n=Paso_SystemMatrix_getTotalNumRows(A);      n=Paso_SystemMatrix_getTotalNumRows(A);
# Line 29  int main (int argc, char *argv[]) { Line 33  int main (int argc, char *argv[]) {
33       b[i]=1;       b[i]=1;
34      }      }
35            
36      Paso_test_run(A,b,1);      Paso_test_run(A,b,level);
       
37      MEMFREE(b);      MEMFREE(b);
38      MEMFREE(x);      MEMFREE(x);
39      Paso_SystemMatrix_free(A);      Paso_SystemMatrix_free(A);

Legend:
Removed from v.2160  
changed lines
  Added in v.2165

  ViewVC Help
Powered by ViewVC 1.1.26