MIDACO Parallelization in Julia (Multi-Threading)

 

Running MIDACO in serial and parallel on a cpu-time expensive objective function.

 

 

example_parallel.jl

 

 

Serial Mode (P=1) Parallel Mode (P=2) Parallel Mode (P=4)
     
Total Time: 29 Seconds Total Time: 14 Seconds Total Time: 8 Seconds
 Original: x1 Speed Up:  ~x2  Speed Up:  ~x4 

 

 The results can be reproduced with the limited MIDACO version (available here). 

 

To enable multi-threading in Julia, the following command:

 export JULIA_NUM_THREADS=2   ( Mac & Linux shell )

 set JULIA_NUM_THREADS=2   ( Windows shell )

must be executed before starting Julia. The parallelization

example will auto-detect the number of threads ( Line 115 ):

option["parallel"] = Threads.nthreads()

 

 Note: Using parallelization in Julia can affect MIDACO's random generator.

 

Any problems running MIDACO? Please click here or contact us.