You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Call elements of vector arguments by their name.
@@ -464,23 +480,33 @@ end
464
480
465
481
struct Multithreaded end
466
482
"""
467
-
SpawnFetch{ParallelType}(exprs, reduce)
483
+
SpawnFetch{ParallelType}(funcs [, args], reduce)
468
484
469
-
Run every expr in `exprs` in its own task, and use the `reduce`
470
-
function to combine the results of executing `exprs`.
485
+
Run every expression in `funcs` in its own task, the expression
486
+
should be a `Func` object and is passed to `Threads.Task(f)`.
487
+
If `Func` takes arguments, then the arguments must be passed in as `args`--a vector of vector of arguments to each function in `funcs`. We don't use `@spawn` in order to support RuntimeGeneratedFunctions which disallow closures, instead we interpolate these functions or closures as smaller RuntimeGeneratedFunctions.
488
+
489
+
`reduce` function is used to combine the results of executing `exprs`. A SpawnFetch expression returns the reduced result.
490
+
491
+
492
+
Use `Symbolics.MultithreadedForm` ParallelType from the Symbolics.jl package to get the RuntimeGeneratedFunction version SpawnFetch.
471
493
472
494
`ParallelType` can be used to define more parallelism types
473
495
SymbolicUtils supports `Multithreaded` type. Which spawns
474
496
threaded tasks.
475
497
"""
476
498
struct SpawnFetch{Typ}
477
499
exprs::Vector
500
+
args::Union{Nothing, Vector}
478
501
combine
479
502
end
480
503
504
+
(::Type{SpawnFetch{T}})(exprs, combine) where {T} =SpawnFetch{T}(exprs, nothing, combine)
0 commit comments