Skip to content

Commit f96c5d2

Browse files
ParU benchmark: remove reliance on paru_internal.hpp
1 parent 00b4303 commit f96c5d2

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

ParU/Demo/paru_benchmark.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <cmath>
1919

2020
#include "ParU.h"
21-
#include "paru_internal.hpp"
2221
#include <stdlib.h>
2322
#ifdef _OPENMP
2423
#include <omp.h>
@@ -192,8 +191,6 @@ int main(int argc, char **argv)
192191
// benchmark UMFPACK
193192
//--------------------------------------------------------------------------
194193

195-
if (1)
196-
{
197194
double umf_time = 0;
198195
double status, // Info [UMFPACK_STATUS]
199196
Info[UMFPACK_INFO], // Contains statistics about the symbolic analysis
@@ -218,7 +215,6 @@ if (1)
218215
printf ("# threads: %d\n", nthreads) ;
219216
#ifdef _OPENMP
220217
omp_set_num_threads (nthreads) ;
221-
BLAS_set_num_threads (nthreads) ;
222218
#endif
223219

224220
double UMF_sym_times [NTRIALS] ;
@@ -328,10 +324,9 @@ if (1)
328324
}
329325

330326
#ifdef _OPENMP
327+
// restore max threads to its default
331328
omp_set_num_threads (max_nthreads) ;
332-
BLAS_set_num_threads (max_nthreads) ;
333329
#endif
334-
}
335330

336331
//--------------------------------------------------------------------------
337332
// benchmark ParU
@@ -345,7 +340,7 @@ if (1)
345340
ParU_Set (PARU_CONTROL_ORDERING, ordering, Control) ;
346341
int kthread = 0 ;
347342
sym_time = -1 ;
348-
int ordering_used, strategy_used, umf_strategy_used ;
343+
int64_t ordering_used, strategy_used, umf_strategy_used ;
349344
for (int nthreads = max_nthreads ; nthreads > 0 ; nthreads = nthreads/2)
350345
{
351346
printf ("# threads: %d\n", nthreads) ;
@@ -373,17 +368,15 @@ if (1)
373368
std::cout << "ParU: analyze failed" << std::endl;
374369
FREE_ALL_AND_RETURN (info) ;
375370
}
376-
ordering_used = Sym->ordering_used ;
377-
strategy_used = Sym->strategy_used ;
378-
umf_strategy_used = Sym->umfpack_strategy ;
379-
371+
ParU_Get (Sym, Num, PARU_GET_ORDERING, &ordering_used, Control) ;
372+
ParU_Get (Sym, Num, PARU_GET_STRATEGY, &strategy_used, Control) ;
373+
ParU_Get (Sym, Num, PARU_GET_UMFPACK_STRATEGY, &umf_strategy_used, Control) ;
380374
info = ParU_Get (Sym, Num, PARU_GET_N, &n, Control) ;
381375
if (info != PARU_SUCCESS)
382376
{
383377
std::cout << "ParU: stats failed" << std::endl;
384378
FREE_ALL_AND_RETURN (info) ;
385379
}
386-
387380
info = ParU_Get (Sym, Num, PARU_GET_ANZ, &anz, Control) ;
388381
if (info != PARU_SUCCESS)
389382
{
@@ -524,12 +517,13 @@ if (1)
524517
kthread++ ;
525518
}
526519

527-
printf ("UMF strategy used: %d\n", umf_strategy_used) ;
528-
printf ("ParU strategy used: %d\n", strategy_used) ;
529-
printf ("ParU ordering used: %d\n", ordering_used) ;
520+
printf ("UMF strategy used: %d\n", (int) umf_strategy_used) ;
521+
printf ("ParU strategy used: %d\n", (int) strategy_used) ;
522+
printf ("ParU ordering used: %d\n", (int) ordering_used) ;
530523
printf ("TABLE, ParU, %s, %d, %d, %d, sym_time:, %12.6e, num_times:, ",
531524
(filename == NULL) ? " " : filename,
532-
umf_strategy_used, strategy_used, ordering_used, sym_time) ;
525+
(int) umf_strategy_used, (int) strategy_used,
526+
(int) ordering_used, sym_time) ;
533527
for (int kk = 0 ; kk < 19 ; kk++)
534528
{
535529
if (num_times [kk] < 0) break ;

0 commit comments

Comments
 (0)