# "connection refused (ECONNREFUSED)" when trying to mpirun julia on multiple nodes

**URL:** https://discourse.julialang.org/t/connection-refused-econnrefused-when-trying-to-mpirun-julia-on-multiple-nodes/78253
**Category:** General Usage
**Tags:** question, mpi, distributed, pmap
**Created:** [March 22, 2022, 5:20am UTC](https://discourse.julialang.org/t/connection-refused-econnrefused-when-trying-to-mpirun-julia-on-multiple-nodes/78253 "2022-03-22T05:20:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![knkn1711](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/knkn1711/32/21970_2.png) [@knkn1711](https://discourse.julialang.org/u/knkn1711)
#### Post date: [March 22, 2022, 5:20am UTC](https://discourse.julialang.org/t/connection-refused-econnrefused-when-trying-to-mpirun-julia-on-multiple-nodes/78253/1 "2022-03-22T05:20:00Z")

</div>

I am trying to run my julia code on multiple nodes of a cluster, which uses Moab and Torque for the scheduler and resource manager. In an interactive session I run the following:

```julia
qsub -A open -l walltime=1:00:00 -l nodes=4:ppn=3 -I
module purge
module use /gpfs/group/dml129/default/sw/modules
module load openmpi
module load julia
export UCX_TLS=all
mpirun -np 12 --hostfile $PBS_NODEFILE -x PATH -x LD_LIBRARY_PATH -display-allocation julia --project=. "estimation/test/test.jl" TCP

```

However, I get the following error:

```julia
--------------------------------------------------------------------------
ERROR: ERROR: ERROR: LoadError: LoadError: LoadError: IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:IOError: connect: connection refused (ECONNREFUSED)

```

It seems each node is returning an `ECONNREFUSED` error.  
What could be done to fix this issue?

Just in case, my test julia code is as follows, and uses the `MPIClusterManagers.jl`:

```julia
using MPIClusterManagers, Distributed
import MPI 
manager = MPIClusterManagers.start_main_loop(TCP_TRANSPORT_ALL)

@everywhere function plusone(x)
    sleep(10)
    return x + 1
end

@time pmap(plusone, 1:6)

MPIClusterManagers.stop_main_loop(manager)
exit()

```

---

<div class="post-metadata">

### Author: ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)
#### Post date: [March 22, 2022, 6:37am UTC](https://discourse.julialang.org/t/connection-refused-econnrefused-when-trying-to-mpirun-julia-on-multiple-nodes/78253/2 "2022-03-22T06:37:23Z")

</div>

It’s possible that your cluster doesn’t allow TCP transport. You may have to use MPI for transport. Have you tried using `MPI_TRANSPORT_ALL` in `start_main_loop`?

---

<div class="post-metadata">

### Author: ![knkn1711](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/knkn1711/32/21970_2.png) [@knkn1711](https://discourse.julialang.org/u/knkn1711)
#### Post date: [March 22, 2022, 5:54pm UTC](https://discourse.julialang.org/t/connection-refused-econnrefused-when-trying-to-mpirun-julia-on-multiple-nodes/78253/3 "2022-03-22T17:54:50Z")

</div>

Ah, I don’t know why I was trying to use TCP. Sorry for the silly mistake. I tried out your suggestion and it worked out perfectly. Thank you very much!
