# Stop job with when using more cpus than it request

**URL:** <https://community.openpbs.org/t/stop-job-with-when-using-more-cpus-than-it-request/927>\
**Category:** Users/Site Administrators\
**Created:** [March 29, 2018, 7:16am UTC](https://community.openpbs.org/t/stop-job-with-when-using-more-cpus-than-it-request/927 "2018-03-29T07:16:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![f-fathurrahman](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@f-fathurrahman](https://community.openpbs.org/u/f-fathurrahman)\
**Post date:** [March 29, 2018, 7:16am UTC](https://community.openpbs.org/t/stop-job-with-when-using-more-cpus-than-it-request/927/1 "2018-03-29T07:16:35Z")

</div>

Dear PBS community,

First, I am sorry if this question has been asked before.

I am a new user of PBS Pro who is being tasked to manage a cluster.

I have some problem when a job tries to use more than `ncpus` than it requests such as in the  
following job script:

```bash
#!/bin/bash
#PBS -q longnormal
#PBS -l select=1:ncpus=20

cd $PBS_O_WORKDIR
mpirun -n 40 ./a.out

```

This job will result in one node (each node have max 20 cores) having load about 4000 percent, although `resources_used.cpupercent` is only showing 2000 percent.  
Probably this can be avoided by using wrapper to `mpirun` which I have seen somewhere during my experience as user in some HPC facilities several years ago (then I was only user, not an admin).

I want to know whether there are any solutions to avoid this (by using hooks or other alternatives).

Thank you very much in advance.

Regards,  
Fadjar

PS:

I am using PBSPro\_13.0.0.151487

---

<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:** [March 29, 2018, 7:50am UTC](https://community.openpbs.org/t/stop-job-with-when-using-more-cpus-than-it-request/927/2 "2018-03-29T07:50:49Z")

</div>

MoM calculates an integer value called cpupercent each polling cycle

1. Cgroups hook can be used to limit cpu usage
  - [https://pbspro.atlassian.net/wiki/spaces/PD/pages/11599882/PP-325+Support+Cgroups](https://pbspro.atlassian.net/wiki/spaces/PD/pages/11599882/PP-325+Support+Cgroups)
  - [https://github.com/PBSPro/pbspro/tree/master/src/hooks/cgroups](https://github.com/PBSPro/pbspro/tree/master/src/hooks/cgroups)

2. server periodic hook and mom periodic hook would be useful here to check the mischievous jobs
3. wrapper scripts (as you already thought about) would be useful, so that request is managed
4. Educating the users ( online help, documentation, FAQ’s )

Please check these sections from the PBS Pro administration guide: ---- [https://pbsworks.com/pdfs/PBSAdminGuide14.2.pdf](https://pbsworks.com/pdfs/PBSAdminGuide14.2.pdf)  
5.14.3.5.ii CPU Burst Usage Enforcement  
3.6.1 Configuring MoM Polling Cycle

Thank you

---

<div class="post-metadata">

**Author:** ![f-fathurrahman](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@f-fathurrahman](https://community.openpbs.org/u/f-fathurrahman)\
**Post date:** [March 29, 2018, 8:02am UTC](https://community.openpbs.org/t/stop-job-with-when-using-more-cpus-than-it-request/927/3 "2018-03-29T08:02:17Z")

</div>

Dear Adarsh

Thank you very much for your quick reply.

Thank you very much for pointing about CPU burst in the manual.  
I will read and study it.

Best regards,

Fadjar
