All Projects → JuliaFolds → Floops.jl

JuliaFolds / Floops.jl

Licence: mit
Fast sequential, threaded, and distributed for-loops for Julia—fold for humans™

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Floops.jl

Transducers.jl
Efficient transducers for Julia
Stars: ✭ 226 (+135.42%)
Mutual labels:  parallel, distributed-computing, high-performance
data-parallelism
juliafolds.github.io/data-parallelism/
Stars: ✭ 22 (-77.08%)
Mutual labels:  high-performance, parallel, distributed-computing
ParallelUtilities.jl
Fast and easy parallel mapreduce on HPC clusters
Stars: ✭ 28 (-70.83%)
Mutual labels:  parallel, distributed-computing
FoldsCUDA.jl
Data-parallelism on CUDA using Transducers.jl and for loops (FLoops.jl)
Stars: ✭ 48 (-50%)
Mutual labels:  high-performance, parallel
future.batchtools
🚀 R package future.batchtools: A Future API for Parallel and Distributed Processing using batchtools
Stars: ✭ 77 (-19.79%)
Mutual labels:  parallel, distributed-computing
Threadsx.jl
Parallelized Base functions
Stars: ✭ 126 (+31.25%)
Mutual labels:  parallel, high-performance
Future.apply
🚀 R package: future.apply - Apply Function to Elements in Parallel using Futures
Stars: ✭ 159 (+65.63%)
Mutual labels:  parallel, distributed-computing
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (-42.71%)
Mutual labels:  high-performance, parallel
Easylambda
distributed dataflows with functional list operations for data processing with C++14
Stars: ✭ 475 (+394.79%)
Mutual labels:  parallel, distributed-computing
MultiHttp
This is a high performance , very useful multi-curl tool written in php. 一个超级好用的并发CURL工具!!!(httpful,restful, concurrency)
Stars: ✭ 79 (-17.71%)
Mutual labels:  high-performance, parallel
Highs
Linear optimization software
Stars: ✭ 107 (+11.46%)
Mutual labels:  parallel, high-performance
Lizardfs
LizardFS is an Open Source Distributed File System licensed under GPLv3.
Stars: ✭ 793 (+726.04%)
Mutual labels:  distributed-computing, high-performance
zmq
ZeroMQ based distributed patterns
Stars: ✭ 27 (-71.87%)
Mutual labels:  parallel, distributed-computing
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (-81.25%)
Mutual labels:  high-performance, parallel
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+707.29%)
Mutual labels:  distributed-computing, high-performance
Pwrake
Parallel Workflow extension for Rake, runs on multicores, clusters, clouds.
Stars: ✭ 57 (-40.62%)
Mutual labels:  parallel, distributed-computing
Rsf
已作为 Hasor 的子项目,迁移到:http://git.oschina.net/zycgit/hasor
Stars: ✭ 77 (-19.79%)
Mutual labels:  high-performance
Redrun
✨🐌 🐎✨ fastest npm scripts runner
Stars: ✭ 85 (-11.46%)
Mutual labels:  parallel
Delta
Programming language focused on performance and productivity
Stars: ✭ 77 (-19.79%)
Mutual labels:  high-performance
Paraspec
Parallel RSpec test runner
Stars: ✭ 77 (-19.79%)
Mutual labels:  parallel

FLoops: fold for humans™

Dev GitHub Actions

FLoops.jl provides a macro @floop. It can be used to generate a fast generic sequential and parallel iteration over complex collections.

Furthermore, the loop written in @floop can be executed with any compatible executors. See FoldsThreads.jl for various thread-based executors that are optimized for different kinds of loops. FoldsCUDA.jl provides an executor for GPU. FLoops.jl also provide a simple distributed executor.

Usage

Sequential (single-thread) loops

Simply wrap a for loop and its initialization part by @floop:

julia> using FLoops  # exports @floop macro

julia> @floop begin
           s = 0
           for x in 1:3
               s += x
           end
       end
       s
6

For more examples, see sequential loops tutorial.

Parallel loop

@floop is a superset of [email protected] (see below) and in particular supports complex reduction with additional syntax @reduce:

julia> @floop for (x, y) in zip(1:3, 1:2:6)
           a = x + y
           b = x - y
           @reduce(s += a, t += b)
       end
       (s, t)
(15, -3)

For more examples, see parallel loops tutorial.

Advantages over [email protected]

@floop is a superset of [email protected] and has a couple of advantages:

  • @floop supports various input collection types including arrays, dicts, sets, strings, and many iterators from Base.Iterators such as zip and product. More precisely, @floop can generate high-performance parallel iterations for any collections that supports SplittablesBase.jl interface.
  • With FoldsThreads.NondeterministicEx, @floop can even parallelize iterations over non-parallelizable input collections (although it is beneficial only for heavier workload).
  • FoldsThreads.jl provides multiple alternative thread-based executors (= loop execution backend) that can be used to tune the performance without touching the loop itself.
  • FoldsCUDA.jl provides a simple GPU executor.
  • @reduce syntax for supporting complex reduction in a forward-compatible manner
    • Note: threadid-based reduction (that is commonly used in conjunction with @threads) may not be forward-compatible to Julia that supports migrating tasks across threads.
  • There is a trick for "changing" the effective number of threads without restarting julia using the basesize option.

The relative disadvantages may be that @floop is much newer than [email protected] and has much more flexible internals. These points can contribute to undiscovered bugs.

How it works

@floop works by converting the native Julia for loop syntax to foldl defined by Transducers.jl. Unlike foldl defined in Base, foldl defined by Transducers.jl is powerful enough to cover the for loop semantics and more.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].