From 1fd6de144ad3aa8ee6f239cf503b421f6ae4c22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= Date: Thu, 28 Dec 2023 21:09:31 +0100 Subject: [PATCH] Remove functions requiring strong order if weak order In order to not lie to the user. Also document this and define preprocessor macros in case they are defined. Involved functions are: - nmod_mpoly_divides_heap_threaded - _nmod_mpoly_divides_heap_threaded_pool - nmod_mpolyn_divides_threaded_pool - fmpz_mpoly_divides_heap_threaded - _fmpz_mpoly_divides_heap_threaded_pool --- configure.ac | 6 +-- doc/source/fmpz_mpoly.rst | 25 ++++++++--- doc/source/nmod_mpoly.rst | 17 +++++++- src/fmpz_mpoly.h | 4 ++ src/fmpz_mpoly/divides.c | 25 ++++++++++- src/fmpz_mpoly/divides_heap_threaded.c | 42 ++++++++++--------- src/fmpz_mpoly/test/t-divides_heap_threaded.c | 7 ++++ src/nmod_mpoly.h | 7 ++++ src/nmod_mpoly/divides.c | 4 ++ src/nmod_mpoly/divides_heap_threaded.c | 12 +++--- src/nmod_mpoly/gcd_brown.c | 15 +++++++ src/nmod_mpoly/mpolyn_divides_threaded.c | 14 +++---- src/nmod_mpoly/test/main.c | 4 +- src/nmod_mpoly/test/t-divides_heap_threaded.c | 7 ++++ ...ded.c => t-mpolyn_divides_threaded_pool.c} | 9 +++- 15 files changed, 151 insertions(+), 47 deletions(-) rename src/nmod_mpoly/test/{t-mpolyn_divides_threaded.c => t-mpolyn_divides_threaded_pool.c} (96%) diff --git a/configure.ac b/configure.ac index 25a12dbc55..5b41dab172 100644 --- a/configure.ac +++ b/configure.ac @@ -646,17 +646,17 @@ AC_MSG_CHECKING([if memory is strongly-ordered]) case "$host_cpu" in x86_64|x86|i386|i586) flint_know_strong_order="yes" - AC_MSG_CHECKING([yes]) + AC_MSG_RESULT([yes]) ;; *) flint_know_strong_order="no" - AC_MSG_CHECKING([unsure]) + AC_MSG_RESULT([unsure]) ;; esac if test "$flint_know_strong_order" = "yes"; then - AC_DEFINE(FLINT_KNOW_STRONG_ORDER,1,[Define if system is strongly ordered])] + AC_DEFINE(FLINT_KNOW_STRONG_ORDER,1,[Define if system is strongly ordered]) fi ################################################################################ diff --git a/doc/source/fmpz_mpoly.rst b/doc/source/fmpz_mpoly.rst index 182c42aff0..f34e6551f4 100644 --- a/doc/source/fmpz_mpoly.rst +++ b/doc/source/fmpz_mpoly.rst @@ -777,15 +777,28 @@ Internal Functions .. function:: int fmpz_mpoly_divides_monagan_pearce(fmpz_mpoly_t poly1, const fmpz_mpoly_t poly2, const fmpz_mpoly_t poly3, const fmpz_mpoly_ctx_t ctx) + Set ``poly1`` to ``poly2`` divided by ``poly3`` and return 1 if the quotient + is exact. Otherwise return 0. The function uses the algorithm of Michael + Monagan and Roman Pearce. Note that the function + ``fmpz_mpoly_div_monagan_pearce`` below may be much faster if the quotient + is known to be exact. + .. function:: int fmpz_mpoly_divides_heap_threaded(fmpz_mpoly_t Q, const fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx) - Set ``poly1`` to ``poly2`` divided by ``poly3`` and return 1 if - the quotient is exact. Otherwise return 0. The function uses the algorithm - of Michael Monagan and Roman Pearce. Note that the function - ``fmpz_mpoly_div_monagan_pearce`` below may be much faster if the - quotient is known to be exact. + The same method as used as in :func:``fmpz_mpoly_divides_monagan_pearce``, + but is also multi-threaded. + +.. note:: + + This function is only defined if the machine is known to be strongly ordered + during the configuration. To check whether this function is defined during + compilation-time, use the C preprocessor macro + ``#ifdef fmpz_mpoly_divides_heap_threaded``. - The threaded version takes an upper limit on the number of threads to use, while the first version always uses one thread. + Note that, if the system is known to be strongly ordered, the underlying + algorithm for this function is utilized in :func:``fmpz_mpoly_divides``. + Hence, you may find it easier to use this function instead if the C + preprocessor is not available. .. function:: slong _fmpz_mpoly_div_monagan_pearce(fmpz ** polyq, ulong ** expq, slong * allocq, const fmpz * poly2, const ulong * exp2, slong len2, const fmpz * poly3, const ulong * exp3, slong len3, slong bits, slong N, const mp_limb_t * cmpmask) diff --git a/doc/source/nmod_mpoly.rst b/doc/source/nmod_mpoly.rst index 6cbcd9e9a0..80a3d994de 100644 --- a/doc/source/nmod_mpoly.rst +++ b/doc/source/nmod_mpoly.rst @@ -518,8 +518,21 @@ The division functions assume that the modulus is prime. .. function:: int nmod_mpoly_divides_heap_threaded(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx) - Do the operation of ``nmod_mpoly_divides`` using a heap and multiple threads. - This function should only be called once ``global_thread_pool`` has been initialized. + Do the operation of ``nmod_mpoly_divides`` using the heap and multiple + threads. This function should only be called once ``global_thread_pool`` has + been initialized. + +.. note:: + + This function is only defined if the machine is known to be strongly ordered + during the configuration. To check whether this function is defined during + compilation-time, use the C preprocessor macro + ``#ifdef nmod_mpoly_divides_heap_threaded``. + + Note that, if the system is known to be strongly ordered, the underlying + algorithm for this function is utilized in :func:``nmod_mpoly_divides``. + Hence, you may find it easier to use this function instead if the C + preprocessor is not available. Greatest Common Divisor diff --git a/src/fmpz_mpoly.h b/src/fmpz_mpoly.h index b7c9677915..191c44178a 100644 --- a/src/fmpz_mpoly.h +++ b/src/fmpz_mpoly.h @@ -770,12 +770,16 @@ int fmpz_mpoly_divides(fmpz_mpoly_t Q, int fmpz_mpoly_divides_monagan_pearce(fmpz_mpoly_t Q, const fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx); +#if FLINT_KNOW_STRONG_ORDER +#define fmpz_mpoly_divides_heap_threaded fmpz_mpoly_divides_heap_threaded int fmpz_mpoly_divides_heap_threaded(fmpz_mpoly_t Q, const fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx); +#define _fmpz_mpoly_divides_heap_threaded_pool _fmpz_mpoly_divides_heap_threaded_pool int _fmpz_mpoly_divides_heap_threaded_pool(fmpz_mpoly_t Q, const fmpz_mpoly_t A, const fmpz_mpoly_t B, const fmpz_mpoly_ctx_t ctx, const thread_pool_handle * handles, slong num_handles); +#endif slong _fmpz_mpoly_divides_array(fmpz ** poly1, ulong ** exp1, slong * alloc, const fmpz * poly2, const ulong * exp2, slong len2, diff --git a/src/fmpz_mpoly/divides.c b/src/fmpz_mpoly/divides.c index 168f34ed41..357f1b1a0d 100644 --- a/src/fmpz_mpoly/divides.c +++ b/src/fmpz_mpoly/divides.c @@ -9,9 +9,12 @@ (at your option) any later version. See . */ -#include "thread_support.h" #include "fmpz_mpoly.h" +#ifdef _fmpz_mpoly_divides_heap_threaded_pool + +#include "thread_support.h" + int fmpz_mpoly_divides( fmpz_mpoly_t Q, const fmpz_mpoly_t A, @@ -52,4 +55,24 @@ int fmpz_mpoly_divides( return divides; } +#else +int fmpz_mpoly_divides( + fmpz_mpoly_t Q, + const fmpz_mpoly_t A, + const fmpz_mpoly_t B, + const fmpz_mpoly_ctx_t ctx) +{ + if (B->length == 0) + { + flint_throw(FLINT_DIVZERO, "Divide by zero in fmpz_mpoly_divides"); + } + if (A->length == 0) + { + fmpz_mpoly_zero(Q, ctx); + return 1; + } + + return fmpz_mpoly_divides_monagan_pearce(Q, A, B, ctx); +} +#endif diff --git a/src/fmpz_mpoly/divides_heap_threaded.c b/src/fmpz_mpoly/divides_heap_threaded.c index aa10ce92ae..ef8b69613e 100644 --- a/src/fmpz_mpoly/divides_heap_threaded.c +++ b/src/fmpz_mpoly/divides_heap_threaded.c @@ -9,9 +9,12 @@ (at your option) any later version. See . */ +#include "fmpz_mpoly.h" + +#if FLINT_KNOW_STRONG_ORDER + #include "thread_support.h" #include "ulong_extras.h" -#include "fmpz_mpoly.h" /* a thread safe mpoly supports three mutating operations @@ -34,9 +37,9 @@ typedef struct _fmpz_mpoly_ts_struct typedef fmpz_mpoly_ts_struct fmpz_mpoly_ts_t[1]; /* Bcoeff is changed */ -void fmpz_mpoly_ts_init(fmpz_mpoly_ts_t A, - fmpz * Bcoeff, ulong * Bexp, slong Blen, - flint_bitcnt_t bits, slong N) +static void fmpz_mpoly_ts_init(fmpz_mpoly_ts_t A, + fmpz * Bcoeff, ulong * Bexp, slong Blen, + flint_bitcnt_t bits, slong N) { slong i; flint_bitcnt_t idx = FLINT_BIT_COUNT(Blen); @@ -61,7 +64,7 @@ void fmpz_mpoly_ts_init(fmpz_mpoly_ts_t A, } } -void fmpz_mpoly_ts_print(const fmpz_mpoly_ts_t B, const char ** x, +static void fmpz_mpoly_ts_print(const fmpz_mpoly_ts_t B, const char ** x, const fmpz_mpoly_ctx_t ctx) { fmpz_mpoly_t A; @@ -75,7 +78,7 @@ void fmpz_mpoly_ts_print(const fmpz_mpoly_ts_t B, const char ** x, fmpz_mpoly_assert_canonical(A, ctx); } -void fmpz_mpoly_ts_clear(fmpz_mpoly_ts_t A) +static void fmpz_mpoly_ts_clear(fmpz_mpoly_ts_t A) { slong i; @@ -95,7 +98,7 @@ void fmpz_mpoly_ts_clear(fmpz_mpoly_ts_t A) } } -void fmpz_mpoly_ts_clear_poly(fmpz_mpoly_t Q, fmpz_mpoly_ts_t A) +static void fmpz_mpoly_ts_clear_poly(fmpz_mpoly_t Q, fmpz_mpoly_ts_t A) { if (Q->alloc != 0) { @@ -126,7 +129,7 @@ void fmpz_mpoly_ts_clear_poly(fmpz_mpoly_t Q, fmpz_mpoly_ts_t A) /* put B on the end of A - Bcoeff is changed*/ -void fmpz_mpoly_ts_append(fmpz_mpoly_ts_t A, +static void fmpz_mpoly_ts_append(fmpz_mpoly_ts_t A, fmpz * Bcoeff, ulong * Bexps, slong Blen, slong N) { /* TODO: this needs barriers on non-x86 */ @@ -330,7 +333,7 @@ static void divides_heap_base_add_chunk(divides_heap_base_t H, divides_heap_chun saveD: 0 means we can modify coeffs of input D 1 means we must not modify coeffs of input D */ -slong _fmpz_mpoly_mulsub_stripe1(fmpz ** A_coeff, ulong ** A_exp, slong * A_alloc, +static slong _fmpz_mpoly_mulsub_stripe1(fmpz ** A_coeff, ulong ** A_exp, slong * A_alloc, const fmpz * Dcoeff, const ulong * Dexp, slong Dlen, int saveD, const fmpz * Bcoeff, const ulong * Bexp, slong Blen, const fmpz * Ccoeff, const ulong * Cexp, slong Clen, @@ -606,7 +609,7 @@ slong _fmpz_mpoly_mulsub_stripe1(fmpz ** A_coeff, ulong ** A_exp, slong * A_allo } -slong _fmpz_mpoly_mulsub_stripe(fmpz ** A_coeff, ulong ** A_exp, slong * A_alloc, +static slong _fmpz_mpoly_mulsub_stripe(fmpz ** A_coeff, ulong ** A_exp, slong * A_alloc, const fmpz * Dcoeff, const ulong * Dexp, slong Dlen, int saveD, const fmpz * Bcoeff, const ulong * Bexp, slong Blen, const fmpz * Ccoeff, const ulong * Cexp, slong Clen, @@ -911,7 +914,7 @@ slong _fmpz_mpoly_mulsub_stripe(fmpz ** A_coeff, ulong ** A_exp, slong * A_alloc Q = stripe of A/B (assume A != 0) return Qlen = 0 if exact division is impossible */ -slong _fmpz_mpoly_divides_stripe1( +static slong _fmpz_mpoly_divides_stripe1( fmpz ** Q_coeff, ulong ** Q_exp, slong * Q_alloc, const fmpz * Acoeff, const ulong * Aexp, slong Alen, const fmpz * Bcoeff, const ulong * Bexp, slong Blen, @@ -1248,7 +1251,7 @@ slong _fmpz_mpoly_divides_stripe1( goto cleanup; } -slong _fmpz_mpoly_divides_stripe( +static slong _fmpz_mpoly_divides_stripe( fmpz ** Q_coeff, ulong ** Q_exp, slong * Q_alloc, const fmpz * Acoeff, const ulong * Aexp, slong Alen, const fmpz * Bcoeff, const ulong * Bexp, slong Blen, @@ -1945,21 +1948,21 @@ static void worker_loop(void * varg) #if FLINT_USES_PTHREAD pthread_mutex_lock(&H->mutex); #endif - if (L->lock != -1) + if (L->lock != -1) { L->lock = -1; #if FLINT_USES_PTHREAD pthread_mutex_unlock(&H->mutex); #endif - trychunk(W, L); + trychunk(W, L); #if FLINT_USES_PTHREAD pthread_mutex_lock(&H->mutex); #endif - L->lock = 0; + L->lock = 0; #if FLINT_USES_PTHREAD pthread_mutex_unlock(&H->mutex); #endif - break; + break; } else { @@ -2004,10 +2007,6 @@ int _fmpz_mpoly_divides_heap_threaded_pool( divides_heap_base_t H; TMP_INIT; -#if !FLINT_KNOW_STRONG_ORDER - return fmpz_mpoly_divides_monagan_pearce(Q, A, B, ctx); -#endif - if (B->length < 2 || A->length < 2) { return fmpz_mpoly_divides_monagan_pearce(Q, A, B, ctx); @@ -2245,3 +2244,6 @@ int fmpz_mpoly_divides_heap_threaded( return divides; } +#else +typedef int this_file_is_empty; +#endif diff --git a/src/fmpz_mpoly/test/t-divides_heap_threaded.c b/src/fmpz_mpoly/test/t-divides_heap_threaded.c index 38bf4345b9..bace105f0b 100644 --- a/src/fmpz_mpoly/test/t-divides_heap_threaded.c +++ b/src/fmpz_mpoly/test/t-divides_heap_threaded.c @@ -12,6 +12,7 @@ #include "test_helpers.h" #include "fmpz_mpoly.h" +#if defined(fmpz_mpoly_divides_heap_threaded) TEST_FUNCTION_START(fmpz_mpoly_divides_heap_threaded, state) { int result, result2; @@ -417,3 +418,9 @@ TEST_FUNCTION_START(fmpz_mpoly_divides_heap_threaded, state) TEST_FUNCTION_END(state); } +#else +TEST_FUNCTION_START(fmpz_mpoly_divides_heap_threaded, state) +{ + TEST_FUNCTION_END_SKIPPED(state); +} +#endif diff --git a/src/nmod_mpoly.h b/src/nmod_mpoly.h index 2a8136e6eb..55fd32294e 100644 --- a/src/nmod_mpoly.h +++ b/src/nmod_mpoly.h @@ -917,12 +917,16 @@ int _nmod_mpoly_divides_threaded_pool(nmod_mpoly_t Q, int nmod_mpoly_divides_monagan_pearce(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx); +#if FLINT_KNOW_STRONG_ORDER +#define nmod_mpoly_divides_heap_threaded nmod_mpoly_divides_heap_threaded int nmod_mpoly_divides_heap_threaded(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx); +#define _nmod_mpoly_divides_heap_threaded_pool _nmod_mpoly_divides_heap_threaded_pool int _nmod_mpoly_divides_heap_threaded_pool(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx, const thread_pool_handle * handles, slong num_handles); +#endif int nmod_mpoly_divides_dense(nmod_mpoly_t Q, const nmod_mpoly_t A, const nmod_mpoly_t B, const nmod_mpoly_ctx_t ctx); @@ -1556,9 +1560,12 @@ void nmod_mpolyun_divexact_last(nmod_mpolyun_t A, n_poly_t b, int nmod_mpolyn_divides(nmod_mpolyn_t Q, const nmod_mpolyn_t A, const nmod_mpolyn_t B, const nmod_mpoly_ctx_t ctx); +#if FLINT_KNOW_STRONG_ORDER +#define nmod_mpolyn_divides_threaded_pool nmod_mpolyn_divides_threaded_pool int nmod_mpolyn_divides_threaded_pool(nmod_mpolyn_t Q, const nmod_mpolyn_t A, const nmod_mpolyn_t B, const nmod_mpoly_ctx_t ctx, const thread_pool_handle * handles, slong num_handles); +#endif int nmod_mpolyun_divides(nmod_mpolyun_t Q, const nmod_mpolyun_t A, const nmod_mpolyun_t B, const nmod_mpoly_ctx_t ctx); diff --git a/src/nmod_mpoly/divides.c b/src/nmod_mpoly/divides.c index 75e9f6e0bf..4605333250 100644 --- a/src/nmod_mpoly/divides.c +++ b/src/nmod_mpoly/divides.c @@ -133,6 +133,7 @@ int _nmod_mpoly_divides_threaded_pool( goto cleanup; } +#ifdef _nmod_mpoly_divides_heap_threaded_pool if (num_handles > 0) { divides = _nmod_mpoly_divides_heap_threaded_pool(Q, A, B, ctx, @@ -142,6 +143,9 @@ int _nmod_mpoly_divides_threaded_pool( { divides = nmod_mpoly_divides_monagan_pearce(Q, A, B, ctx); } +#else + divides = nmod_mpoly_divides_monagan_pearce(Q, A, B, ctx); +#endif cleanup: diff --git a/src/nmod_mpoly/divides_heap_threaded.c b/src/nmod_mpoly/divides_heap_threaded.c index db23c227f1..539c349b50 100644 --- a/src/nmod_mpoly/divides_heap_threaded.c +++ b/src/nmod_mpoly/divides_heap_threaded.c @@ -9,8 +9,11 @@ (at your option) any later version. See . */ -#include "thread_support.h" #include "nmod_mpoly.h" + +#if FLINT_KNOW_STRONG_ORDER + +#include "thread_support.h" #include "fmpz_mpoly.h" #define PROFILE_THIS 0 @@ -1710,10 +1713,6 @@ int _nmod_mpoly_divides_heap_threaded_pool( #endif TMP_INIT; -#if !FLINT_KNOW_STRONG_ORDER - return nmod_mpoly_divides_monagan_pearce(Q, A, B, ctx); -#endif - if (B->length < 2 || A->length < 2) { return nmod_mpoly_divides_monagan_pearce(Q, A, B, ctx); @@ -1967,3 +1966,6 @@ int nmod_mpoly_divides_heap_threaded( return divides; } +#else +typedef int this_file_is_empty; +#endif diff --git a/src/nmod_mpoly/gcd_brown.c b/src/nmod_mpoly/gcd_brown.c index aa7a8e0a8d..0c9c52160d 100644 --- a/src/nmod_mpoly/gcd_brown.c +++ b/src/nmod_mpoly/gcd_brown.c @@ -1163,10 +1163,15 @@ int nmod_mpolyn_gcd_brown_smprime_threaded_pool( { nmod_mpolyn_content_last(t1, G, ctx); nmod_mpolyn_divexact_last(G, t1, ctx); +#ifdef nmod_mpolyn_divides_threaded_pool success = nmod_mpolyn_divides_threaded_pool(T1, A, G, ctx, handles, num_handles); success = success && nmod_mpolyn_divides_threaded_pool(T2, B, G, ctx, handles, num_handles); +#else + success = nmod_mpolyn_divides(T1, A, G, ctx); + success = success && nmod_mpolyn_divides(T2, B, G, ctx); +#endif if (success) { ulong temp; @@ -1185,10 +1190,15 @@ int nmod_mpolyn_gcd_brown_smprime_threaded_pool( { nmod_mpolyn_content_last(t1, Abar, ctx); nmod_mpolyn_divexact_last(Abar, t1, ctx); +#ifdef nmod_mpolyn_divides_threaded_pool success = nmod_mpolyn_divides_threaded_pool(T1, A, Abar, ctx, handles, num_handles); success = success && nmod_mpolyn_divides_threaded_pool(T2, B, T1, ctx, handles, num_handles); +#else + success = nmod_mpolyn_divides(T1, A, Abar, ctx); + success = success && nmod_mpolyn_divides(T2, B, T1, ctx); +#endif if (success) { nmod_mpolyn_swap(T1, G); @@ -1200,10 +1210,15 @@ int nmod_mpolyn_gcd_brown_smprime_threaded_pool( { nmod_mpolyn_content_last(t1, Bbar, ctx); nmod_mpolyn_divexact_last(Bbar, t1, ctx); +#ifdef nmod_mpolyn_divides_threaded_pool success = nmod_mpolyn_divides_threaded_pool(T1, B, Bbar, ctx, handles, num_handles); success = success && nmod_mpolyn_divides_threaded_pool(T2, A, T1, ctx, handles, num_handles); +#else + success = nmod_mpolyn_divides(T1, B, Bbar, ctx); + success = success && nmod_mpolyn_divides(T2, A, T1, ctx); +#endif if (success) { nmod_mpolyn_swap(T1, G); diff --git a/src/nmod_mpoly/mpolyn_divides_threaded.c b/src/nmod_mpoly/mpolyn_divides_threaded.c index fba0bde2c1..9472e5978c 100644 --- a/src/nmod_mpoly/mpolyn_divides_threaded.c +++ b/src/nmod_mpoly/mpolyn_divides_threaded.c @@ -9,8 +9,11 @@ (at your option) any later version. See . */ -#include "thread_pool.h" #include "nmod_mpoly.h" + +#if FLINT_KNOW_STRONG_ORDER + +#include "thread_pool.h" #include "fmpz_mpoly.h" typedef struct _nmod_mpolyn_stripe_struct @@ -1735,10 +1738,6 @@ int nmod_mpolyn_divides_threaded_pool( FLINT_ASSERT(B->bits == bits); FLINT_ASSERT(Q->bits == bits); -#if !FLINT_KNOW_STRONG_ORDER - return nmod_mpolyn_divides(Q, A, B, ctx); -#endif - if (B->length < 2 || A->length < 2) { return nmod_mpolyn_divides(Q, A, B, ctx); @@ -1885,5 +1884,6 @@ int nmod_mpolyn_divides_threaded_pool( return divides; } - - +#else +typedef int this_file_is_empty; +#endif diff --git a/src/nmod_mpoly/test/main.c b/src/nmod_mpoly/test/main.c index 311c836cc3..290c7ae989 100644 --- a/src/nmod_mpoly/test/main.c +++ b/src/nmod_mpoly/test/main.c @@ -48,7 +48,7 @@ #include "t-get_term.c" #include "t-get_term_monomial.c" #include "t-inflate_deflate.c" -#include "t-mpolyn_divides_threaded.c" +#include "t-mpolyn_divides_threaded_pool.c" #include "t-mpolyuu_divides.c" #include "t-mul_array.c" #include "t-mul_array_threaded.c" @@ -111,7 +111,7 @@ test_struct tests[] = TEST_FUNCTION(nmod_mpoly_get_term), TEST_FUNCTION(nmod_mpoly_get_term_monomial), TEST_FUNCTION(nmod_mpoly_inflate_deflate), - TEST_FUNCTION(nmod_mpoly_mpolyn_divides_threaded), + TEST_FUNCTION(nmod_mpolyn_divides_threaded_pool), TEST_FUNCTION(nmod_mpoly_mpolyuu_divides), TEST_FUNCTION(nmod_mpoly_mul_array), TEST_FUNCTION(nmod_mpoly_mul_array_threaded), diff --git a/src/nmod_mpoly/test/t-divides_heap_threaded.c b/src/nmod_mpoly/test/t-divides_heap_threaded.c index c6af0f3034..86042b24ac 100644 --- a/src/nmod_mpoly/test/t-divides_heap_threaded.c +++ b/src/nmod_mpoly/test/t-divides_heap_threaded.c @@ -12,6 +12,7 @@ #include "test_helpers.h" #include "nmod_mpoly.h" +#if defined(nmod_mpoly_divides_heap_threaded) TEST_FUNCTION_START(nmod_mpoly_divides_heap_threaded, state) { int i, j, result, result2, max_threads = 5, tmul = 30; @@ -428,3 +429,9 @@ TEST_FUNCTION_START(nmod_mpoly_divides_heap_threaded, state) TEST_FUNCTION_END(state); } +#else +TEST_FUNCTION_START(nmod_mpoly_divides_heap_threaded, state) +{ + TEST_FUNCTION_END_SKIPPED(state); +} +#endif diff --git a/src/nmod_mpoly/test/t-mpolyn_divides_threaded.c b/src/nmod_mpoly/test/t-mpolyn_divides_threaded_pool.c similarity index 96% rename from src/nmod_mpoly/test/t-mpolyn_divides_threaded.c rename to src/nmod_mpoly/test/t-mpolyn_divides_threaded_pool.c index 48e2f66d5b..aac9c9fd4c 100644 --- a/src/nmod_mpoly/test/t-mpolyn_divides_threaded.c +++ b/src/nmod_mpoly/test/t-mpolyn_divides_threaded_pool.c @@ -13,6 +13,7 @@ #include "thread_support.h" #include "nmod_mpoly.h" +#if defined(nmod_mpolyn_divides_threaded_pool) void _divides_check( const nmod_mpoly_t A, const nmod_mpoly_t B, @@ -127,7 +128,7 @@ void _divides_check( flint_free(stride); } -TEST_FUNCTION_START(nmod_mpoly_mpolyn_divides_threaded, state) +TEST_FUNCTION_START(nmod_mpolyn_divides_threaded_pool, state) { slong i, j, max_threads = 5, tmul = 50; #ifdef _WIN32 @@ -223,3 +224,9 @@ TEST_FUNCTION_START(nmod_mpoly_mpolyn_divides_threaded, state) TEST_FUNCTION_END(state); } +#else +TEST_FUNCTION_START(nmod_mpolyn_divides_threaded_pool, state) +{ + TEST_FUNCTION_END_SKIPPED(state); +} +#endif