@@ -24,6 +24,7 @@ At the moment the underlying algorithm is based on variants of Faugère's F4 Alg
2424- `complete_reduction::Bool=true`: compute a reduced Gröbner basis for `I`.
2525- `normalize::Bool=false`: normalize generators of Gröbner basis for `I`, only applicable when working over the rationals.
2626- `truncate_lifting::Int=0`: truncates the lifting process to given number of elements, only applicable when working over the rationals.
27+ - `worker_pool::Union{Nothing,AbstractWorkerPool}=nothing`: run the Gröbner basis computation on a worker from the given pool, if not `nothing`.
2728- `info_level::Int=0`: info level printout: off (`0`, default), summary (`1`), detailed (`2`).
2829
2930# Examples
@@ -52,6 +53,7 @@ function eliminate(
5253 complete_reduction:: Bool = true ,
5354 normalize:: Bool = false ,
5455 truncate_lifting:: Int = 0 ,
56+ worker_pool:: Union{Nothing,AbstractWorkerPool} = nothing ,
5557 info_level:: Int = 0
5658 )
5759 if eliminate <= 0
@@ -63,6 +65,7 @@ function eliminate(
6365 complete_reduction= complete_reduction,
6466 normalize = normalize,
6567 truncate_lifting = truncate_lifting,
68+ worker_pool = worker_pool,
6669 info_level= info_level)
6770 end
6871end
@@ -86,6 +89,7 @@ At the moment the underlying algorithm is based on variants of Faugère's F4 Alg
8689- `complete_reduction::Bool=true`: compute a reduced Gröbner basis for `I`.
8790- `normalize::Bool=false`: normalize generators of Gröbner basis for `I`, only applicable when working over the rationals.
8891- `truncate_lifting::Int=0`: truncates the lifting process to given number of elements, only applicable when working over the rationals.
92+ - `worker_pool::Union{Nothing,AbstractWorkerPool}=nothing`: if not `nothing`, run the core Gröbner-basis array computation on a worker from this pool.
8993- `info_level::Int=0`: info level printout: off (`0`, default), summary (`1`), detailed (`2`).
9094
9195# Examples
@@ -121,6 +125,7 @@ function groebner_basis(
121125 complete_reduction:: Bool = true ,
122126 normalize:: Bool = false ,
123127 truncate_lifting:: Int = 0 ,
128+ worker_pool:: Union{Nothing,AbstractWorkerPool} = nothing ,
124129 info_level:: Int = 0
125130 )
126131 return get! (I. gb, eliminate) do
@@ -130,6 +135,7 @@ function groebner_basis(
130135 complete_reduction = complete_reduction,
131136 normalize = normalize,
132137 truncate_lifting = truncate_lifting,
138+ worker_pool = worker_pool,
133139 info_level = info_level)
134140 end
135141end
@@ -235,6 +241,7 @@ function _core_groebner_basis(
235241 complete_reduction:: Bool = true ,
236242 normalize:: Bool = false ,
237243 truncate_lifting:: Int = 0 ,
244+ worker_pool:: Union{Nothing,AbstractWorkerPool} = nothing ,
238245 info_level:: Int = 0
239246 )
240247 F = I. gens
@@ -272,13 +279,19 @@ function _core_groebner_basis(
272279 return I. gb[eliminate]
273280 end
274281
275- jl_len, jl_cf, jl_exp = _core_groebner_basis_array (
282+ run_core_array = () -> _core_groebner_basis_array (
276283 lens, cfs, exps, field_char;
277284 initial_hts= initial_hts, nr_thrds= nr_thrds,
278285 max_nr_pairs= max_nr_pairs, la_option= la_option, eliminate= eliminate,
279286 complete_reduction= complete_reduction, truncate_lifting= truncate_lifting,
280287 info_level= info_level)
281288
289+ jl_len, jl_cf, jl_exp = if isnothing (worker_pool)
290+ run_core_array ()
291+ else
292+ remotecall_fetch (run_core_array, worker_pool)
293+ end
294+
282295 jl_ld = Int32 (length (jl_len))
283296 nr_terms = length (jl_exp) ÷ nr_vars
284297
0 commit comments