Tasks and remote procedures
Julia has several packages that support parallel computing. These include modules for programming GPUs via CUDA and OpenCL, together with OpenMP, Spark, and MPI, which I will introduce briefly in the next chapter. With certain packages for tackling machine learning, such as Flex and Turing, processing on the GPU can also be done transparently in the presence of a GPU, otherwise defaulting to the CPU.
While Julia can be used with MPI, the natural model of communication in Julia is based on one-sided communication based on threads, tasks, futures, and channels.
The Julia distributed computing model is based on distributing tasks and arrays to a pool of workers. Workers are either Julia processes running on the current host or other hosts in your cluster.
Tasks
In Julia, a task, also termed a co-routine, is a function that must be callable with no parameters. When first created, it is marked as runnable but is not executed until it’s scheduled...