Page 1 of 1

Resetting a job

Posted: Wed Jan 23, 2008 6:33 am
by Aquilis
Hi all,

I am working on PX Edition, but In my Environment i dont have C++ compilers got installed.Whenever a parallel job gets aborted i try to reset it through user defined Routine before its execution.If a job gets aborted,i know that without a C++ compilers its impossible to compile the jobs involving Parallel Transformers.So if i go for resetting a Job instead of recompiling,will this do any sense or will this going to work out ?

Currently i cant test this one out,that's why i opened this thread.

Thanks,

Posted: Wed Jan 23, 2008 7:53 am
by chulett
Resetting != compiling. You'll be fine simply resetting the job, unless there's something dodgy about your 'user defined routine' that does the reset. :?

Posted: Thu Jan 24, 2008 10:54 pm
by kduke
How are you starting your jobs? If from scripts then I have posted code which reset a job. It also checks to see if it needs it.

If you are doing it from a job then use DSPrepare().

Posted: Thu Jan 24, 2008 11:53 pm
by Teej
Or use a Job sequencer that reset it automatically.

Posted: Fri Feb 08, 2008 12:57 am
by Aquilis
Jobs are executed through a JobControl and which itself does the Resetting and invocation of the parallel Jobs.So when we dont have the compilers installed on the environment and previous execution status of the jobs are Aborted,then JC will try to reset it and Run.so will it succeed in resetting and executing ? i think it will not happen unless all the jobs invoked from the JC are made as multi-instantiated jobs ?

Input needed.

Posted: Fri Feb 08, 2008 3:12 am
by ray.wurlod
Your last sentence is completely erroneous - whether or not a job is multi-instance enabled has no bearing whatsoever on whether it can be reset successfully. To be reset successfully a job must simply be not in a runnable state and contain no quirks that prevent its being reset. DSPrepareJob() - that is, "reset if required, then run" - will work, and does not require recompiling anything, and therefore does not require there to be a C++ compiler.

Posted: Fri Feb 08, 2008 6:18 am
by Aquilis
Even though the job is in aborted state and if we try to reset it knowing that we dont have c++ compilers not installed,will it get reset and will execute properly ?

But in this regard, When i try to reset the aborted job ,I am facing the Error Messsage as :
" Unable to run job----2 "

But when i make the job as multi-instance job,even the job fails it will abort as the other instance job.So this was my conclusion before,if this not the problem,then what could be the other reasons which causes this error (" Unable to run job----2 ") ?

Guidance required,
Thanks,
aquilis

Posted: Fri Feb 08, 2008 7:20 am
by chulett
Aquilis wrote:Even though the job is in aborted state and if we try to reset it knowing that we dont have c++ compilers not installed,will it get reset and will execute properly ?
Asked and Answered. More than once. Yes.
Aquilis then wrote:But in this regard, When i try to reset the aborted job ,I am facing the Error Messsage as : " Unable to run job----2 "
As noted earlier, you'd need to show us how you are resetting aborted jobs. Only then could we help understand where your 'error message' is coming from.

Posted: Fri Feb 08, 2008 2:20 pm
by ray.wurlod
When you reset the job, does its status change to "has been reset"?

Posted: Mon Feb 11, 2008 4:37 am
by Aquilis
when i reset the Job,i do get status changed to 'Job has been Reset'.

The code i am using is as follows:

*Reset the Job if the job is not in the Runnable State.
ResetJobName = JobName
gosub ResetJob:

hJob3 = DSAttachJob(JobName, DSJ.ERRWARN)
If NOT(hJob3) Then
-----
-----
-----
-----
-----
Goto ExitReturnSub:
End

ResetJob:
********
hResetJob = DSAttachJob(ResetJobName, DSJ.ERRWARN)
If NOT( hResetJob) Then
----
----
----
End
ErrCode = DSSetDisableProjectHandler( hResetJob, @FALSE)
ErrCode = DSSetDisableJobHandler( hResetJob, @FALSE)

Result = DSGetJobInfo (hResetJob, DSJ.JOBSTATUS)
If (Result = DSJS.RUNFAILED) or (Result = DSJS.STOPPED) or (Result = DSJS.VALFAILED) Then
Result = DSRunJob(hResetJob,DSJ.RUNRESET)
ErrCode = DSWaitForJob(hResetJob)
End
* Release the handle for the job
ErrCode = DSDetachJob(hResetJob)
ResetJobName = ""
Return

ExitReturnSub:
***********
;

Thanks,

Posted: Mon Feb 11, 2008 5:15 am
by ArndW
a) put in a call to DSLogWarn() when you reset the job to make sure it is being executed.

b) put in a call to DSWaitForJob() after the reset to give it time to complete.

c) Have you looked at DSPrepareJob()?

Posted: Mon Feb 11, 2008 8:26 am
by chulett
Just use DSPrepareJob. No need to check ahead of time, if it needs to be reset it will reset it, otherwise it does nothing. Unless you have some need to log everything found: the current state, if it needed to be reset, etc.

Posted: Mon Feb 11, 2008 8:57 am
by ArndW
Just a precautionary note with

Code: Select all

JobHandle = DSPrepareJob(JobHandle)

If it needs to reset the job it will return a new JobHandle. This is normally not an issue but sometimes you need to be aware of this; I had some job control where I stored the JobHandle in an array and this changing of handles caused a lot of problems since it looked like a sporadic bug.

Posted: Mon Feb 11, 2008 9:00 am
by chulett
Yah, it does help to read the docs. :wink: