# What is the proper way to use torch distributed 2+ times on a single node?

**URL:** <https://discuss.pytorch.org/t/what-is-the-proper-way-to-use-torch-distributed-2-times-on-a-single-node/35726>\
**Category:** Uncategorized\
**Created:** [January 27, 2019, 8:59pm UTC](https://discuss.pytorch.org/t/what-is-the-proper-way-to-use-torch-distributed-2-times-on-a-single-node/35726 "2019-01-27T20:59:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdrozdov](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mrdrozdov/32/37_2.png) [@mrdrozdov](https://discuss.pytorch.org/u/mrdrozdov)\
**Post date:** [January 27, 2019, 8:59pm UTC](https://discuss.pytorch.org/t/what-is-the-proper-way-to-use-torch-distributed-2-times-on-a-single-node/35726/1 "2019-01-27T20:59:42Z")

</div>

Launching a job for DistributedDataParallel using torch.distributed.launch works fine on the first time. On the second time, I get `RuntimeError: Address already in use`.

I’ve tried modifying MASTER\_ADDR, but I get `RuntimeError: Connection timed out`. What is the proper way to make sure the distributed jobs do not collide?

---

<div class="post-metadata">

**Author:** ![mrdrozdov](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mrdrozdov/32/37_2.png) [@mrdrozdov](https://discuss.pytorch.org/u/mrdrozdov)\
**Post date:** [January 27, 2019, 9:24pm UTC](https://discuss.pytorch.org/t/what-is-the-proper-way-to-use-torch-distributed-2-times-on-a-single-node/35726/2 "2019-01-27T21:24:43Z")

</div>

Since localhost is okay, it turns out changing the port only (MASTER\_PORT) was sufficient.
