Versions Compared

Key

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

...

C-Style Binding 
CPP-Style BindingIFL calls
void 
drmaa2_jsession_free(drmaa2_jsession * js)
delete jobSession;
N/A
void 
drmaa2_rsession_free(drmaa2_rsession * rs)
delete reservationSession;
N/A
void 
drmaa2_j_free(drmaa2_j * j)
delete job;
N/A
void 
drmaa2_jarray_free(drmaa2_jarray * ja)
delete jobArray;
N/A
void 
drmaa2_r_free(drmaa2_r * r)
delete reservation;
N/A
drmaa2_string 
drmaa2_rsession_get_contact(const drmaa2_rsession rs);
reservationSession.getContact()
N/A
drmaa2_string 
drmaa2_rsession_get_session_name(const drmaa2_rsession rs);
reservationSession.getSessionName()
N/A
drmaa2_r 
drmaa2_rsession_get_reservation
(const drmaa2_rsession rs,
const drmaa2_string reservationId);
reservationSession.getReservation()
pbs_statresv
drmaa2_r 
drmaa2_rsession_request_reservation
(const drmaa2_rsession rs,
const drmaa2_rtemplate rt);
reservationSession.requestReservation()
pbs_submit_resv
drmaa2_r_list 
drmaa2_rsession_get_reservations
(const drmaa2_rsession rs);
reservationSession.getReservations()
pbs_statresv
drmaa2_string 
drmaa2_r_get_id (const drmaa2_r r);
reservation.getId()
N/A
drmaa2_string 
drmaa2_r_get_session_name (const drmaa2_r r);
reservation.getId()
N/A
drmaa2_rtemplate 
drmaa2_r_get_reservation_template(const drmaa2_r r);
reservation.getReservationTemplate()
N/A
drmaa2_rinfo 
drmaa2_r_get_info(const drmaa2_r r);
reservation.getReservationInfo()
pbs_statresv
drmaa2_error 
drmaa2_r_terminate(drmaa2_r r);
reservation.terminate()
pbs_delresv
drmaa2_string 
drmaa2_jarray_get_id(const drmaa2_jarray ja);
jobArray.getId()
N/A
drmaa2_j_list 
drmaa2_jarray_get_jobs(const drmaa2_jarray ja);
jobArray.getJobs()
pbs_selectjob
drmaa2_string 
drmaa2_jarray_get_session_name(const drmaa2_jarray ja);
jobArray.getSessionName()
N/A
drmaa2_jtemplate 
drmaa2_jarray_get_job_template(const drmaa2_jarray ja);
jobArray.getJobTemplete()
N/A
drmaa2_error 
drmaa2_jarray_suspend(drmaa2_jarray ja);
jobArray.suspend()
pbs_sigjob
drmaa2_error 
drmaa2_jarray_resume(drmaa2_jarray ja);
jobArray.resume()
pbs_sigjob
drmaa2_error 
drmaa2_jarray_hold(drmaa2_jarray ja);
jobArray.hold()
pbs_holdjob
drmaa2_error 
drmaa2_jarray_release(drmaa2_jarray ja);
jobArray.release()
pbs_rlsjob
drmaa2_error 
drmaa2_jarray_terminate(drmaa2_jarray ja);
jobArray.terminate()
pbs_deljob
drmaa2_string 
drmaa2_jsession_get_contact(const drmaa2_jsession js);
jobSession.getContact()
N/A
drmaa2_string 
drmaa2_jsession_get_session_name(const drmaa2_jsession js);
jobSession.getSessionName()
N/A
drmaa2_string_list 
drmaa2_jsession_get_job_categories(const drmaa2_jsession js);
jobSession.getJobCategeries()
N/A
drmaa2_j_list 
drmaa2_jsession_get_jobs
(const drmaa2_jsession js,
const drmaa2_jinfo filter);
jobSession.getJobs()
pbs_selectjob
drmaa2_jarray 
drmaa2_jsession_get_job_array
(const drmaa2_jsession js,
const drmaa2_string jobarrayId);
jobSession.getJobArray()
pbs_selectjob
drmaa2_j 
drmaa2_jsession_run_job
(const drmaa2_jsession js,
const drmaa2_jtemplate jt);
jobSession.runJob()
pbs_runjob
, pbs_asyrunjob
drmaa2_jarray
drmaa2_jsession_run_bulk_jobs
 (const drmaa2_jsession js,
const drmaa2_jtemplate jt,
unsigned long begin_index,
unsigned long end_index,
unsigned long step,
unsigned long max_parallel);
jobSession.runBulkJobs
pbs_runjob
, pbs_asyrunjob
drmaa2_j 
drmaa2_jsession_wait_any_started
(const drmaa2_jsession js,
const drmaa2_j_list l,
const time_t timeout);
jobSession.waitAnyStarted
pbs_selectjob
drmaa2_j 
drmaa2_jsession_wait_any_terminated
(const drmaa2_jsession js,
const drmaa2_j_list l,
const time_t timeout);
jobSession.waitAnyTerminated
pbs_selectjob
drmaa2_string 
drmaa2_j_get_id(const drmaa2_j j);
job.getId()
N/A
drmaa2_string 
drmaa2_j_get_session_name(const drmaa2_j j);
job.getSessionName
N/A
drmaa2_jtemplate 
drmaa2_j_get_jt(const drmaa2_j j);
job.getJobTemplete()
N/A
drmaa2_error 
drmaa2_j_suspend(drmaa2_j j);
job.suspend()
pbs_sigjob
drmaa2_error 
drmaa2_j_resume(drmaa2_j j);
job.resume()
pbs_sigjob
drmaa2_error 
drmaa2_j_hold (drmaa2_j j);
job.hold()
pbs_holdjob
drmaa2_error
 drmaa2_j_release(drmaa2_j j);
job.resume()
pbs_rlsjob
drmaa2_error 
drmaa2_j_terminate(drmaa2_j j);
job.terminate()
pbs_deljob
drmaa2_jstate 
drmaa2_j_get_state
(const drmaa2_j j,
 drmaa2_string * substate);
job.getState()
N/A
drmaa2_jinfo 
drmaa2_j_get_info(const drmaa2_j j);
job.getInfo()
N/A
drmaa2_error
drmaa2_j_wait_started
(const drmaa2_j j,
 const time_t timeout);
job.waitStarted()
pbs_selectjob
drmaa2_error 
drmaa2_j_wait_terminated
(const drmaa2_j j,
  const time_t timeout);
job.waitTerminated()
pbs_selectjob
drmaa2_r_list 
drmaa2_msession_get_all_reservations
(const drmaa2_msession ms);
monitoringSession.getAllReservations()
pbs_statresv
drmaa2_j_list 
drmaa2_msession_get_all_jobs
(const drmaa2_msession ms,
const drmaa2_jinfo filter);
monitoringSession.getAllJobs()
pbs_selectjob
drmaa2_queueinfo_list 
drmaa2_msession_get_all_queues
(const drmaa2_msession ms,
const drmaa2_string_list names);
monitoringSession.getAllQueues
pbs_statque
drmaa2_machineinfo_list 
drmaa2_msession_get_all_machines
(const drmaa2_msession ms,
const drmaa2_string_list names);


monitoringSession.getAllMachines()
pbs_statnode
, pbs_stathost
,pbs_statvnode


drmaa2_string 
drmaa2_get_drms_name()
sessionManager.getDrmsName()
N/A
drmaa2_version 
drmaa2_get_drms_version()
sessionManager.getDrmsVersion()
N/A
drmaa2_string 
drmaa2_get_drmaa_name()
sessionManager.getDrmaaName()
N/A
drmaa2_version 
drmaa2_get_drmaa_version()
sessionManager.getDrmaaName()
N/A
drmaa2_bool
 drmaa2_supports()
sessionManager.supports()
N/A
drmaa2_jsession 
drmaa2_create_jsession (const char * session_name, const char * contact);
sessionManager.createJobSession()
N/A
drmaa2_rsession
 drmaa2_create_rsession(const char * session_name, const char * contact);
sessionManager.createReservationSession()
N/A
drmaa2_jsession
 drmaa2_open_jsession (const char * session_name);
sessionManager.openJobSession()
N/AN/AN/A
drmaa2_rsession 
drmaa2_open_rsession (const char * session_name);
sessionManager.openReservationSession()
N/A
drmaa2_msession 
drmaa2_open_msession (const char * session_name);
sessionManager.openMonitoringSession
N/A
drmaa2_error 
drmaa2_close_jsession (drmaa2_jsession js);
sessionManager.closeJobSession()
N/A
drmaa2_error 
drmaa2_close_rsession  (drmaa2_rsession rs);
sessionManager.closeReservationSession()
N/A
drmaa2_error 
drmaa2_close_msession (drmaa2_msession ms);
sessionManager.closeMonitoringSession()
N/A
drmaa2_error 
drmaa2_destroy_jsession (const char * session_name);
sessionManager.destroyJobSession()
N/A
drmaa2_error 
drmaa2_destroy_rsession (const char * session_name);
sessionManager.closeReservationSession()
N/A
drmaa2_string_list 
drmaa2_get_jsession_names()
sessionManager.getJobSessionNames()
N/A
drmaa2_string_list 
drmaa2_get_rsession_names ()
sessionManager.getReservationSessionNames()
N/A
drmaa2_error 
drmaa2_register_event_notification (const drmaa2_callback callback);
sessionManager.registerEventNotification()
N/A


CPP-Style binding

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

typedef long TimeAmount;
typedef time_t AbsoluteTime;

enum DrmaaCapability {
    ADVANCE_RESERVATION,
    RESERVE_SLOTS,
    CALLBACK,
    BULK_JOBS_MAXPARALLEL,
    JT_EMAIL,
    JT_STAGING,
    JT_DEADLINE,
    JT_MAXSLOTS,
    JT_ACCOUNTINGID,
    RT_STARTNOW,
    RT_DURATION,
    RT_MACHINEOS,
    T_MACHINEARCH
};

enum JobState {
    UNDETERMINED,
    QUEUED,
    QUEUED_HELD,
    RUNNING,
    SUSPENDED,
    REQUEUED,
    REQUEUED_HELD,
    DONE,
    FAILED
};
enum OperatingSystem {
    AIX = 0,
    BSD = 1,
    LINUX = 2,
    HPUX = 3,
    IRIX = 4,
    MACOS = 5,
    SUNOS = 6,
    TRUE64 = 7,
    UNIXWARE = 8,
    WI = 9,
    WINNT = 10,
    OTHER_OS = 11
};

enum CpuArchitecture {
    ALPHA = 0,
    ARM = 1,
    CELL = 2,
    PARISC = 3,
    X86 = 4,
    X64 = 5,
    IA64 = 6,
    MIPS = 7,
    PPC = 8,
    PPC64 = 9,
    SPARC = 10,
    SPARC64 = 11,
    OTHER_CPU = 12
};
template<class T>
typedef map<string, T> Dictionary;

typedef list<string> StringList;
typedef list<string> OrderedStringList;
enum DrmaaEvent {
    NEW_STATE, MIGRATED, ATTRIBUTE_CHANGE
};

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

struct JobInfo {
    string jobId;
    long exitStatus;
    string terminatingSignal;
    string annotation;
    JobState jobState;
    string jobSubState;
    vector<string> allocatedMachines;
    string submissionMachine;
    string jobOwner;
    long slots;
    string queueName;
    time_t wallclockTime;
    long cpuTime;
    time_t submissionTime;
    time_t dispatchTime;
    time_t finishTime;
};
typedef list<JobInfo> JobInfoList;

struct SlotInfo {
    string machineName;
    string slots;
};
typedef list<SlotInfo> SlotInfoList;

struct ReservationInfo {
    string reservationId;
    string reservationName;
    time_t reservedStartTime;
    time_t reservedEndTime;
    set<string> usersACL;
    long reservedSlots;
    SlotInfoList reservedMachines;
};
typedef list<ReservationInfo> ReservationInfoList;

struct JobTemplate {
    string remoteCommand;
    vector<string> args;
    bool submitAsHold;
    bool rerunnable;
    Dictionary<string> jobEnvironment;
    string workingDirectory;
    string jobCategory;
    set<string> email;
    bool emailOnStarted;
    bool emailOnTerminated;
    string jobName;
    string inputPath;
    string outputPath;
    string errorPath;
    bool joinFiles;
    string reservationId;
    string queueName;
    long minSlots;
    long maxSlots;
    long priority;
    vector<string> candidateMachines;
    long minPhysMemory;
    OperatingSystem machineOS;
    CpuArchitecture machineArch;
    time_t startTime;
    time_t deadlineTime;
    Dictionary<string> stageInFiles;
    Dictionary<string> stageOutFiles;
    Dictionary<string> resourceLimits;
    string accountingId;
};

struct MachineInfo {
    string name;
    bool available;
    long sockets;
    long coresPerSocket;
    long threadsPerCore;
    double load;
    long physMemory;
    long virtMemory;
    OperatingSystem machineOS;
    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;

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

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

    virtual void suspend(void) = 0;
    virtual void resume(void) = 0;
    virtual void hold(void) = 0;
    virtual void release(void) = 0;
    virtual void terminate(void) = 0;
};

class Job {
public:
    virtual ~Job(void);
    virtual const string& getJobId(void) const = 0;
    virtual const JobInfo& getJobInfo(void) const = 0;
    virtual const JobState& getState(string& subState) const = 0;
    virtual const JobTemplate& getJobTemplate(void) const = 0;
    virtual void suspend(void) = 0;
    virtual void resume(void) = 0;
    virtual void hold(void) = 0;
    virtual void release(void) = 0;
    virtual void terminate(void) = 0;
    virtual void waitStarted(TimeAmount& timeout_) = 0;
    virtual void waitTerminated(TimeAmount& timeout_) = 0;
};
typedef list<Job> JobList;

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

class ReservationSession {
public:
    virtual ~ReservationSession(void);
    virtual const string& getContact(void) const = 0;
    virtual const string& getSessionName(void) const = 0;
    virtual const Reservation& getReservation(string& reservationId_) = 0;
    virtual const Reservation& requestReservation(
            const ReservationTemplate& reservationTemplate_) = 0;
    virtual const ReservationList& getReservations(void) = 0;
};

class JobSession {
public:
    virtual ~JobSession(void);
    virtual const string& getContact(void) const = 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 JobArray& runBulkJobs(const JobTemplate& jobTemplate_,
            const long beginIndex_, const long endIndex_, const long step_,
            const long maxParallel_) = 0;
    virtual const Job& waitAnyStarted(const JobList& jobs_const,
            const TimeAmount timeout_) = 0;
    virtual const Job& waitAnyTerminated(const JobList& jobs_,
            const TimeAmount timeout_) = 0;
};

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

class SessionManager {

private:
    SessionManager();

public:
    /**
     * SessionManager as singleton
     */
    static SessionManager& getInstance() = 0;

public:
    virtual ~SessionManager(void);
    virtual const string& getDrmsName(void) const = 0;
    virtual const Version& getDrmsVersion(void) const = 0;
    virtual const Version& getDrmaaVersion(void) const = 0;

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

    virtual const JobSession& createJobSession(const string& sessionName_,
            const string& contact_) = 0;
    virtual const JobSession& openJobSession(const string& sessionName_) = 0;
    virtual void closeJobSession(JobSession& session_) = 0;
    virtual void destroyJobSession(const string& sessionName_) = 0;

    virtual const ReservationSession& createReservationSession(
            const string& sessionName_, const string& contact_) = 0;
    virtual const ReservationSession& openReservationSession(
            const string& sessionName_) = 0;
    virtual void closeReservationSession(ReservationSession& session_) = 0;
    void destroyReservationSession(const string& sessionName_) = 0;

    virtual const MonitoringSession& openMonitoringSession(
            const string& contact_) = 0;
    virtual void closeMonitoringSession(MonitoringSession& session_) = 0;

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

};




...