Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geclipse-dev] Executable in jsdl description

Mariusz Wojtysiak a écrit :

A few details about jobs status:
1. IGridJobStatus.getName() always return string returned by grid. We show this string to user, but don't interpret it. So in your case glite really returned DONE

2. getType() return the status meaning: we parse status from grid and map it to g-Eclipse status. Please use getType() to check if your job is executed, done, failed etc

3. At the end you got status type 0x10, what means ABORTED. Sometimes gLite return string DONE, but job itself has DoneCode != OK. Then we treat such job as ABORTED. This occurs for your job.
OK, it is much clearer now.

For more details please look into method:
eu.geclipse.glite.resources.GliteJobStatus.GliteJobStatus(JobStatus)



Is there a status updater already implemented in geclipse?
Yes: eu.geclipse.core.JobStatusUpdater

Updater updates job status only if user set preference: g-Eclipse / Job Updates Settings / Job Status Updates active

To change this preference programically you may use: eu.geclipse.core.Preferences.setUpdateJobsStatus(boolean)


To be notified when job status is changing, you can register IGridJobStatusListener in IGridJobManager e.g.GridModel.getJobManager().addJobStatusListener( listener );

I have done that but the listener methods are never called (nothing is written on the std output).


class MyJobStatusListner implements IGridJobStatusListener {

       private boolean finished = false;
public boolean isFinished() {
           return finished;
       }
@Override
       public void statusChanged(IGridJob job) {
System.out.println("Status Changed: " + job.getJobStatus().getName() + "; reason " + job.getJobStatus().getReason()); if(job.getJobStatus().getType() == IGridJobStatus.DONE) finished = true;
       }

       @Override
       public void statusUpdated(IGridJob job) {
System.out.println("Status updated: " + job.getJobStatus().getName() + "; reason " + job.getJobStatus().getReason());
       }
}



           Preferences.setUpdateJobsStatus(true);

IGridJobID id = jss[2].submitJob(jsdl, new NullProgressMonitor()); MyJobStatusListner list = new MyJobStatusListner();
           GridModel.getJobManager().addJobStatusListener(list);
while( !list.isFinished() ) {
               try {
                   Thread.sleep(2000);
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }

           }


Rom


Back to the top