Julia Multithreading (Threads.@threads) and Travis CI

Hi all,

in a number of packages I started experimenting with code that exploits Julia’s multithreading facilities, i.e. mainly the Threads.@threads macro. I am a bit confused as to how to enable automatic testing of my code using Travis CI, in particular, to enable multithreading on Travis, but also to test both with and without multithreading (i.e. once with Threads.nthreads() == 1 and once with Threads.nthreads()>1). Is anybody aware of an example travis.yml configuration file that I could look into?

Thanks,

Jutho

How about setting the environment variable like this? (untested)

env:
  matrix:
    - JULIA_NUM_THREADS=1
    - JULIA_NUM_THREADS=2

see: https://docs.travis-ci.com/user/environment-variables/

3 Likes

Thanks, works perfectly!