Modify

Opened 9 years ago

Closed 9 years ago

#47 closed enhancement (fixed)

Torque 5.0.x Support

Reported by: pcarey Owned by: bas
Priority: major Milestone:
Component: pbs Version: 4.4.0
Keywords: Cc:

Description

We are using torque 5.0.0, so I downloaded the latest stable pbs_python version (4.4.0). I am having problems with the make portion of pbs_python (4.4.0) with torque (5.0.0).

-bash-3.2$ ./configure checking for pbs-config... /usr/local/torque/5.0.0/bin/pbs-config Found torque version: 5.0.0 checking for python... /usr/bin/python checking for python version... 2.4 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.4/site-packages checking for python extension module directory... ${exec_prefix}/lib64/python2.4/site-packages configure: creating ./config.status config.status: creating Makefile config.status: WARNING: 'Makefile.in' seems to ignore the --datarootdir setting config.status: creating setup.py

-bash-3.2$ make #(cd src; make) python setup.py build running build running build_py creating build creating build/lib.linux-x86_64-2.4 copying src/pbs.py -> build/lib.linux-x86_64-2.4 copying src/PBSQuery.py -> build/lib.linux-x86_64-2.4 running build_ext building '_pbs' extension creating build/temp.linux-x86_64-2.4 creating build/temp.linux-x86_64-2.4/src creating build/temp.linux-x86_64-2.4/src/C++ g++ -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -I/usr/local/torque/5.0.0/include -fPIC -DTORQUE_4 -I/usr/include/python2.4 -c src/C++/pbs_wrap.cxx -o build/temp.linux-x86_64-2.4/src/C++/pbs_wrap.o In file included from src/C++/pbs_ifl.h:90,

from src/C++/pbs_wrap.cxx:2978:

/usr/local/torque/5.0.0/include/u_hash_map_structs.h:82:25: error: container.hpp: No such file or directory In file included from src/C++/pbs_wrap.cxx:2978: src/C++/pbs_ifl.h:91:22: error: u_memmgr.h: No such file or directory /usr/local/torque/5.0.0/include/u_hash_map_structs.h:105: error: ‘string’ in namespace ‘std’ does not name a type /usr/local/torque/5.0.0/include/u_hash_map_structs.h:106: error: ‘string’ in namespace ‘std’ does not name a type /usr/local/torque/5.0.0/include/u_hash_map_structs.h: In constructor ‘job_data::job_data(const char*, const char*, int, int)’: /usr/local/torque/5.0.0/include/u_hash_map_structs.h:115: error: ‘name’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:116: error: ‘value’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h: At global scope: /usr/local/torque/5.0.0/include/u_hash_map_structs.h:120: error: ‘container’ has not been declared /usr/local/torque/5.0.0/include/u_hash_map_structs.h:120: error: expected initializer before ‘<’ token /usr/local/torque/5.0.0/include/u_hash_map_structs.h:121: error: ‘job_data_container’ has not been declared /usr/local/torque/5.0.0/include/u_hash_map_structs.h:121: error: expected initializer before ‘job_data_iterator’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: expected primary-expression before ‘int’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: expected primary-expression before ‘int’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:123: error: initializer expression list treated as compound expression /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: variable or field ‘hash_add_or_exit’ declared void /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: expected primary-expression before ‘int’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:125: error: initializer expression list treated as compound expression /usr/local/torque/5.0.0/include/u_hash_map_structs.h:127: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:127: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:127: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:127: error: initializer expression list treated as compound expression /usr/local/torque/5.0.0/include/u_hash_map_structs.h:129: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:129: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: expected primary-expression before ‘const’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: expected primary-expression before ‘*’ token /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: ‘env_var’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:131: error: initializer expression list treated as compound expression /usr/local/torque/5.0.0/include/u_hash_map_structs.h:133: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:133: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:135: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:135: error: ‘head’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: ‘dest’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: ‘src’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: expected primary-expression before ‘int’ /usr/local/torque/5.0.0/include/u_hash_map_structs.h:137: error: initializer expression list treated as compound expression /usr/local/torque/5.0.0/include/u_hash_map_structs.h:139: error: ‘job_data_container’ was not declared in this scope /usr/local/torque/5.0.0/include/u_hash_map_structs.h:139: error: ‘src’ was not declared in this scope src/C++/pbs_ifl.h:658: error: ‘memmgr’ has not been declared src/C++/pbs_wrap.cxx: In function ‘PyObject?* _wrap_pbs_submit_hash(PyObject?*, PyObject?*)’: src/C++/pbs_wrap.cxx:7178: error: ‘memmgr’ was not declared in this scope src/C++/pbs_wrap.cxx:7178: error: ‘arg2’ was not declared in this scope src/C++/pbs_wrap.cxx:7178: error: expected primary-expression before ‘)’ token src/C++/pbs_wrap.cxx:7178: error: expected `;' before numeric constant src/C++/pbs_wrap.cxx:7228: error: expected primary-expression before ‘)’ token src/C++/pbs_wrap.cxx: At global scope: src/C++/pbs_wrap.cxx:893: warning: ‘long int PyNumber_AsSsize_t(PyObject?*, void*)’ defined but not used error: command 'g++' failed with exit status 1 make: * [pythonlib] Error 1

As a sanity check I built pbs_python (4.4.0) against an older version of torque (4.2.7), and the build succeeds. Has anyone tested the newest stable pbs_python against torque version 5.0.x? I know that the 5.0.x torque series is new.

Thank you.

Attachments (2)

torque_v5.0.diff (19.8 KB) - added by anonymous 9 years ago.
Svn Patch file to update https://oss.trac.surfsara.nl/pbs_python/svn/devel to torque version 5.0.0 (not backwards compatible with torque version 2.4.7)
PBSQuery_torque5_ranges.patch (17.4 KB) - added by stijn.deweirdt@… 9 years ago.

Download all attachments as: .zip

Change History (27)

comment:1 Changed 9 years ago by bas

  • Status changed from new to assigned

We are still on 2.5 branch and did some porting for the 4.X version. we do not use torque 5.0 yet. So I can not test it, but can you try this pbs_python version:

comment:2 Changed 9 years ago by anonymous

Thank you for the suggestion.

I checked out the devel version and edited C++/makeit to reflect my python and torque paths: diff -u makeit makeit.new

 --- makeit	2014-11-17 09:45:28.000000000 -0500
 +++ makeit.new	2014-11-17 09:46:39.000000000 -0500
 @@ -7,5 +7,5 @@
  swig -v -python -shadow pbs.i

  #g++  -fPIC -DDEBUG -I/usr/include/python2.7 -c pbs_wrap.cxx -o pbs_wrap.o
 -g++  -fPIC -DDEBUG -I/usr/include/python2.7 -c pbs_wrap.c -o pbs_wrap.o
 -g++ --shared pbs_wrap.o -o _pbs.so -L/usr/local/lib -ltorque
 +g++  -fPIC -DDEBUG -I/usr/include/python2.4 -c pbs_wrap.c -o pbs_wrap.o
 +g++ --shared pbs_wrap.o -o _pbs.so -L/usr/local/torque/5.0.0/lib -ltorque

And I saw the same errors during compilation:

+ swig -v -python -shadow pbs.i
 LibDir: python
    ./
    /usr/share/swig/1.3.29/python/
    ./swig_lib/python/
    /usr/share/swig/1.3.29/config/
    ./swig_lib/config/
    /usr/share/swig/1.3.29/
    ./swig_lib/
 Preprocessing...
 Starting language-specific parse...
 Processing types...
 C++ analysis...
 Generating wrappers...
 log.h:157: Warning(454): Setting a pointer/reference variable may leak memory.
 + g++ -fPIC -DDEBUG -I/usr/include/python2.4 -c pbs_wrap.c -o pbs_wrap.o
 In file included from pbs_wrap.c:2486:
 pbs_ifl.h:90:32: error: u_hash_map_structs.h: No such file or directory
 pbs_ifl.h:91:22: error: u_memmgr.h: No such file or directory
 In file included from pbs_wrap.c:2487:
 pbs_error.h:88:27: error: pbs_constants.h: No such file or directory
 pbs_error.h:98:26: error: pbs_error_db.h: No such file or directory
 pbs_ifl.h:658: error: ‘memmgr’ has not been declared
 pbs_ifl.h:658: error: ‘job_data’ has not been declared
 pbs_ifl.h:658: error: ‘job_data’ has not been declared
 pbs_wrap.c: In function ‘PyObject* _wrap_pbs_submit_hash(PyObject*, PyObject*)’:
 pbs_wrap.c:6685: error: ‘memmgr’ was not declared in this scope
 pbs_wrap.c:6685: error: ‘arg2’ was not declared in this scope 
 pbs_wrap.c:6685: error: expected primary-expression before ‘)’ token
 pbs_wrap.c:6685: error: expected `;' before numeric constant
 pbs_wrap.c:6686: error: ‘job_data’ was not declared in this scope
 pbs_wrap.c:6686: error: ‘arg3’ was not declared in this scope 
 pbs_wrap.c:6686: error: expected primary-expression before ‘)’ token
 pbs_wrap.c:6686: error: expected `;' before numeric constant
 pbs_wrap.c:6687: error: ‘arg4’ was not declared in this scope 
 pbs_wrap.c:6687: error: expected primary-expression before ‘)’ token
 pbs_wrap.c:6687: error: expected `;' before numeric constant
 pbs_wrap.c:6735: error: expected primary-expression before ‘)’ token
 pbs_wrap.c:6740: error: expected primary-expression before ‘)’ token
 pbs_wrap.c:6745: error: expected primary-expression before ‘)’ token
 + g++ --shared pbs_wrap.o -o _pbs.so -L/usr/local/torque/5.0.0/lib -ltorque
 g++: pbs_wrap.o: No such file or directory

It seems that pbs_ifl.h was updated for torque 5.0. I ended up replacing pbs_ifl.h and pbs_error.h and adding pbs_error_db.h, which resulted in a successful build. This fixed the pbs python bindings work with torque version (5.0.0), but it now no longer works with torque (4.2.7); errors are below.

In [1]: from PBSQuery import PBSQuery
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-0d958a6ea8a2> in <module>()
----> 1 from PBSQuery import PBSQuery

/usr/lib64/python2.6/site-packages/pbs/PBSQuery.py in <module>()
     59     nodes = p.getnodes(l)
     60 """
---> 61 import pbs
     62 import UserDict
     63 import string

/tmp/pbs_python_new/C++/pbs.py in <module>()
     23                 fp.close()
     24             return _mod
---> 25     _pbs = swig_import_helper()
     26     del swig_import_helper
     27 else:

/tmp/pbs_python_new/C++/pbs.py in swig_import_helper()
     19         if fp is not None:
     20             try:
---> 21                 _mod = imp.load_module('_pbs', fp, pathname, description)
     22             finally:
     23                 fp.close()

ImportError: ./_pbs.so: undefined symbol: pbs_submit_hash_ext

comment:3 Changed 9 years ago by bas

Ok we must make another directory for torque 5.0 with updated header filea and so. And leave the current C++ directory for 4.X versions.

comment:4 Changed 9 years ago by anonymous

This might be a stupid question, but I can't seem to find PBSQuery.py in the devel branch. It seems that the class attrl has changed to attrlArray in pbs.py. Could you please point me at the proper corresponding PBSQuery.py for the devel branch?

Thank you.

comment:5 Changed 9 years ago by bas

Is seems that some structs are renamed in torque 5.0. What you do is just copy PBSQuery.py to the devel branch and test it. PBSQuery is not included because in the devel branch because I only use this branch to generated C/++ wrapper files and pbs.py. PBSQuery is build on top of this.

All the different major torque versions have its own set of generated files.

comment:6 Changed 9 years ago by anonymous

I see that now. The swig generated error message I get is a little confusing.

In [1]: from PBSQuery import PBSQuery

In [2]: p = PBSQuery(server='ruby-batch')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/pcarey/<ipython console> 

/usr/local/python/2.4/torque-5.0.0/lib64/python2.4/site-packages/pbs/PBSQuery.pyc in __init__(self, server)
     93         #    sequence_number.server (is not self.server)
     94         #
---> 95         self.job_server_id = list(self.get_serverinfo())[0]
     96         self._disconnect()
     97 

/usr/local/python/2.4/torque-5.0.0/lib64/python2.4/site-packages/pbs/PBSQuery.pyc in get_serverinfo(self, attrib_list)
    263 
    264     def get_serverinfo(self, attrib_list=None):
--> 265         self._statserver(attrib_list)
    266         return self.d
    267 

/usr/local/python/2.4/torque-5.0.0/lib64/python2.4/site-packages/pbs/PBSQuery.pyc in _statserver(self, attrib_list)
    257 
    258         self._connect()
--> 259         serverinfo = pbs.pbs_statserver(self.con, self.attribs, 'NULL')
    260         self._disconnect()
    261 

TypeError: in method 'pbs_statserver', argument 2 of type 'struct attrl *'

Since pbs_ifl.h only changed the name of struct attrl pointer:

-struct batch_status *pbs_statserver(int connect, struct attrl *ATTRL, char *extend);
+struct batch_status *pbs_statserver(int connect, struct attrl *attrib, char *extend);

And pbs_wrap.c is automatically generated.

comment:7 Changed 9 years ago by bas

You can not just change this line:

-struct batch_status *pbs_statserver(int connect, struct attrl *ATTRL, char *extend);
+struct batch_status *pbs_statserver(int connect, struct attrl *attrib, char *extend);

because the pbs.i file intercepts the struct attrl *ATTRL construction and replace this with python list code. That is why distribute a other pbs_ifl.h.

comment:8 Changed 9 years ago by anonymous

Everything works great now with torque version 5.0.0.

Thank you so much for all of your help!

comment:9 Changed 9 years ago by bas

That is good news. Can you attach the files or send me a patch. So I can commit it to the devel branch and release a version

Changed 9 years ago by anonymous

Svn Patch file to update https://oss.trac.surfsara.nl/pbs_python/svn/devel to torque version 5.0.0 (not backwards compatible with torque version 2.4.7)

comment:10 Changed 9 years ago by glen.beane@…

Hi, We are looking to migrate to Torque 5.0 and I'm wondering when this patch will make it into trunk

comment:11 Changed 9 years ago by bas

Sorry I did not see the patch ;-(. It will be incorparated in the source

comment:12 Changed 9 years ago by glen.beane@…

Thanks, looking forward to testing with Torque 5

comment:13 Changed 9 years ago by anonymous

Just checking in on the availability of a new pbs_python release with these patches. We are waiting on this to migrate to Torque 5

comment:14 Changed 9 years ago by bas

We are installing MOAB/Torque 5.X on our test cluster for evaluation. When this is done I can also test this patch. Currently we are still running 2.5.X and maui on our production clusters

comment:15 Changed 9 years ago by bas

In 324:

added 5.X setup, must be made better, want to generate a of stuff from the debian installation package, see #47

comment:16 follow-ups: Changed 9 years ago by anonymous

nice coincidence. here's a patch/hack to handle torque5 new cpuid range representation

be aware: not all corner cases are tested/dealt with (in particular, in the node class, the get_jobs method and isinstance(jobs, str): i have no clue what is expected there.

Changed 9 years ago by stijn.deweirdt@…

comment:17 in reply to: ↑ 16 Changed 9 years ago by bas

Replying to anonymous:

nice coincidence. here's a patch/hack to handle torque5 new cpuid range representation

be aware: not all corner cases are tested/dealt with (in particular, in the node class, the get_jobs method and isinstance(jobs, str): i have no clue what is expected there.

Thanks for the patch. It is a bit hard to follow with all the reformatting of delete the spaces

comment:18 Changed 9 years ago by bas

Today I made some progress and the changes to the header file are minimal to none. The only part that does not work for me is the rm interface:

  • openrm
  • addreq
  • getreg

Does anybody use these functions or can test the pbs_develop branch:

comment:19 Changed 9 years ago by bas

In 336:

preparing for new pbs_python release that supports torque 5.x, see #47

comment:20 Changed 9 years ago by bas

In 337:

added 5.x directory and changed setup.py.in, see #47

comment:21 in reply to: ↑ 16 Changed 9 years ago by bas

Replying to anonymous:

nice coincidence. here's a patch/hack to handle torque5 new cpuid range representation

be aware: not all corner cases are tested/dealt with (in particular, in the node class, the get_jobs method and isinstance(jobs, str): i have no clue what is expected there.

Ok i have applied it and did some tests. I want to give you credits for this patch. Can you give me your name or email address?

comment:22 Changed 9 years ago by bas

In 339:

applied PBSQuery patch to handle cpuid range for torque5, see #47

comment:23 follow-up: Changed 9 years ago by anonymous

hi bas,

it's stijn.deweirdt@…

stijn

comment:24 in reply to: ↑ 23 Changed 9 years ago by bas

Replying to anonymous:

hi bas,

it's stijn.deweirdt@…

stijn

Thanks. I will update the changelog and release the new version

comment:25 Changed 9 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

In 342:

New pbs_python release 4.6.0, closes #47

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.