Jump to content
  • Announcements

    • admin

      PBS Forum Has Closed   06/12/17

      The PBS Works Support Forum is no longer active.  For PBS community-oriented questions and support, please join the discussion at http://community.pbspro.org.  Any new security advisories related to commercially-licensed products will be posted in the PBS User Area (https://secure.altair.com/UserArea/). 
Sign in to follow this  
Michael Frank

Help needed on using the PBS API

Recommended Posts

I'm writing a C application to submit job to PBS. We've used the qsub command in previous apps, but for this one, we'd like a little closer connection with PBS when we submit the jobs, and the ability to monitor the jobs while they are running.

Anyway, I've finished a simple app to test the concept, and I'm having trouble compiling it. I am compiling on a SuSe Linux server, using the Intel C/C++ compiler. I'm trying to link to the "libpbs" library, and I am getting an unresolved reference to cred_len, cred_type, and cred_buf, that is referenced in pbsD_submit.c.

We are using PBS version 7.1.0.53426-0, which I know is a bit old compared to current shipping versions. Could that be contributing to the problem I am having?

One other thing, in the API documentation, it mentions an "src" directory that is supposed to reside in the pbs directory, but we don't have this on any of our servers. Is that an optional install, that can be loaded from the PBS discs?

Also, it would be great if there were some sample apps and make files available to download, this would help jump-start development efforts.

Thanks!

--Mike Frank

Share this post


Link to post
Share on other sites

I would recommend using the latest and greatest version of PBS. Technically version 7 is not supported anymore. That said we will ALWAYS make our best effort to help you if you must use an older version.

Depending upon what you are doing you might be able to simply use the new feature in PBS called "Hooks" to alter the behavior of PBS upon job submission. Hooks are python scripts that allow you to create custom behavior in PBS without making changes to PBS source or making use of the C API directly. I strongly recommend you examine this feature to see if it meets your needs.

I am not sure but I think the mention of the src dir in the ERS is an error. I am checking on that.

I am also poking around for any simple examples we might be able to share with you.

Share this post


Link to post
Share on other sites

Unfortunately I'm kind of stuck at 7 for the immediate future. I do have a slightly newer version of PBS (8, I think), and I can try to use those libraries to compile to see if I get the same issues.

Basically what we need the application to do is to read a shell script of commands, parse each one out and run it as a PBS job. It then needs to monitor each job until they are all complete, and report on the success or failure of each one. We have other applications that are using the qsub command through a system() call, but those don't really need any direct feedback from the process, they just run it and forget it until a message comes back. I liked the idea of using the API for this app, so that I can get the job id, and the detailed status in a nice struct. I could probably replicate some of this by running qsub using a pipe(popen()), but the API seemed a little easier to use.

In searching around, I did find some complaints about a missing /sys/ucred.h header file on SuSe Linux implementations. I also found some older OpenPBS source code, and noticed that pbsD_connect.c includes /sys/ucred.h, so that may be where my problem is coming from. I'm trying to find out where I can get a copy of that header file for my system.

Thanks for your help on this, I look forward to seeing any examples you might have.

--Mike

Share this post


Link to post
Share on other sites

Just wanted to add a moderate breakthrough that I had this morning. I tried compiling my code again with the PBSPro_8.0.0 version of the libraries, and it compiled successfully, and seems to run okay against the older version of the PBS server. (7.1.0.53426-0)

Do you think there will be any problems running this way, since I'm not really doing any job manipulation?

--Mike

Share this post


Link to post
Share on other sites

You will probably be ok but offically we tell folks not to use mixed versions of PBS So for instance you wouldnt want to use a PBS 7 mom with PBS 8 server and scheduler. This is generally due to differences in the various options and data structures that change between versions and also the fact that we dont currently test (or really support) using mixed PBS versions.

In reality I suspect as long as you can test that everything is working well for you I would say go for it.

Share this post


Link to post
Share on other sites

Thanks, I'll give it a shot.

Any luck on examples in C or C++? I'm fumbling around with pbs_statjob right now, and the struct is coming back with null in the "next" member for the first value in the array. I'm guessing batch_status works like a linked list? (like attropl?) I'm passing the server id, and the job id, and then NULL for attrl and extend.

Thanks again!

Share this post


Link to post
Share on other sites

Well I had success using the api on version 7 of PBS:Pro, but now I have a new problem. We have upgraded to a new server running SUSE SLES11 on x86-64 processors, and we are now using PBS:Pro version 11. As a result, I've had to recompile my application using the new library files in ver 11, and now I'm back to having a problem compiling.

The error that I'm getting is during linking is this:

/usr/lib/pbs/libpbs.a(pbsD_submit.o): In function `pbs_encrypt_pwd':

/home/pbsbuild/PBS_devel10/PBSPro_11.0.0.103450/pbs/src/lib/Libpbs/../Libifl/pbsD_submit.c:102: undefined reference to `DES_key_sched'

/home/pbsbuild/PBS_devel10/PBSPro_11.0.0.103450/pbs/src/lib/Libpbs/../Libifl/pbsD_submit.c:104: undefined reference to `DES_ecb_encrypt'

I've made sure that all the crypto libraries are installed on the server, but no luck getting it to compile. The directory that it is referencing doesn't exist on my server, so I assume that path is from your developer workstations?

I have been successful at getting my app to compile on the new server using the version 9 libraries, but it memory faults when trying to connect to the version 11 PBS:Pro server.

Are there any updated versions of the api libraries for ver. 11 available that I could try?

Thanks!

--Mike

Share this post


Link to post
Share on other sites

Just wanted to correct my previous post, after some more debugging, I was able to get the version 9 libs to work with the version 11 server.

I would still like to find out why I can't compile with the version 11 library files though.

Thanks,

Mike

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×