How to run a file/script in the Linux terminal (Ubuntu) assigning multi-threading?

Hi Folks,

Could anybody guide me, please?

How to run a file/script in the Linux terminal (Ubuntu) assigning multi-threading? If in the first line of the script I use #!/path/of/bin/julia it works without multi-threading. However, when I tried to use multi-threading by modifying that line as #!/path/of/bin/julia --threads 4 it does not work.

Thank you so much in advance

Cheers

Boris

What do you mean by “it does not work”? What happens if you do this:

[nils@nils-folio1040g1 ~]$ julia --threads 4
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.1 (2021-04-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> Threads.nthreads()
4
1 Like

I think the issue is with the shebang. Take a Look here

2 Likes

Thank you for your answer @nilshg