# PP-745 Single node jobs don't quote JSON formatted strings

**URL:** <https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541>\
**Category:** Developers\
**Created:** [May 15, 2017, 8:38am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541 "2017-05-15T08:38:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilip-krishnan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dilip-krishnan/32/75_2.png) [@dilip-krishnan](https://community.openpbs.org/u/dilip-krishnan)\
**Post date:** [May 15, 2017, 8:38am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/1 "2017-05-15T08:38:42Z")

</div>

While implementing PP-388, resource accumulation was introduced for multinode jobs. Wherein string type resources were merged if it is a valid json string and were reported in qstat -f and accounting logs within single quotes.

Ex. if momA returned ‘{ “a”:1, “b”:2 }’, momB returned ‘{ “c”:1 }’, and momC returned ‘{“d”:4}’ for resources\_used.foo\_str, then we get:

```
                              resources_used.foo_str='{"a": 1, "b": 2, "c":1,"d": 4}'

```

But in case of single node jobs, since there is no such accumulation required, json string resources were not reported within single quotes.

Ex. if mom returned { “a”:1, “b”:2 } for resources\_used.foo\_str, then we get:  
resources\_used.foo\_str={“a”: 1, “b”: 2, “c”:1,“d”: 4}

Hence PP-745 was created to make the above behaviour of single node job consistent with mutinodes job i.e to report json string within single quotes.

Please review [EDD](https://pbspro.atlassian.net/wiki/display/PD/PP-388%3A+Allow+mom+hooks+to+accumulate+resources_used+values) **Interface 2**

Regards  
Dililp

---

<div class="post-metadata">

**Author:** ![prakashcv13](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/prakashcv13/32/65_2.png) [@prakashcv13](https://community.openpbs.org/u/prakashcv13)\
**Post date:** [May 15, 2017, 9:43am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/2 "2017-05-15T09:43:43Z")

</div>

Hi Dilip,

I have one question w.r.t non-JSON string. As per the example I get an impression that the accounting logs will have double quotes enclosing the value. Is it so? OR the double quotes are part of the value and so we have the double quotes in the accounting logs.

Rest of the changes look good to me.

Thanks,  
Prakash

---

<div class="post-metadata">

**Author:** ![Klovely](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/klovely/32/117_2.png) [@Klovely](https://community.openpbs.org/u/Klovely)\
**Post date:** [May 15, 2017, 9:54am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/3 "2017-05-15T09:54:56Z")

</div>

Hi Dilip ,

One correction is needed in example given in interface 2,  
believe it should be  
resources\_used.foo\_str=’{“a”: 1, “b”: 2}'  
instead of  
resources\_used.foo\_str={“a”: 1, “b”: 2, “c”:1,“d”: 4}

Regards,  
Lovely

---

<div class="post-metadata">

**Author:** ![dilip-krishnan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dilip-krishnan/32/75_2.png) [@dilip-krishnan](https://community.openpbs.org/u/dilip-krishnan)\
**Post date:** [May 15, 2017, 10:27am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/4 "2017-05-15T10:27:46Z")

</div>

Hi Prakash & Lovely,  
[quote=“prakashcv13, post:2, topic:541”]  
As per the example I get an impression that the accounting logs will have double quotes enclosing the value. Is it so? OR the double quotes are part of the value and so we have the double quotes in the accounting logs.  
[/quote]

Ans. It is part of the string.

> [@Klovely](#):
>
> One correction is needed in example given in interface 2,

Ans. Done

---

<div class="post-metadata">

**Author:** ![prakashcv13](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/prakashcv13/32/65_2.png) [@prakashcv13](https://community.openpbs.org/u/prakashcv13)\
**Post date:** [May 16, 2017, 8:35am UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/5 "2017-05-16T08:35:01Z")

</div>

Dilip,

The EDD looks good to me.

Thanks,  
Prakash

---

<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 18, 2017, 3:44pm UTC](https://community.openpbs.org/t/pp-745-single-node-jobs-dont-quote-json-formatted-strings/541/6 "2017-05-18T15:44:47Z")

</div>

The EDD looks good to me as well! Thanks for looking into this issue.
