Skip to content

Commit

Permalink
ParU: Use sequential factorization unconditionally on Windows with GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 6, 2023
1 parent 11af347 commit f37510e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ParU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ if ( NOT NSTATIC )
$<INSTALL_INTERFACE:${SUITESPARSE_INCLUDEDIR}> )
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.
target_compile_definitions (ParU PRIVATE PARU_GCC_WINDOWS )
if ( NOT NSTATIC )
target_compile_definitions (ParU_static PRIVATE PARU_GCC_WINDOWS )
endif ( )
endif ( )

#-------------------------------------------------------------------------------
# add the library dependencies
#-------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions ParU/Source/paru_factorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ 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 ((int64_t)task_Q.size() * 2 > Control->paru_max_threads)
{
printf ("Parallel:\n") ; // FIXME
Expand Down Expand Up @@ -433,6 +436,7 @@ ParU_Ret ParU_Factorize(cholmod_sparse *A, ParU_Symbolic *Sym,
}
}
else
#endif
{
PRLEVEL(1, ("Sequential\n"));
Work->naft = 1;
Expand Down

0 comments on commit f37510e

Please sign in to comment.