Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
themeEclipse
titleCPP-style class defination
collapsetrue
  
namespace drmaa2 
{

typedef /** Forward declaration**/
  class  Joblong TimeAmount;
typedef time_t AbsoluteTime;

enum DrmaaCapability {
    ADVANCE_RESERVATION,
   class RESERVE_SLOTS,
JobArray;    CALLBACK,
  struct QueueInfo;
 BULK_JOBS_MAXPARALLEL,
 struct MachineInfo;  JT_EMAIL,
struct SlotInfo;   classJT_STAGING,
 Reservation;   JT_DEADLINE,
 class  JobSession; JT_MAXSLOTS,
   class JT_ACCOUNTINGID,
JobTemplate;   class RT_STARTNOW,
JobInfo;   class RT_DURATION,
ReservationInfo;   class RT_MACHINEOS,
ReservationTemplate;    T_MACHINEARCH
class};
callback
enum JobState  {
    public:UNDETERMINED,
    QUEUED,
 virtual void notify (notification notification); QUEUED_HELD,
   }; RUNNING,
   class ReservationSUSPENDED,
   { REQUEUED,
   public: REQUEUED_HELD,
    DONE,
string    FAILED
};
enum OperatingSystem {
    AIX = getReservationId0,
    BSD = (void) const;1,
    LINUX = 2,
ReservationSession  getSession  HPUX = 3,
    IRIX = 4,
  (void) const; MACOS = 5,
   ReservationTemplate getReservationTemplateSUNOS (void) const;= 6,
    TRUE64 = 7,
ReservationInfo    UNIXWARE getInfo= 8,
    WI = 9,
    WINNT = 10,
  (void);  OTHER_OS = 11
};

voidenum CpuArchitecture {
    ALPHA = 0,
    ARM = 1,
terminate    CELL = 2,
    PARISC = 3,
  (void);  X86 };= 4,
   class JobArrayX64 = 5,
 {   IA64 = public:6,
    MIPS = string7,
    PPC = getJobArrayId8,
  (void) const; PPC64 = 9,
   vector <Job>SPARC getJobs= 10,
    SPARC64 = 11,
  (void) const; OTHER_CPU = 12
};
template<class T>
JobSessiontypedef map<string, getSessionT> Dictionary;

typedef list<string> StringList;
typedef list<string> (void) constOrderedStringList;
enum DrmaaEvent {
   JobTemplate getJobTemplate   (void) const;

 NEW_STATE, MIGRATED, ATTRIBUTE_CHANGE
};

class DrmaaCallback {
    void notify(DrmaaNotification notification) = 0;
};
struct DrmaaNotification {
suspend    DrmaaEvent event;
    string  (void)jobId;
    string sessionName;
void    JobState jobState;
};
struct Version resume{
    string major;
    string minor;
(void)};
struct ReservationTemplate {
   void string reservationName;
    time_t startTime;
hold    time_t endTime;
    time_t duration;
   (void);   long minSlots;
  void  long maxSlots;
    set<string> releaseusersACL;
    vector<string> candidateMachines;
    long (void)minPhysMemory;
    OperatingSystem machineOS;
void    CpuArchitecture machineArch;
};
struct QueueInfo terminate{
    string name;
};
typedef list<QueueInfo> (void)QueueInfoList;

struct };JobInfo {
  /**  string jobId;
    long EveryexitStatus;
ReservationSession instance acts as containerstring forterminatingSignal;
advance reservations   string annotation;
 in the DRM system.JobState EveryjobState;
Reservation instance SHALL belong onlystring tojobSubState;
one    vector<string> allocatedMachines;
   ReservationSession instancestring submissionMachine;
 */   classstring ReservationSessionjobOwner;
   { long slots;
  public:  string queueName;
   string time_t wallclockTime;
    long cpuTime;
   getContact time_t submissionTime;
    time_t dispatchTime;
(void) const;   time_t finishTime;
};
typedef stringlist<JobInfo> JobInfoList;

struct SlotInfo {
    string machineName;
getSessionName    (void)string constslots;
};
typedef list<SlotInfo> SlotInfoList;

struct ReservationInfo Reservation{
    string  getReservationreservationId;
     (string reservationName;
    time_t reservedStartTime;
       reservationId)time_t reservedEndTime;
    set<string> usersACL;
Reservation    long reservedSlots;
  requestReservation  (ReservationTemplateSlotInfoList reservationTemplate)reservedMachines;
};
typedef list<ReservationInfo> ReservationInfoList;

struct setJobTemplate <Reservation>{
getReservations    string (void)remoteCommand;
    vector<string> }args;
   /**
 bool submitAsHold;
    Abool jobrerunnable;
session instance acts as containerDictionary<string> forjobEnvironment;
job instances controlled  string workingDirectory;
  through the DRMAAstring API.jobCategory;
The session methods support theset<string> submissionemail;
of new   bool emailOnStarted;
 jobs and the monitoringbool ofemailOnTerminated;
existing jobs   */string jobName;
  class JobSession string inputPath;
 {   string outputPath;
public:    string errorPath;
 string   bool joinFiles;
  getSontact  string reservationId;
    (void)string constqueueName;
    long minSlots;
string    long maxSlots;
 getSessionName   (void)long constpriority;
    vector<string> candidateMachines;
 set <string> getJobCategories (void)long constminPhysMemory;
    OperatingSystem machineOS;
 vector <job>  getJobsCpuArchitecture machineArch;
    time_t startTime;
    (JobInfo time_t deadlineTime;
    Dictionary<string> filter)stageInFiles;
    Dictionary<string> stageOutFiles;
JobArray    getJobArrayDictionary<string>  resourceLimits;
     (string accountingId;
};

struct MachineInfo {
  jobArrayId);  string name;
   job bool available;
    long sockets;
 runJob   long coresPerSocket;
    long threadsPerCore;
  (JobTemplate  double jobTemplate)load;
    long physMemory;
 JobArray   long runBulkJobsvirtMemory;
    OperatingSystem machineOS;
 (JobTemplate   jobTemplate,Version machineOSVersion;
    CpuArchitecture machineArch;
};
typedef list<MachineInfo> MachineInfoList;

class Drmaa2Exception;
class DeniedByDrmsException;
class DrmCommunicationException;
class TryLaterException;
class TimeoutException;
class InternalException;
class InvalidArgumentException;
class InvalidSessionException;
class InvalidStateException;
class OutOfResourceException;
class UnsupportedAttributeException;
class UnsupportedOperationException;
class ImplementationSpecificException;

longclass DrmaaReflective {
    /**
   beginIndex,  * TODO : How to support reflective in C++?
     * Java provides reflection
     */
    StringList jobTemplateImplSpec;
    StringList jobInfoImplSpec;
    StringList longreservationTemplateImplSpec;
    StringList reservationInfoImplSpec;
    endIndex,StringList queueInfoImplSpec;
    StringList machineInfoImplSpec;
    StringList notificationImplSpec;
    string getInstanceValue(void *instance, string name);
    void setInstanceValue(void *instance, string name, string value);
    string  long        describeAttribute(void *instance, string name);
};

class JobArray {
public:
  step,  virtual ~JobArray(void);
    virtual string& getJobArrayId(void) const = 0;
    virtual JobList& getJobs(void) const = 0;
    virtual JobSession& getSession(void) const = 0;
    virtual  long   JobTemplate& getJobTemplate(void) const = 0;

    virtual void maxParallel)suspend(void) = 0;
    virtual void jobresume(void) = 0;
    virtual void hold(void) waitAnyStarted= 0;
   (vector <job>virtual jobs, time_t timeout);
 void release(void) = 0;
    jobvirtual          waitAnyTerminated  (vector <job> jobs, time_t timeout);
  };

  /**
    The MonitoringSession interface provides a set of stateless methods for 
    fetching information about the DRM system and the DRMAA implementation itself.
  */
  class MonitoringSession 
  {
    void terminate(void) = 0;
};

class Job {
public:
      set <Reservation>  getAllReservations virtual ~Job(void);
    virtual const vector <Job>   string& getJobId(void) const = 0;
   getAllJobs virtual const       (JobInfo     filter)JobInfo& getJobInfo(void) const = 0;
    virtual const set <QueueInfo>   getAllQueues       (set <string> names);
  JobState& getState(string& subState) const = 0;
   set <MachineInfo>virtual getAllMachinesconst JobTemplate&    (set <string> names);
  }getJobTemplate(void) const = 0;
  /**  virtual void suspend(void) The= SessionManager0;
interface is the main interfacevirtual of a DRMAA implementation forvoid resume(void) = 0;
    virtual void hold(void) = 0;
establishing communication with the DRM system. By the help of this interface, sessions
        for job management, monitoring,and/or reservation management can be maintained. virtual void release(void) = 0;
   */ virtual void terminate(void) class= SessionManager0;
   { virtual void waitStarted(TimeAmount& timeout_) public:= 0;
    virtual stringvoid waitTerminated(TimeAmount& timeout_) = 0;
};
typedef list<Job> JobList;

class Reservation {
public:
getDrmsName    virtual ~Reservation(void);
    virtual const string& getReservationId(void) const = 0;
    virtual const version    ReservationSession& getSession(void) const = 0;
    virtual const ReservationTemplate& getReservationTemplate(void) getDrmsVersionconst = 0;
    virtual const ReservationInfo& getInfo(void) const; = 0;
    versionvirtual void terminate(void) = 0;
};
typedef list<Reservation> ReservationList;

class ReservationSession {
getDrmaaVersionpublic:
    virtual    ~ReservationSession(void) const;
    virtual const  bool   string& getContact(void) const = 0;
    virtual const string& getSessionName(void) const = 0;
 supports   virtual const Reservation& getReservation(string& reservationId_) = 0;
    virtual const Reservation&  requestReservation(capability
         capability);   const ReservationTemplate& reservationTemplate_) = JobSession0;
    virtual const ReservationList& getReservations(void) createJobSession= 0;
};

class JobSession {
public:
  (string  virtual ~JobSession(void);
    virtual const string& getContact(void) const = sessionName,0;
    virtual const string& getSessionName(void) const = 0;
    virtual const StringList getJobCategories(void) const = 0;
    virtual const JobList& getJobs(const JobInfo& filter_) = 0;
    virtual const JobArray& getJobArray(const string& jobArrayId_) = 0;
    virtual   const string& runJob(const JobTemplate& jobTemplate_) = 0;
      virtual const contactString);
  JobArray& runBulkJobs(const JobTemplate& jobTemplate_,
   ReservationSession createReservationSession  (string      const long beginIndex_, const long endIndex_, const long sessionNamestep_,
            const long maxParallel_) = 0;
    virtual const Job& waitAnyStarted(const JobList& jobs_const,
            const TimeAmount timeout_) = 0;
    virtual const Job& waitAnyTerminated(const JobList& jobs_,
  string          const TimeAmount timeout_) = contactString)0;
};

class MonitoringSession {
public:
MonitoringSession  createMonitoringSession  virtual ~MonitoringSession(stringvoid);
    virtual const MachineInfoList& getAllMachines(list<string> machines_) = 0;
  contactString);  virtual const ReservationList& getAllReservations(void) = JobSession0;
    virtual const JobList&  openJobSession  getAllJobs(JobInfo& filter_) = 0;
    virtual const QueueInfoList& getAllQueues(list<string> queues_) (string= 0;
};

class SessionManager {

private:
     sessionNameSessionManager();

public:
    ReservationSession/**
openReservationSession    (string * SessionManager as singleton
     */
   sessionName); static SessionManager& getInstance() = 0;

voidpublic:
    virtual ~SessionManager(void);
    virtual const string& getDrmsName(void) const closeJobSession= 0;
    virtual const Version& getDrmsVersion(void) const (JobSession= 0;
    virtual const Version& sgetDrmaaVersion(void); const = 0;

  void  virtual bool supports(const DrmaaCapability& capability_) = 0;

    virtual const closeReservationSessionJobSession&   createJobSession(ReservationSession s);
const string& sessionName_,
     void       const string& contact_) = 0;
    closeMonitoringSessionvirtual const JobSession&  openJobSession(MonitoringSessionconst string& s)sessionName_) = 0;
    virtual  void             closeJobSession(JobSession& session_) = 0;
  destroyJobSession  virtual void destroyJobSession(const string& sessionName_) = 0;
(string
    virtual const ReservationSession& createReservationSession(
     sessionName);       voidconst string& sessionName_, const string& contact_) = 0;
    virtual const ReservationSession&  destroyReservationSessionopenReservationSession(
(string            const string& sessionName_); = 0;
    setvirtual <string>void closeReservationSession(ReservationSession& session_) = 0;
   getJobSessions void destroyReservationSession(const string& sessionName_) = 0;

    (void);virtual const MonitoringSession& openMonitoringSession(
   set <string>        getReservationSessionsconst string& contact_) = (void)0;
    virtual  void closeMonitoringSession(MonitoringSession& session_) = 0;

    virtual const     registerEventNotification (callback  StringList& getReservationSessionNames(void) = 0;
    virtual const StringList& getJobSessionNames(void) = callback)0;

 };
};




C-Style binding APIs definition

...