# How to specific odd total cpu counts for a job?

**URL:** <https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136>\
**Category:** Users/Site Administrators\
**Created:** [May 26, 2020, 5:56am UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136 "2020-05-26T05:56:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wjx](https://avatars.discourse-cdn.com/v4/letter/w/cab0a1/32.png) [@wjx](https://community.openpbs.org/u/wjx)\
**Post date:** [May 26, 2020, 5:56am UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136/1 "2020-05-26T05:56:01Z")

</div>

Hi!

If there is a job that needs **13** cpu cores in total, how do I write job submit script? Assume there are 12 cores per node.

Can I do this using followng 2 lines?

```auto
#PBS select=1:ppn=12
#PBS select=1:ppn=1

mpirun -np 13 xxxx

```

---

<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:** [May 26, 2020, 6:50am UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136/2 "2020-05-26T06:50:51Z")

</div>

Please try this

```
#PBS -l select=1:ncpus=12:mpiprocs=12+1:ncpus=1:mpiprocs=1
#PBS -l place=scatter
mpirun -np 13 xxxx

```

Thank you

---

<div class="post-metadata">

**Author:** ![wjx](https://avatars.discourse-cdn.com/v4/letter/w/cab0a1/32.png) [@wjx](https://community.openpbs.org/u/wjx)\
**Post date:** [May 26, 2020, 11:52am UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136/3 "2020-05-26T11:52:28Z")

</div>

> [@adarsh](#):
>
> `mpiprocs`

You saved my life!!!

---

<div class="post-metadata">

**Author:** ![wjx](https://avatars.discourse-cdn.com/v4/letter/w/cab0a1/32.png) [@wjx](https://community.openpbs.org/u/wjx)\
**Post date:** [May 26, 2020, 11:57am UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136/4 "2020-05-26T11:57:52Z")

</div>

Thank you! You saved my life!

---

<div class="post-metadata">

**Author:** ![smgoosen](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@smgoosen](https://community.openpbs.org/u/smgoosen)\
**Post date:** [May 27, 2020, 8:18pm UTC](https://community.openpbs.org/t/how-to-specific-odd-total-cpu-counts-for-a-job/2136/5 "2020-05-27T20:18:56Z")

</div>

Or, if it’s a small job, i.e. you mention only 13 cores (if the job gets large it does take longer to schedule more chunks, for example 576:ncpus=1 takes longer than 48:ncpus=12), and since it doesn’t seem to matter if the job consumes an entire node (you’re grabbing 1 core from a separate node anyway thus assuming one core per MPI process), though by default PBS will try to get as many cores as possible from each node, you could do something like:

#PBS -l select=13:ncpus=1  
#PBS -l place=free  
mpirun -np 13 xxxx

Note that PBS defaults to 1 mpiproc/“chunk with ncpus” if there is no specific mpiproc value specified for the chunk, so including :mpiprocs=1 is optional in this case
