# Limiting number of jobs submitted at a time from an array

**URL:** <https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312>\
**Category:** Users/Site Administrators\
**Created:** [October 12, 2022, 1:38pm UTC](https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312 "2022-10-12T13:38:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samdcurtis](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@samdcurtis](https://community.openpbs.org/u/samdcurtis)\
**Post date:** [October 12, 2022, 1:38pm UTC](https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312/1 "2022-10-12T13:38:53Z")

</div>

When I submit an array to the cluster it will submit as many jobs as there are CPUs. How do I make it so that only a limited number of jobs from the array will submit at once?

Thank you!

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [October 12, 2022, 8:06pm UTC](https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312/2 "2022-10-12T20:06:28Z")

</div>

Please check the admin guide for “max\_run\_subjobs”  
8.4.1.1 Limiting Number of Simultaneously Running Subjobs

> **[PBS2022.1.pdf](https://help.altair.com/2022.1.0/PBS%20Professional/PBS2022.1.pdf)**
>
> 38.95 MB

---

<div class="post-metadata">

**Author:** ![samdcurtis](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@samdcurtis](https://community.openpbs.org/u/samdcurtis)\
**Post date:** [October 13, 2022, 12:12am UTC](https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312/3 "2022-10-13T00:12:19Z")

</div>

Thank you for the help!

When I use the commands as illustrated in the documentation I still run into issues:

In the documentation it says that an edit to the -J command should do the trick

This is what happens when i use #PBS -J 1-100%10

> qsub test.sh  
> qsub: illegal -J value

When I try to use qalter it doesnt understand either

> qalter -Wmax\_run\_subjobs=1000 1152.cluster  
> qalter: Undefined attribute 1152.cluster

And this is what happens when I set the atrributes as I submit

> qsub test.sh -J 1-100%10  
> usage: qsub [-a date\_time] [-A account\_string] [-c interval]  
> [-C directive\_prefix] [-e path] [-f] [-h] [-I [-X]] [-j oe|eo] [-J X-Y[:Z]]  
> [-k keep] [-l resource\_list] [-m mail\_options] [-M user\_list]  
> [-N jobname] [-o path] [-p priority] [-P project] [-q queue] [-r y|n]  
> [-R o|e|oe] [-S path] [-u user\_list] [-W otherattributes=value…]  
> [-S path] [-u user\_list] [-W otherattributes=value…]  
> [-v variable\_list] [-V] [-z] [script | – command [arg1 …]]  
> qsub --version

I am using I am using pbs\_version 20.0.1

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [October 13, 2022, 6:16pm UTC](https://community.openpbs.org/t/limiting-number-of-jobs-submitted-at-a-time-from-an-array/3312/4 "2022-10-13T18:16:21Z")

</div>

> [@samdcurtis](#):
>
> This is what happens when i use #PBS -J 1-100%10

Please type the command, attributes , values , it might have been the special characters that might have translated during copy paste.

> [@samdcurtis](#):
>
> I am using I am using pbs\_version 20.0.1

Alright, sorry this feature was implemented from 2021 onwards, so this is missing in 20.0.1  
You might need to upgrade to take advantage of this feature.
