Julia random segmentation failure

Could you report the output Threads.nthreads() before and after you set JULIA_NUM_THREADS?

Also reporting the full output of versioninfo() would be very useful to figure out who compiled or installed Julia for you or if there are any modifications that could be inferring with how Julia works. It could be that there is an error in how Julia was compiled or which libraries that Julia is loading.

If you are not running Julia in interactive mode, you might need to manually load InteractiveUtils.

using InteractiveUtils
versioninfo()

The easiest way to do this might be to start an interactive slurm job. Please see your cluster documentation for the best to do this.

Also if there is a simpler, self-contained script that uses Threads.@threads and also segfaults that would be a very useful minimum working example.