[GE users] Invoking a java class using DRMAA

anand_jayaraman anand_jayaraman1 at dell.com
Tue Mar 23 05:53:49 GMT 2010


Hi,

Thanks so much for the response.

What I essentially meant here was when a java job is thought out to be executed. The API may not expect a java executable to be provided to it as a remote command.

Let me explain where I am coming from, I was evaluating another job scheduler (open source) called Open source job scheduler. In this product if you want to execute a job as a java job the expectation is that you extend one of their classes and override the methods of their class with your implementation. Once this is done the execution of this job happens without really passing the java executable in the API (but the PATH environment variable should definitely be set). Just to illustrate this in an example:

public class YourClass extends Job_impl /*Job_Impl is a class exposed by the framework */
{

		public boolean spooler_process() {
			//Put your implementation here. It could mean 					  instantiating your class or putting the direct 				  implementation.
		}
}

Now YourClass can be submitted as a job to the scheduler and it takes care of running it.

Coming to Grid Engine one glitch I see is passing a remote command to a job (aka JobTemplate) is if there are issues in running the job you may not be able to do an exact cause analysis of the issue. I am trying to draw a parallel with Runtime.exec(String command) approach.

Please do let me know if I have overlooked something which is available in Grid Engine.

Regards,
Anand	

-----Original Message-----
From: Daniel Templeton [mailto:daniel.templeton at oracle.com] 
Sent: Tuesday, March 23, 2010 2:59 AM
To: users
Cc: Jayaraman, Anand
Subject: Re: [GE users] Invoking a java class using DRMAA

What do you expect the behavior to be for that operation?  How would 
that object be "executed?"

The most straight-forward approach is to set the remote command to 
"java" and set the args to include the name of the class to execute. 
Depending on exactly what you're trying to accomplish, there are other 
approaches.

Daniel

On 03/19/10 06:02, anand_jayaraman wrote:
> Hi,
>
> I understand there is a notion of DRMAA wherein you can run Grid jobs using Java API. I find the examples for only running some sh files. I am interested in an implementation like this, Please read the comments i have written in this code snippet:
>
>            JobTemplate jt = session.createJobTemplate();
>            /*
> I want a java class to become the content for JobTemplate. I am not interested in invoking this through a shell script file.
>
> Something like:
>
>         jt.setXXX(java class)
>
> Once the job executes it essentially executes the java class. Is this supported?
>
>
>            */
>
>            String id = session.runJob(jt);
>
>            System.out.println("Your job has been submitted with id " + id);
>
>            session.deleteJobTemplate(jt);
>            session.exit();
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=249681
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=250695

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list