I am trying to figure out how to use/write hooks to interface with PBSpro.
Before I start PBS-integration, I would like to see that I can actually use the pbs library. So, initially, I simply write a python script, which use the pbs module as per:
try: import pbs except: print "Failed to import pbs"
I have encountered a few issues so far.
a. The admin guide (v13, AG-647) mention that the modules should be in PBS_EXEC/python and PBS_EXEC/lib/python. In my case, /opt/pbs/python does not exist.
b. If I add “/opt/pbs/lib/python” to the python path (append to sys.path - or modify PYTHONPATH, then
results in a compile-time error
ImportError: No module named pbs
From the tree structure of /opt/pbs/lib it appears that a new dir level “altair” has been introduced
[root]# find /opt/pbs/lib -type d /opt/pbs/lib /opt/pbs/lib/MPI /opt/pbs/lib/init.d /opt/pbs/lib/python /opt/pbs/lib/python/altair /opt/pbs/lib/python/altair/pbs /opt/pbs/lib/python/altair/pbs/v1 /opt/pbs/lib/python/altair/pbs_hooks
So, if I add “/opt/pbs/python/altair” to the python path, then I should be able to access the module(?)
However, although the pbs module is found in this case, the script still fails at the use statement - now with the error:
[bjb@bifrost1 PythonTest]$ ./test_pbspy.py Traceback (most recent call last): File "./test_pbspy.py", line 10, in <module> import pbs File "/opt/pbs/lib/python/altair/pbs/__init__.py", line 43, in <module> from _pbs_v1 import * ImportError: No module named _pbs_v1
I am not sure what I am doing wrong. But it must be something really basic.
If somebody could point me in the right direction, then I’ll be grateful.
I have installed pbspro v 14.1 on CentOS72 - compiled to rpms locally, with a few changes to the spec file, as mentioned in a previous thread CentOS7 install issues