# How to set number of nodes?

**URL:** <https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120>\
**Category:** Get Help\
**Created:** [September 15, 2020, 1:41pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120 "2020-09-15T13:41:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatthieuQueru](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MatthieuQueru](https://discourse.openondemand.org/u/MatthieuQueru)\
**Post date:** [September 15, 2020, 1:41pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/1 "2020-09-15T13:41:40Z")

</div>

The question is in the title thanks you ^^

---

<div class="post-metadata">

**Author:** ![alanc](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/alanc/32/2524_2.png) [@alanc](https://discourse.openondemand.org/u/alanc)\
**Post date:** [September 15, 2020, 1:56pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/2 "2020-09-15T13:56:09Z")

</div>

Matthieu: Can you give us a bit more info as to what you are looking for specifically? Are you trying to set the number of nodes in one of the existing interactive apps? In the job composer? In a new app you are developing? As a starting point, you might want to look at this page in the documentation about modifying form attributes: [https://osc.github.io/ood-documentation/latest/enable-desktops/modify-form-attributes.html](https://osc.github.io/ood-documentation/latest/enable-desktops/modify-form-attributes.html)

---

<div class="post-metadata">

**Author:** ![MatthieuQueru](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MatthieuQueru](https://discourse.openondemand.org/u/MatthieuQueru)\
**Post date:** [September 16, 2020, 8:10am UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/3 "2020-09-16T08:10:55Z")

</div>

i want to put a option on the jobs composer page for choose the number of node for the user, exemple if the user want 3 nodes for a job. And ty for the documentation, I had already read it.

---

<div class="post-metadata">

**Author:** ![alanc](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/alanc/32/2524_2.png) [@alanc](https://discourse.openondemand.org/u/alanc)\
**Post date:** [September 16, 2020, 3:55pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/4 "2020-09-16T15:55:38Z")

</div>

While it’s not impossible to do, that’s going to be rather complicated. The main reason is that the job composer inherently lets the user edit the submit script of the job, which is where you indicate the number of nodes to use. So if you had some sort of input box for number of nodes (which then somehow ‘injected’ the correct line into the script when you hit submit), if the user also edited the submit script directly as shown on the screen, the 2 inputs would be out of sync and you wouldn’t know which to utilize.

Perhaps a better approach would just be to add some comments to the template or fields that tell the user to directly edit the submit script and update the nodes directive in order to change the number of nodes?

---

<div class="post-metadata">

**Author:** ![MatthieuQueru](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MatthieuQueru](https://discourse.openondemand.org/u/MatthieuQueru)\
**Post date:** [September 17, 2020, 12:22pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/5 "2020-09-17T12:22:54Z")

</div>

I would like to understand how the script is generated to be able to put a variable to contain the desired number of nodes.

---

<div class="post-metadata">

**Author:** ![alanc](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/alanc/32/2524_2.png) [@alanc](https://discourse.openondemand.org/u/alanc)\
**Post date:** [September 17, 2020, 12:49pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/6 "2020-09-17T12:49:28Z")

</div>

We don’t have anything that already does that for job composer, but we do for various interactive apps, which should give you a bit of sense as to how you could accomplish it. I recommend looking at one of our example interactive apps, such as the ANSYS one, in github:[https://github.com/OSC/bc\_osc\_ansys\_workbench](https://github.com/OSC/bc_osc_ansys_workbench)  
In particular, check out the form.yml and submit.yml.erb to see how we populate the form and then translate that into a submission script.

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:43pm UTC](https://discourse.openondemand.org/t/how-to-set-number-of-nodes/1120/7 "2022-05-26T15:43:07Z")

</div>

Closed on May 26, 2022, 3:43pm UTC


