Skip to content

Commit

Permalink
ParU on Mac: disable task tree when using gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Dec 3, 2023
1 parent 02b058b commit f910f9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions ParU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ if ( NOPENMP )
set ( OpenMP_CXX_FOUND OFF )
set ( OpenMP_C_FOUND OFF )
else ( )
# OpenMP 4.5 or later is required
find_package ( OpenMP )
if ( OpenMP_CXX_FOUND AND OpenMP_CXX_VERSION VERSION_LESS 4.5 )
set ( NOPENMP ON )
endif ( )
if ( DEMO AND OpenMP_C_FOUND AND OpenMP_C_VERSION VERSION_LESS 4.5 )
if ( OpenMP_C_FOUND AND OpenMP_C_VERSION VERSION_LESS 4.5 )
set ( NOPENMP ON )
endif ( )
if ( NOPENMP )
Expand Down Expand Up @@ -165,14 +166,14 @@ endif ( )
# additional definitions
#-------------------------------------------------------------------------------

if ( WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU" )
# Some parallelization levels don't work correctly with GCC on Windows
# (because of emuTLS?). Omit them.
if ( (APPLE OR WIN32) AND CMAKE_C_COMPILER_ID STREQUAL "GNU" )
# Some parallelization levels don't work correctly with GCC on Windows or
# Mac (because of emuTLS?). Omit them.
if ( BUILD_SHARED_LIBS )
target_compile_definitions (ParU PRIVATE PARU_GCC_WINDOWS )
target_compile_definitions (ParU PRIVATE PARU_1TASK )
endif ( )
if ( BUILD_STATIC_LIBS )
target_compile_definitions (ParU_static PRIVATE PARU_GCC_WINDOWS )
target_compile_definitions (ParU_static PRIVATE PARU_1TASK )
endif ( )
endif ( )

Expand Down
8 changes: 4 additions & 4 deletions ParU/Source/paru_factorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,13 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
// execute the task tree
//--------------------------------------------------------------------------

#if ! defined ( PARU_GCC_WINDOWS )
// The parallel factorization gets stuck intermittently on Windows with GCC.
// Use the sequential factorization unconditionally in that case.
#if ! defined ( PARU_1TASK )
// The parallel factorization gets stuck intermittently on Windows or Mac
// with gcc, so always use the sequential factorization in that case.
if (task_Q.size() * 2 > Control->paru_max_threads)
{
PRLEVEL(1, ("Parallel\n"));
// chekcing user input
// checking user input
PRLEVEL(1, ("Control: max_th=" LD " scale=" LD " piv_toler=%lf "
"diag_toler=%lf trivial =" LD " worthwhile_dgemm=" LD " "
"worthwhile_trsm=" LD "\n",
Expand Down

0 comments on commit f910f9b

Please sign in to comment.