# How do I get the --nproc\_per\_node=32 value from my python script?

**URL:** <https://discuss.pytorch.org/t/how-do-i-get-the-nproc-per-node-32-value-from-my-python-script/143407>\
**Category:** Uncategorized\
**Created:** [February 6, 2022, 4:26pm UTC](https://discuss.pytorch.org/t/how-do-i-get-the-nproc-per-node-32-value-from-my-python-script/143407 "2022-02-06T16:26:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brando\_Miranda](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/brando_miranda/32/14355_2.png) [@Brando\_Miranda](https://discuss.pytorch.org/u/Brando_Miranda)\
**Post date:** [February 6, 2022, 4:26pm UTC](https://discuss.pytorch.org/t/how-do-i-get-the-nproc-per-node-32-value-from-my-python-script/143407/1 "2022-02-06T16:26:48Z")

</div>

How do I get the flag within my python script that I am passing to `torchrun` ? I want to set the number `--nproc_per_node=32` I am passing there automatically rather than making sure the two scripts match (note I want to set the world size myself e.g. I am using cpu parallel jobs and want to choose that value myself thus)

related: [Multiprocessing failed with Torch.distributed.launch module - #28 by Brando\_Miranda](https://discuss.pytorch.org/t/multiprocessing-failed-with-torch-distributed-launch-module/33056/28)
