Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 25
    • Merge requests 25
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1433
Closed
Open
Created Oct 26, 2006 by Sonia Chouaieb@schGuest

SAC conjugate gradient CG (cg-v30.sac) -noopt -dodfr -dodcr

Bugzilla Link 316
Created on Oct 26, 2006 13:02
Resolution INVALID
Resolved on Oct 26, 2006 14:43
Version 1.00beta
OS Linux
Architecture PC
Attachments cg-v30.sac, RandLC.sac

Extended Description

Description of CG:
The CG benchmark uses the inverse power method to find an estimate of the
largest eigenvalue of a symmetric positive definite sparse matrix with a random
pattern of nonzeroes.
Compile options used: -noopt -dodfr -dodcr
Bug: (using -noopt)
** 18: Invoking C compiler: ...
gcc: unrecognized option '-R.'
/tmp/ccGosVAL.o: In function `SACwf__MAIN__clock__SACt_Clock__time_S':
cg30.c:(.text+0xb615): undefined reference to `SACclock'
collect2: ld returned 1 exit status
ABORT: System failed to execute shell command
ABORT: gcc -Wall -Wno-unused -fno-builtin -fPIC -DPIC  -I$SACBASE/runtime/
ABORT: -L$SACBASE/runtime/ -L/tmp/SAC_TwRdNw    -o cg30 cg30.c -L. -R.
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libStdIO.a
ABORT: /home/chouiaeb/sac/stdlib/world/system/lib/libClock.a ./libRandLC.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libScalarIO.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libArrayIO.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libFibreIO.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libListIO.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libComplexIO.a
ABORT: /home/chouiaeb/sac/stdlib/modules/structures/lib/libArray.a
ABORT: /home/chouiaeb/sac/stdlib/modules/structures/lib/libList.a
ABORT: /home/chouiaeb/sac/stdlib/modules/structures/lib/libComplex.a
ABORT: /home/chouiaeb/sac/stdlib/world/stdio/lib/libIOresources.a
ABORT: /home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexMath.a
ABORT: /home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexArrayArith.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexArrayTransform.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexArrayBasics.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexScalarArith.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libComplexBasics.a
/home/chouiaeb/sac/stdlib/modules/numerical/lib/libMath.a
/home/chouiaeb/sac/stdlib/world/stdio/lib/libFile.a
/home/chouiaeb/sac/stdlib/world/stdio/lib/libTermFile.a
/home/chouiaeb/sac/stdlib/world/system/lib/libTerminal.a
/home/chouiaeb/sac/stdlib/world/system/lib/libFileSystem.a
/home/chouiaeb/sac/stdlib/world/system/lib/libSysErr.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libArrayTransform.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libConstants.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libArrayArith.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libBool.a -lm
/home/chouiaeb/sac/stdlib/modules/structures/lib/libString.a
/home/chouiaeb/sac/stdlib/world/system/lib/libWorld.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libChar.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libArrayBasics.a
/home/chouiaeb/sac/runtime/libsac2c.a
/home/chouiaeb/sac/stdlib/modules/structures/lib/libScalarArith.a -lsac
with exit code 1
*** Compilation failed ***
*** Exit code 18 (Invoking C compiler)
*** 1 Error(s), 12 Warning(s)
 
CG - SAC VERSION :
import StdIO: all;
import Array: all;
import Math: all;
import Clock:all;
import ScalarArith: all;
use RandLC: all;     
#ifdef CLASSW
#define PROB   "W"
#define N      7000			/*	Number of rows & columns*/
#define NITER  15			/*	Number of iterations	*/
#define LAMBDA 12d			/*	Shift			*/
#define NONZER 8  			/*	Number of non zeros	*/
#define ZETA_VERIFY_VALUE 10.362595087124d
#define RCOND 0.1d
#endif
#ifdef CLASSA
#define PROB   "A"
#define N      14000
#define NITER  15
#define LAMBDA 20d
#define NONZER 11
#define ZETA_VERIFY_VALUE 17.130235054029d
#define RCOND 0.1d
#endif
#ifdef CLASSB
#define PROB   "B"
#define N      75000
#define NITER  75
#define LAMBDA 60d
#define NONZER 13
#define ZETA_VERIFY_VALUE 22.712745482631d
#define RCOND 0.1d
#endif
#ifdef CLASSC
#define PROB   "C"
#define N      150000
#define NITER  75
#define LAMBDA 110d
#define NONZER 15
#define ZETA_VERIFY_VALUE 28.973605592845d
#define RCOND 0.1d
#endif
#ifdef CLASSD
#define PROB   "D"
#define N      1500000
#define NITER  100
#define LAMBDA 500d
#define NONZER 21
#define ZETA_VERIFY_VALUE 52.5145321058d
#define RCOND 0.1d
#endif
#ifndef PROB
#define PROB   "Sample" /*Class S*/
#define N      6/*1400*/
#define NITER  15
#define LAMBDA 10d
#define NONZER 2/*7*/
#define ZETA_VERIFY_VALUE 8.5971775078648d 
#define RCOND 0.1d
#endif
/*							
 * Multiplying a Matrix formed by a triple:		
 *	(a,rowstr,colidx) and a Vector			
 *							
 * Input: a, rowstr, colidx,p				
 * Output: r						
 *							
 */
double[.] matvecmul( double[.] a, int[.] rowstr, int[.] colidx, double[.] p) {
  n = shape(p);
  q = with(iv)
	([0] <= iv  jcol){
            printf("colidx[[k]] > jcol\n");
            /* ... insert colidx here properly */
            for (kk = (rowstr[[j+1]]-2); kk>=k; kk--){
              if (colidx[[kk]] > -1) {                 
                a[[kk+1]] = a[[kk]];        
                colidx[[kk+1]] = colidx[[kk]];
              }
            }
            colidx[[k]] = jcol;
            a[[k]] = 0d;
            found = true;
          }
          else if (colidx[[k]] == -1){     
             printf("colidx[[k]] == -1\n");
             colidx[[k]] = jcol;
             found = true;
          }
          else if (colidx[[k]] == jcol){
            printf("colidx[[k]] == jcol\n");
            /* ... mark the duplicated entry */
            nzloc[[j]] = nzloc[[j]]+1;
            found = true;
          } 
        }
       a[[k-1]]= a[[k-1]] + va;
      }
    }
    w = w * ratio;
  }
 
  printf("\na = ");        print(a);
  printf("\ncolidx = ");   print(colidx);
  printf("\n\nrowstr = "); print(rowstr);
  printf("\nnzloc = ");   print(nzloc);
  printf("\n\n\n__________ Compress ________\n\n");
  /* compress: 
   * ...remove empty entries and generate final results 
   */
  for (j=1; j0){ 
             j1 = rowstr[[j]] - nzloc[[j-1]];
           } 
    else   { 
              j1 = 0;
           }
    j2 = rowstr[[j+1]] - nzloc[[j]] - 1;
    nza = rowstr[[j]];
    for (k=j1; k<=j2; k++){
      a[[k]] = a[[nza]];
      colidx[[k]] = colidx[[nza]];
      nza = nza+1; 
    }
  }
  
  for (j=1; j
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking