Passing ARGS to multiple workers

I am trying to pass an argument from the terminal to a program that uses multiple cores. But ARGS appear to be visible only on the first worker. How can I push ARGS to all workers?
For example, suppose test.jl contains

using Distributed
addprocs(1)
@everywhere model=ARGS[1]
println(model)

When I run in the terminal
julia test.jl Hello

worker 2 does not see ARGS variable and Julia throws an error.

As described in the manual, @everywhere does not capture variables, so you need to interpolate them:

@everywhere model=$(ARGS[1])
1 Like

It works. Thanks a lot.