OpendTect  7.0
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Batch::JobDispatcher Class Referenceabstract

Base class (with factory) for methods to kick-off an OD batch job. More...

Inheritance diagram for Batch::JobDispatcher:
[legend]

Public Member Functions

 JobDispatcher ()
 
virtual ~JobDispatcher ()
 
virtual bool canHandle (const JobSpec &) const
 
virtual bool canResume (const JobSpec &) const
 
virtual uiString description () const =0
 
uiString errMsg () const
 
bool go (const JobSpec &, ID *=nullptr)
 
virtual bool isSuitedFor (const char *prognm) const =0
 
BufferString jobName () const
 
void setJobName (const char *)
 
void setToDefParFileName ()
 

Static Public Member Functions

static void addIDTo (ID, OS::MachineCommand &)
 
static void getDefParFilename (const char *prognm, BufferString &)
 
static ID getInvalid ()
 
static BufferString getJobName (const char *)
 
static void getJobNames (BufferStringSet &)
 
static void setUserWantsResume (IOPar &, bool)
 
static const char * sKeyFinishMsg ()
 
static bool userWantsResume (const IOPar &)
 

Public Attributes

JobSpec jobspec_
 
BufferString parfnm_
 

Protected Member Functions

virtual bool init ()
 
virtual bool launch (ID *)=0
 
void serviceEnded (CallBacker *)
 
bool writeParFile () const
 

Protected Attributes

uiString errmsg_
 

Detailed Description

Base class (with factory) for methods to kick-off an OD batch job.

Subclasses are expected to be ranging from simple single-process starters to elaborate cluster-based job splitting monsters.

isSuitedFor() determines whether a certain type of dispatcher can handle any job for this program. canHandle() decides on the whole JobSpec. If the job creates intermediate results, then it may be able to resume after the user has stopped. In that case, canResume() can return true.

Every job will sooner or later be written to a par file. We want to have user select job names, not par file names. Thus, there are both job names and the actual parameter file full path. Par files are written to, and expected to be in the 'Proc' directory. If that is the case, than job name <-> par file goes both ways. The returned BatchID will uniquely identify any job within a session that is launched using a machine command. It can be used to match the spawn process with the spawn request.

<>

Constructor & Destructor Documentation

◆ JobDispatcher()

Batch::JobDispatcher::JobDispatcher ( )

◆ ~JobDispatcher()

virtual Batch::JobDispatcher::~JobDispatcher ( )
virtual

Member Function Documentation

◆ addIDTo()

static void Batch::JobDispatcher::addIDTo ( ID  ,
OS::MachineCommand  
)
static

◆ canHandle()

virtual bool Batch::JobDispatcher::canHandle ( const JobSpec ) const
virtual

◆ canResume()

virtual bool Batch::JobDispatcher::canResume ( const JobSpec ) const
inlinevirtual

◆ description()

virtual uiString Batch::JobDispatcher::description ( ) const
pure virtual

◆ errMsg()

uiString Batch::JobDispatcher::errMsg ( ) const
inline

◆ getDefParFilename()

static void Batch::JobDispatcher::getDefParFilename ( const char *  prognm,
BufferString  
)
static

◆ getInvalid()

static ID Batch::JobDispatcher::getInvalid ( )
inlinestatic

◆ getJobName()

static BufferString Batch::JobDispatcher::getJobName ( const char *  )
static

◆ getJobNames()

static void Batch::JobDispatcher::getJobNames ( BufferStringSet )
static

◆ go()

bool Batch::JobDispatcher::go ( const JobSpec ,
ID = nullptr 
)

◆ init()

virtual bool Batch::JobDispatcher::init ( )
inlineprotectedvirtual

◆ isSuitedFor()

virtual bool Batch::JobDispatcher::isSuitedFor ( const char *  prognm) const
pure virtual

◆ jobName()

BufferString Batch::JobDispatcher::jobName ( ) const
inline

◆ launch()

virtual bool Batch::JobDispatcher::launch ( ID )
protectedpure virtual

◆ serviceEnded()

void Batch::JobDispatcher::serviceEnded ( CallBacker )
protected

◆ setJobName()

void Batch::JobDispatcher::setJobName ( const char *  )

◆ setToDefParFileName()

void Batch::JobDispatcher::setToDefParFileName ( )
inline

◆ setUserWantsResume()

static void Batch::JobDispatcher::setUserWantsResume ( IOPar ,
bool   
)
static

◆ sKeyFinishMsg()

static const char* Batch::JobDispatcher::sKeyFinishMsg ( )
inlinestatic

◆ userWantsResume()

static bool Batch::JobDispatcher::userWantsResume ( const IOPar )
static

◆ writeParFile()

bool Batch::JobDispatcher::writeParFile ( ) const
protected

Member Data Documentation

◆ errmsg_

uiString Batch::JobDispatcher::errmsg_
mutableprotected

◆ jobspec_

JobSpec Batch::JobDispatcher::jobspec_

◆ parfnm_

BufferString Batch::JobDispatcher::parfnm_

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024