Depending on your cluster setup, one of the solutions with a minimum working example here should work. Please note that MPI_TRANSPORT_ALL will give you one less than the number of mpi nodes requested, i.e., mpirun -np 5 julia myfile.jl
will give you 4 workers.