Skip to content

Commit f910f9b

Browse files
ParU on Mac: disable task tree when using gcc
1 parent 02b058b commit f910f9b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

ParU/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ if ( NOPENMP )
5656
set ( OpenMP_CXX_FOUND OFF )
5757
set ( OpenMP_C_FOUND OFF )
5858
else ( )
59+
# OpenMP 4.5 or later is required
5960
find_package ( OpenMP )
6061
if ( OpenMP_CXX_FOUND AND OpenMP_CXX_VERSION VERSION_LESS 4.5 )
6162
set ( NOPENMP ON )
6263
endif ( )
63-
if ( DEMO AND OpenMP_C_FOUND AND OpenMP_C_VERSION VERSION_LESS 4.5 )
64+
if ( OpenMP_C_FOUND AND OpenMP_C_VERSION VERSION_LESS 4.5 )
6465
set ( NOPENMP ON )
6566
endif ( )
6667
if ( NOPENMP )
@@ -165,14 +166,14 @@ endif ( )
165166
# additional definitions
166167
#-------------------------------------------------------------------------------
167168

168-
if ( WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU" )
169-
# Some parallelization levels don't work correctly with GCC on Windows
170-
# (because of emuTLS?). Omit them.
169+
if ( (APPLE OR WIN32) AND CMAKE_C_COMPILER_ID STREQUAL "GNU" )
170+
# Some parallelization levels don't work correctly with GCC on Windows or
171+
# Mac (because of emuTLS?). Omit them.
171172
if ( BUILD_SHARED_LIBS )
172-
target_compile_definitions (ParU PRIVATE PARU_GCC_WINDOWS )
173+
target_compile_definitions (ParU PRIVATE PARU_1TASK )
173174
endif ( )
174175
if ( BUILD_STATIC_LIBS )
175-
target_compile_definitions (ParU_static PRIVATE PARU_GCC_WINDOWS )
176+
target_compile_definitions (ParU_static PRIVATE PARU_1TASK )
176177
endif ( )
177178
endif ( )
178179

ParU/Source/paru_factorize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
341341
// execute the task tree
342342
//--------------------------------------------------------------------------
343343

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

0 commit comments

Comments
 (0)