An advanced built-in feature of Julia is to use parallel processing in your script. Normally, you can specify the number of processes that you want to use directly in Julia. However, under Jupyter, you would use the addprocs()
function to add an additional process available for use in your script, for example, look at this small script:
addprocs(1) srand(111) r = remotecall(rand, 2, 3, 4) s = @spawnat 2 1 .+ fetch(r) fetch(s)
It makes a call to rand
, the random number generator, with that code executing on the second parameter to the function call (process 2
), and then passes the remaining arguments to therand
function there (making rand generate a 3×4 matrix of random numbers). spawnat
is a macro that evaluates the processes mentioned previously. Then, fetch
accesses the result of the spawned processes.
We can see the results in the example under Jupyter, as shown in the following screenshot:
So, this is not a dramatic spawned process type of calculation, but...