Skip to content

Commit

Permalink
Merge pull request #623 from DrTimothyAldenDavis/dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis authored Dec 23, 2023
2 parents fbe9cd9 + 8baf3d1 commit ed9d8c5
Show file tree
Hide file tree
Showing 25 changed files with 461 additions and 298 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-arch-emu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
name: alpine (${{ matrix.arch }})

steps:
- name: get CPU information (host)
shell: bash
run: lscpu

- name: checkout repository
uses: actions/checkout@v3
# shell: bash
Expand All @@ -70,6 +74,10 @@ jobs:
mpfr-dev
lapack-dev
valgrind
util-linux-misc
- name: get CPU information (emulated)
run: lscpu

- name: prepare ccache
# create key with human readable timestamp
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph"
# string with name of libraries to be checked
CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:ParU:RBio:SPQR:SPEX:GraphBLAS:LAGraph"
CHECK_LIBS_MAC: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:SPEX:GraphBLAS:LAGraph"


jobs:
Expand Down Expand Up @@ -87,6 +86,9 @@ jobs:
CXX: ${{ matrix.cxx }}

steps:
- name: get CPU information
run: lscpu

- name: checkout repository
uses: actions/checkout@v3

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
runs-on: macos-latest

steps:
- name: get runner hardware information
run: |
sysctl hw
sysctl machdep
- name: checkout repository
uses: actions/checkout@v3

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/root-cmakelists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
CXX: ${{ matrix.cxx }}

steps:
- name: get CPU information
run: lscpu

- name: checkout repository
uses: actions/checkout@v3

Expand Down
3 changes: 3 additions & 0 deletions CHOLMOD/Config/cholmod.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4063,6 +4063,9 @@ int cholmod_l_gpu_probe ( cholmod_common *Common ) ;
int cholmod_gpu_deallocate ( cholmod_common *Common ) ;
int cholmod_l_gpu_deallocate ( cholmod_common *Common ) ;

int cholmod_gpu_start ( cholmod_common *Common ) ;
int cholmod_l_gpu_start ( cholmod_common *Common ) ;

void cholmod_gpu_end ( cholmod_common *Common ) ;
void cholmod_l_gpu_end ( cholmod_common *Common ) ;

Expand Down
60 changes: 37 additions & 23 deletions CHOLMOD/Demo/cholmod_di_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main (int argc, char **argv)

cm = &Common ;
cholmod_start (cm) ;
cm->print = 4 ;
cm->print = 3 ;

cm->prefer_zomplex = prefer_zomplex ;

Expand Down Expand Up @@ -279,28 +279,42 @@ int main (int argc, char **argv)
// analyze and factorize
//--------------------------------------------------------------------------

// The analysis and factorizations are repeated, to get accurate timings
// and to exercise that particular feature.

double maxresid = 0 ;

for (int overall_trials = 0 ; overall_trials <= 1 ; overall_trials++)
{
printf ("\n=== Overall Trial: %d\n", overall_trials) ;

t = CPUTIME ;
L = cholmod_analyze (A, cm) ;
ta = CPUTIME - t ;
ta = MAX (ta, 0) ;

printf ("Analyze: flop %g lnz %g\n", cm->fl, cm->lnz) ;
printf ("Analyze: flop %g lnz %g, time: %g\n", cm->fl, cm->lnz, ta) ;

if (A->stype == 0)
{
printf ("Factorizing A*A'+beta*I\n") ;
t = CPUTIME ;
cholmod_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
}
else
for (int factor_trials = 0 ; factor_trials <= 2 ; factor_trials++)
{
printf ("Factorizing A\n") ;
t = CPUTIME ;
cholmod_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
if (A->stype == 0)
{
t = CPUTIME ;
cholmod_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor_trial: %d, Factorizing A*A'+beta*I, time: %g\n",
factor_trials, tf) ;
}
else
{
t = CPUTIME ;
cholmod_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor trial: %d, Factorizing A, time: %g\n",
factor_trials, tf) ;
}
}

cholmod_print_factor (L, "L", cm) ;
Expand Down Expand Up @@ -704,21 +718,20 @@ int main (int argc, char **argv)
{
printf ("nnz(L) / nnz(A): %8.1f\n", cm->lnz / cm->anz) ;
}
printf ("analyze cputime: %12.4f\n", ta) ;
printf ("factor cputime: %12.4f mflop: %8.1f\n", tf,
printf ("analyze time: %12.4f\n", ta) ;
printf ("factor time: %12.4f mflop: %8.1f\n", tf,
(tf == 0) ? 0 : (1e-6*cm->fl / tf)) ;
printf ("solve cputime: %12.4f mflop: %8.1f\n", ts [0],
printf ("solve time: %12.4f mflop: %8.1f\n", ts [0],
(ts [0] == 0) ? 0 : (1e-6*4*cm->lnz / ts [0])) ;
printf ("overall cputime: %12.4f mflop: %8.1f\n",
printf ("overall time: %12.4f mflop: %8.1f\n",
tot, (tot == 0) ? 0 : (1e-6 * (cm->fl + 4 * cm->lnz) / tot)) ;
printf ("solve cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
printf ("solve time: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
(ts [1] == 0) ? 0 : (1e-6*4*cm->lnz / ts [1]), NTRIALS) ;
printf ("solve2 cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
printf ("solve2 time: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
(ts [2] == 0) ? 0 : (1e-6*4*cm->lnz / ts [2]), NTRIALS) ;
printf ("peak memory usage: %12.0f (MB)\n",
(double) (cm->memory_usage) / 1048576.) ;
printf ("residual (|Ax-b|/(|A||x|+|b|)): ") ;
double maxresid = 0 ;
for (method = 0 ; method <= nmethods ; method++)
{
printf ("%8.2e ", resid [method]) ;
Expand All @@ -743,6 +756,7 @@ int main (int argc, char **argv)

cholmod_free_factor (&L, cm) ;
cholmod_free_dense (&X, cm) ;
}

//--------------------------------------------------------------------------
// free matrices and finish CHOLMOD
Expand Down
60 changes: 37 additions & 23 deletions CHOLMOD/Demo/cholmod_dl_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main (int argc, char **argv)

cm = &Common ;
cholmod_l_start (cm) ;
cm->print = 4 ;
cm->print = 3 ;

cm->prefer_zomplex = prefer_zomplex ;

Expand Down Expand Up @@ -279,28 +279,42 @@ int main (int argc, char **argv)
// analyze and factorize
//--------------------------------------------------------------------------

// The analysis and factorizations are repeated, to get accurate timings
// and to exercise that particular feature.

double maxresid = 0 ;

for (int overall_trials = 0 ; overall_trials <= 1 ; overall_trials++)
{
printf ("\n=== Overall Trial: %d\n", overall_trials) ;

t = CPUTIME ;
L = cholmod_l_analyze (A, cm) ;
ta = CPUTIME - t ;
ta = MAX (ta, 0) ;

printf ("Analyze: flop %g lnz %g\n", cm->fl, cm->lnz) ;
printf ("Analyze: flop %g lnz %g, time: %g\n", cm->fl, cm->lnz, ta) ;

if (A->stype == 0)
{
printf ("Factorizing A*A'+beta*I\n") ;
t = CPUTIME ;
cholmod_l_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
}
else
for (int factor_trials = 0 ; factor_trials <= 2 ; factor_trials++)
{
printf ("Factorizing A\n") ;
t = CPUTIME ;
cholmod_l_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
if (A->stype == 0)
{
t = CPUTIME ;
cholmod_l_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor_trial: %d, Factorizing A*A'+beta*I, time: %g\n",
factor_trials, tf) ;
}
else
{
t = CPUTIME ;
cholmod_l_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor trial: %d, Factorizing A, time: %g\n",
factor_trials, tf) ;
}
}

cholmod_l_print_factor (L, "L", cm) ;
Expand Down Expand Up @@ -704,21 +718,20 @@ int main (int argc, char **argv)
{
printf ("nnz(L) / nnz(A): %8.1f\n", cm->lnz / cm->anz) ;
}
printf ("analyze cputime: %12.4f\n", ta) ;
printf ("factor cputime: %12.4f mflop: %8.1f\n", tf,
printf ("analyze time: %12.4f\n", ta) ;
printf ("factor time: %12.4f mflop: %8.1f\n", tf,
(tf == 0) ? 0 : (1e-6*cm->fl / tf)) ;
printf ("solve cputime: %12.4f mflop: %8.1f\n", ts [0],
printf ("solve time: %12.4f mflop: %8.1f\n", ts [0],
(ts [0] == 0) ? 0 : (1e-6*4*cm->lnz / ts [0])) ;
printf ("overall cputime: %12.4f mflop: %8.1f\n",
printf ("overall time: %12.4f mflop: %8.1f\n",
tot, (tot == 0) ? 0 : (1e-6 * (cm->fl + 4 * cm->lnz) / tot)) ;
printf ("solve cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
printf ("solve time: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
(ts [1] == 0) ? 0 : (1e-6*4*cm->lnz / ts [1]), NTRIALS) ;
printf ("solve2 cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
printf ("solve2 time: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
(ts [2] == 0) ? 0 : (1e-6*4*cm->lnz / ts [2]), NTRIALS) ;
printf ("peak memory usage: %12.0f (MB)\n",
(double) (cm->memory_usage) / 1048576.) ;
printf ("residual (|Ax-b|/(|A||x|+|b|)): ") ;
double maxresid = 0 ;
for (method = 0 ; method <= nmethods ; method++)
{
printf ("%8.2e ", resid [method]) ;
Expand All @@ -743,6 +756,7 @@ int main (int argc, char **argv)

cholmod_l_free_factor (&L, cm) ;
cholmod_l_free_dense (&X, cm) ;
}

//--------------------------------------------------------------------------
// free matrices and finish CHOLMOD
Expand Down
60 changes: 37 additions & 23 deletions CHOLMOD/Demo/cholmod_si_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main (int argc, char **argv)

cm = &Common ;
cholmod_start (cm) ;
cm->print = 4 ;
cm->print = 3 ;

cm->prefer_zomplex = prefer_zomplex ;

Expand Down Expand Up @@ -279,28 +279,42 @@ int main (int argc, char **argv)
// analyze and factorize
//--------------------------------------------------------------------------

// The analysis and factorizations are repeated, to get accurate timings
// and to exercise that particular feature.

double maxresid = 0 ;

for (int overall_trials = 0 ; overall_trials <= 1 ; overall_trials++)
{
printf ("\n=== Overall Trial: %d\n", overall_trials) ;

t = CPUTIME ;
L = cholmod_analyze (A, cm) ;
ta = CPUTIME - t ;
ta = MAX (ta, 0) ;

printf ("Analyze: flop %g lnz %g\n", cm->fl, cm->lnz) ;
printf ("Analyze: flop %g lnz %g, time: %g\n", cm->fl, cm->lnz, ta) ;

if (A->stype == 0)
{
printf ("Factorizing A*A'+beta*I\n") ;
t = CPUTIME ;
cholmod_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
}
else
for (int factor_trials = 0 ; factor_trials <= 2 ; factor_trials++)
{
printf ("Factorizing A\n") ;
t = CPUTIME ;
cholmod_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
if (A->stype == 0)
{
t = CPUTIME ;
cholmod_factorize_p (A, beta, NULL, 0, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor_trial: %d, Factorizing A*A'+beta*I, time: %g\n",
factor_trials, tf) ;
}
else
{
t = CPUTIME ;
cholmod_factorize (A, L, cm) ;
tf = CPUTIME - t ;
tf = MAX (tf, 0) ;
printf ("factor trial: %d, Factorizing A, time: %g\n",
factor_trials, tf) ;
}
}

cholmod_print_factor (L, "L", cm) ;
Expand Down Expand Up @@ -704,21 +718,20 @@ int main (int argc, char **argv)
{
printf ("nnz(L) / nnz(A): %8.1f\n", cm->lnz / cm->anz) ;
}
printf ("analyze cputime: %12.4f\n", ta) ;
printf ("factor cputime: %12.4f mflop: %8.1f\n", tf,
printf ("analyze time: %12.4f\n", ta) ;
printf ("factor time: %12.4f mflop: %8.1f\n", tf,
(tf == 0) ? 0 : (1e-6*cm->fl / tf)) ;
printf ("solve cputime: %12.4f mflop: %8.1f\n", ts [0],
printf ("solve time: %12.4f mflop: %8.1f\n", ts [0],
(ts [0] == 0) ? 0 : (1e-6*4*cm->lnz / ts [0])) ;
printf ("overall cputime: %12.4f mflop: %8.1f\n",
printf ("overall time: %12.4f mflop: %8.1f\n",
tot, (tot == 0) ? 0 : (1e-6 * (cm->fl + 4 * cm->lnz) / tot)) ;
printf ("solve cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
printf ("solve time: %12.4f mflop: %8.1f (%d trials)\n", ts [1],
(ts [1] == 0) ? 0 : (1e-6*4*cm->lnz / ts [1]), NTRIALS) ;
printf ("solve2 cputime: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
printf ("solve2 time: %12.4f mflop: %8.1f (%d trials)\n", ts [2],
(ts [2] == 0) ? 0 : (1e-6*4*cm->lnz / ts [2]), NTRIALS) ;
printf ("peak memory usage: %12.0f (MB)\n",
(double) (cm->memory_usage) / 1048576.) ;
printf ("residual (|Ax-b|/(|A||x|+|b|)): ") ;
double maxresid = 0 ;
for (method = 0 ; method <= nmethods ; method++)
{
printf ("%8.2e ", resid [method]) ;
Expand All @@ -743,6 +756,7 @@ int main (int argc, char **argv)

cholmod_free_factor (&L, cm) ;
cholmod_free_dense (&X, cm) ;
}

//--------------------------------------------------------------------------
// free matrices and finish CHOLMOD
Expand Down
Loading

0 comments on commit ed9d8c5

Please sign in to comment.