How to query the number of available cores to your job

I should have noticed this, your cluster is not running PBS Pro OSS but it is running torque.
Please use the above snippet and search on google.

Refer these discussions: