# \#floops

**URL:** https://discourse.julialang.org/tag/floops/764.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Floops multithreading HasBoxedVariableError](https://discourse.julialang.org/t/floops-multithreading-hasboxedvariableerror/127139)

<div class="topic-metadata">

**Author:** [@s\_amap](https://discourse.julialang.org/u/s_amap)\
**Replies:** 7\
**Last updated:** [March 19, 2025, 3:54pm UTC](https://discourse.julialang.org/t/floops-multithreading-hasboxedvariableerror/127139 "2025-03-19T15:54:34Z")

</div>

I’ve been trying to adjust a parallel loop after some changes, and I need some clarification to make sure I’m not at risk of false sharing. The loop conceptually works like this: object # holds a state, which is a tupl…

---

## [FoldsCUDA not working with simple reduction](https://discourse.julialang.org/t/foldscuda-not-working-with-simple-reduction/101917)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 1\
**Last updated:** [July 22, 2023, 7:58am UTC](https://discourse.julialang.org/t/foldscuda-not-working-with-simple-reduction/101917 "2023-07-22T07:58:52Z")

</div>

I was trying to find the largest error between two matrix columns and I wanted to try parallelizing it on the GPU: using FLoops using CUDA using FoldsCUDA #To loop through all column pairs allpairs(v) = ((i,j) for j in…

---

## [Julia multithreading is running slower than serial, can someone please explain why…? General Usage Performance multithreading floops](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why-general-usage-performance-multithreading-floops/96657)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 17\
**Last updated:** [March 31, 2023, 10:30am UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why-general-usage-performance-multithreading-floops/96657 "2023-03-31T10:30:46Z")

</div>

Dear Julia community this is my third post after my previous post1, post2. I was unable to replicate my problem in my previous posts. Here, I am going to share my entire algorithm. Please let me know what the problem is…

---

## [Julia multithreading is running slower than serial, can someone please explain why…?](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/96545)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 14\
**Last updated:** [March 24, 2023, 10:03pm UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/96545 "2023-03-24T22:03:49Z")

</div>

I am trying to parallelize an algorithm which looks like this. I couldn’t express my code right in my previous post The following algorithm takes an element from an odd column and adds it to the adjacent even coloumn. u…

---

## [Julia multithreading is running slower than serial, can someone please explain why...?](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 15\
**Last updated:** [March 3, 2023, 8:07am UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430 "2023-03-03T08:07:32Z")

</div>

I am trying to parallelize an algorithm which looks like this I initialized a vector of vectors(50000\*1000), in the loop I shifted a random element from an odd-numbered vector into an adjacent even vector at a random pl…

---

## [FLoops @init allocate only once](https://discourse.julialang.org/t/floops-init-allocate-only-once/93500)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 13\
**Last updated:** [January 25, 2023, 6:34pm UTC](https://discourse.julialang.org/t/floops-init-allocate-only-once/93500 "2023-01-25T18:34:54Z")

</div>

Hi, Does anyone know if there are any tricks to using FLoops thread-safe buffers for better performance? I am trying to adapt my code which makes use of Buffers such as Buffers\[Threads.threadid()\] to the recommended app…

---

## [Comparing Folds/FLoop Executors](https://discourse.julialang.org/t/comparing-folds-floop-executors/91649)

<div class="topic-metadata">

**Author:** [@markowkes](https://discourse.julialang.org/u/markowkes)\
**Replies:** 0\
**Last updated:** [December 14, 2022, 5:16pm UTC](https://discourse.julialang.org/t/comparing-folds-floop-executors/91649 "2022-12-14T17:16:53Z")

</div>

I wrote the following code to test the various executors profited by Floops.jl and FoldsThreads.jl to distribute work between multiple threads. The code creates work (of various sizes) and distributes this work amongst …

---

## [Assigning values in threaded nested for-loop](https://discourse.julialang.org/t/assigning-values-in-threaded-nested-for-loop/90762)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 6\
**Last updated:** [November 25, 2022, 6:15pm UTC](https://discourse.julialang.org/t/assigning-values-in-threaded-nested-for-loop/90762 "2022-11-25T18:15:54Z")

</div>

I have some code which looks like this: Threads.@threads for branch in tree Threads.@threads for twig in branch append!(biglist, dostuff.(twig)) end end where tree is a vector (tree) of vectors (branch)…

---

## [Break statement in foldscuda/floops is giving error](https://discourse.julialang.org/t/break-statement-in-foldscuda-floops-is-giving-error/89864)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 4\
**Last updated:** [November 11, 2022, 10:23am UTC](https://discourse.julialang.org/t/break-statement-in-foldscuda-floops-is-giving-error/89864 "2022-11-11T10:23:15Z")

</div>

Hi everyone, I am trying to use Floops, and FoldsCuda library as an alternative to OpenACC in Cuda c++, and Fortran in Julia. Consider the following code using Random, CUDA, FLoops, Test, FoldsCUDA function main() …

---

## [Can't add Floops.jl](https://discourse.julialang.org/t/cant-add-floops-jl/89566)

<div class="topic-metadata">

**Author:** [@Mouad](https://discourse.julialang.org/u/Mouad)\
**Replies:** 3\
**Last updated:** [October 31, 2022, 2:56pm UTC](https://discourse.julialang.org/t/cant-add-floops-jl/89566 "2022-10-31T14:56:40Z")

</div>

Hello, I am trying to paralleize something but I can’t add Floops. pkg\> add Floops.jl ERROR: The following package names could not be resolved: \* Floops (not found in project, manifest or registry) I deleted the regi…

---

## [Problem converting serial code to parallel code with FLoops](https://discourse.julialang.org/t/problem-converting-serial-code-to-parallel-code-with-floops/87610)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 9\
**Last updated:** [October 3, 2022, 9:52pm UTC](https://discourse.julialang.org/t/problem-converting-serial-code-to-parallel-code-with-floops/87610 "2022-10-03T21:52:55Z")

</div>

I have the following code which loops over some indices and adds values to two separate parts of an array. using FLoops, Random function update\_u!(du, u, k, q, j) v = \[k, (k + 1) % length(u) + 1, (k + 7) % length(u…

---

## [FLoops for updating a vector by index](https://discourse.julialang.org/t/floops-for-updating-a-vector-by-index/87186)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 7\
**Last updated:** [September 13, 2022, 6:03am UTC](https://discourse.julialang.org/t/floops-for-updating-a-vector-by-index/87186 "2022-09-13T06:03:40Z")

</div>

I want to make the following function parallel. function build\_vector\_explicit(du, elements) for k ∈ elements du\[k\] += sin(k) end return nothing end This function takes in a vector du (not necessari…

---

## [FLoops causing deep copy error with log message in loop](https://discourse.julialang.org/t/floops-causing-deep-copy-error-with-log-message-in-loop/86683)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 0\
**Last updated:** [September 2, 2022, 10:52am UTC](https://discourse.julialang.org/t/floops-causing-deep-copy-error-with-log-message-in-loop/86683 "2022-09-02T10:52:46Z")

</div>

Having a log message inside an @floop gives a deep copy error. Is this expected behaviour? julia\> using FLoops julia\> @floop for \_ in 1:24 @info Threads.threadid() sleep(1) end ERROR: LoadEr…

---

## [Transducers/FLoops equivalent for mapreduce with dims arg (on GPU)](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 9\
**Last updated:** [May 12, 2022, 7:41pm UTC](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767 "2022-05-12T19:41:30Z")

</div>

Hi all, Is it possible to write an equivalent of mapreduce(; dims) using either Transducers or FLoops? I’m interested in the NVidia GPU context. I want to do something like: julia\> begin using CUDA, LazyArrays …

---

## [Multithreading using FLoops for updating discrete distribution](https://discourse.julialang.org/t/multithreading-using-floops-for-updating-discrete-distribution/71176)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 11\
**Last updated:** [November 16, 2021, 10:46pm UTC](https://discourse.julialang.org/t/multithreading-using-floops-for-updating-discrete-distribution/71176 "2021-11-16T22:46:39Z")

</div>

I’m working on a heterogeneous agent macroeconomics model. One of the steps in the solution method for the model is to update the (discrete) wealth distribution across agents. The model is quite big so I need to multi…

---

## [Reducing GC time in loop using FLoops.jl](https://discourse.julialang.org/t/reducing-gc-time-in-loop-using-floops-jl/66534)

<div class="topic-metadata">

**Author:** [@beeswax](https://discourse.julialang.org/u/beeswax)\
**Replies:** 2\
**Last updated:** [August 17, 2021, 4:14pm UTC](https://discourse.julialang.org/t/reducing-gc-time-in-loop-using-floops-jl/66534 "2021-08-17T16:14:25Z")

</div>

I’m trying to speed up the runtime of a back-projection image formation algorithm for SAR and want to see how far things can be pushed for the naive version using parallel computing and the speed of Julia (I’m aware that…
