# Modify Place Group in a hook

**URL:** <https://community.openpbs.org/t/modify-place-group-in-a-hook/3199>\
**Category:** Users/Site Administrators\
**Created:** [July 11, 2022, 8:44am UTC](https://community.openpbs.org/t/modify-place-group-in-a-hook/3199 "2022-07-11T08:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![israel.casas.84](https://avatars.discourse-cdn.com/v4/letter/i/aca169/32.png) [@israel.casas.84](https://community.openpbs.org/u/israel.casas.84)\
**Post date:** [July 11, 2022, 8:44am UTC](https://community.openpbs.org/t/modify-place-group-in-a-hook/3199/1 "2022-07-11T08:44:30Z")

</div>

Im trying to modify placement groups in a hook as indicated in 6.13.3.20 Plugins (Hooks) Guide (2021.1.3) but I get an error.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/d64a55d288b8ab0914e2275c5187470b5d584ff4.png)

Here some background:

I do this using qsub as:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/da8bf3040ee9c96b19579be4001e4cd68280c4d8.png)

As the resource **two** is already a declared resource, submiting the job produce no error. I can also see the details of this submission as I have the current hook with with debug=True:

# cat /var/spool/pbs/server\_priv/hooks/tmp/hook\_queuejob\_correct\_queue\_1657526372.in

pbs.event().job.Submit\_arguments=jsdl-hpcpa:Argument-lplace=group=two\</jsdl-hpcpa:Argument\>jsdl-hpcpa:Argument-lselect=ncpus=1\</jsdl-hpcpa:Argument\>jsdl-hpcpa:Argumentjob.sh\</jsdl-hpcpa:Argument\>  
**pbs.event().job.Resource\_List[place]=group=two**  
pbs.event().job.Resource\_List[select]=ncpus=1  
pbs.event().job.Job\_Name=job.sh  
pbs.event().job.Resource\_List[walltime]=00:00:20  
pbs.event().job.Mail\_Points=abe  
pbs.event().job.Mail\_Users=israel@intersect.org.au  
pbs.event().job.Checkpoint=u  
pbs.event().job.Hold\_Types=n  
pbs.event().job.Join\_Path=n  
pbs.event().job.Keep\_Files=n  
pbs.event().job.Priority=0  
pbs.event().job.Rerunable=TRUE  
pbs.event().job.Variable\_List=PBS\_O\_HOME=/home/ec2-user,PBS\_O\_LANG=en\_AU.UTF-8,PBS\_O\_LOGNAME=ec2-user,PBS\_O\_PATH=/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/pbs/bin,PBS\_O\_MAIL=/var/spool/mail/ec2-user,PBS\_O\_SHELL=/bin/bash,PBS\_O\_WORKDIR=/home/ec2-user,PBS\_O\_SYSTEM=Linux  
pbs.event().job.queue=israel\_queue  
pbs.get\_local\_nodename()=israel-operations.novalocal  
pbs.event().type=queuejob  
pbs.event().hook\_name=correct\_queue  
pbs.event().hook\_type=site  
pbs.event().requestor=ec2-user  
pbs.event().requestor\_host=localhost  
pbs.event().user=pbsadmin  
pbs.event().alarm=30

The main question is, modifying that resource in a hook should be something as (according to that section 6.13.3.20 from Plugins (Hooks) Guide (2021.1.3)):

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/0fb9f800e1c40e4d36c5f2714998d74f09bc26aa.png)  
but I get  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/147360bff0b8e2a58b36ea35e72e669374179d07.png)

If in the other way, I simply use the same wording as in guide:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/974bc9d0c9b32143a4767d188565197441fcd838.png)  
I get  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/d8ba96b22b017e552e0e23728225a134964b96f8.png)

Am I missing something? We simply would like to give specific **resource** values for pl=pbs.place(“group= **resource** ”) such as “two” or other resources we already have.

As always your feedback is so appreciated it.

---

<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:** [July 11, 2022, 8:05pm UTC](https://community.openpbs.org/t/modify-place-group-in-a-hook/3199/2 "2022-07-11T20:05:33Z")

</div>

Can you please try the below syntax:

```auto
#job.Resource_List["place"] = pbs.place("[arrangement]:[sharing]:[group]")

example:
jobB = pbs.event().job
jobB.Resource_List["place"] = pbs.place("pack:exclhost")

Ref: 5.2.5.1 How to Set select and place in Hooks
PBS Professional 2021.1.3 Hooks Guide HG-63

```

---

<div class="post-metadata">

**Author:** ![israel.casas.84](https://avatars.discourse-cdn.com/v4/letter/i/aca169/32.png) [@israel.casas.84](https://community.openpbs.org/u/israel.casas.84)\
**Post date:** [July 13, 2022, 5:01am UTC](https://community.openpbs.org/t/modify-place-group-in-a-hook/3199/3 "2022-07-13T05:01:15Z")

</div>

Thank you Adarsh,

This guided me to the solution. The reason of my confussion was due to I was using debug files that were missing the particular resource I was using. This was solve by simply running the hook and submit jobs.

Much appreciate your quick reply on this.
