# Select no of cores without nodes and ppn

**URL:** <https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408>\
**Category:** Users/Site Administrators\
**Created:** [January 19, 2019, 1:56pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408 "2019-01-19T13:56:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ans](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Ans](https://community.openpbs.org/u/Ans)\
**Post date:** [January 19, 2019, 1:56pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/1 "2019-01-19T13:56:12Z")

</div>

Hi all,

i want to select only the no of cores to be used instead of both the ppn and node.

Can anyone let me know how can i change the parameters in my job submission script.

Thanks,  
ANS

---

<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:** [January 19, 2019, 6:00pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/2 "2019-01-19T18:00:45Z")

</div>

The below statement can be used to submit jobs requesting only number of cores, but number of chunks would depend on the default\_chunks set at the server level.  
qsub -l ncpus=10 – /bin/sleep 10 # this would be scheduled on to a node which has 10 free cores.

The PBS Pro OSS , qsub chunk request system is as below (ppn and nodes are no more used )

qsub -l select=\<number\_of\_chunks\>:ncpus=:mem\<memory\_per\_chunk\> -l place=

Please check the below section from the [https://www.pbsworks.com/pdfs/PBS18.2.3\_BigBook.pdf](https://www.pbsworks.com/pdfs/PBS18.2.3_BigBook.pdf)  
5.4.8 Platform-specific vs. Generally Available Resources

---

<div class="post-metadata">

**Author:** ![Ans](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Ans](https://community.openpbs.org/u/Ans)\
**Post date:** [January 22, 2019, 4:03pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/3 "2019-01-22T16:03:29Z")

</div>

Hi Adarsh,

Thank you for the reply.

I have used the below script  
#!/bin/bash  
#PBS -N test  
#PBS -S /bin/bash  
#PBS -q workq  
#$#PBS -l nodes=2:ppn=5  
#PBS -l select=1:ncpus=10  
#PBS -j oe  
cd $PBS\_O\_WORKDIR  
NP=`cat $PBS_NODEFILE | wc -l`  
mpirun -np ${NP} gmx\_mpi mdrun -v -s md.tpr

But the job is being executed on single core.  
After changing select=2 also still it is running only on 1 core.

Can you help me out.

Thanks,  
ANS

---

<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:** [January 22, 2019, 6:32pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/4 "2019-01-22T18:32:24Z")

</div>

ANS,

Please use the below script

#!/bin/bash  
#PBS -N test  
#PBS -S /bin/bash  
#PBS -q workq  
#PBS -l select=2:ncpus=5  
#PBS -l place=scatter  
#PBS -j oe  
cd $PBS\_O\_WORKDIR  
NP= `cat PBS\_NODEFILE | wc -l\` mpirun -np {NP} gmx\_mpi mdrun -v -s md.tpr

Note:

1. mpirun path is set or same across the compute nodes
2. the above script is run from a shared location accessible by all the nodes and the user running this script
3. Please use absolute path in the script , unless there are no more than one flavour of mpirun (Intel/OpenMPI/Platformmpi)
4. it the mpi is not integrated with PBS (compiling the mpi with PBS TM from source, then you might have use -hostfile or -machinefile pointing to $PBS\_NODEFILE in the batch command line

Thank you

---

<div class="post-metadata">

**Author:** ![Ans](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Ans](https://community.openpbs.org/u/Ans)\
**Post date:** [January 23, 2019, 5:48am UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/5 "2019-01-23T05:48:10Z")

</div>

Thank you.

But again we are mentioning the nodes and cpus in different way here.  
select=2:ncpus=5 instead of nodes=2:ppn=5

But i require to mention only no of cores, some thing similar to SGE script where we will mention only the no of core.

Thanks,  
ANS

---

<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:** [January 23, 2019, 8:54pm UTC](https://community.openpbs.org/t/select-no-of-cores-without-nodes-and-ppn/1408/6 "2019-01-23T20:54:28Z")

</div>

Ans,

PBS syntax has been select/ncpus/mem (if i remember correctly since PBS Pro 11.x)  
You can submit job as below

`qsub -l ncpus=10 -- /bin/sleep`

But the number of chunks (select bit) would be used from the server attribute default\_chunk.ncpus. So you would be always requesting one chunk.

On the other hand:

- you can write a queuejob hook that will convert the requested ncpus into select/ncpus/mem statement  
say you request  
`qsub -l ncpus=120 -- /bin/sleep 100`  
The queuejob hook will compose the select statement (based on some logic)  
`qsub -l select=6:ncpus=20 -- /bin/sleep 100`

**Correction:** (Thank you @agurban for this information)  
PBS converts old-style resource requests to select and place statements.  
See the 18.2 UG, section 4.8.3, "Conversion of Old Style to New", on page UG-70.

> **[PBSUserGuide18.2.3.pdf](https://www.pbsworks.com/pdfs/PBSUserGuide18.2.3.pdf)**
>
> 3.73 MB
