Versions Compared

Key

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

...

IFL call mapping with C-Style and CPP-style binding<WIP>

C-Style Binding 
CPP-Style BindingIFL calls
void drmaa2_jsession_free
delete jobSession;

void drmaa2_rsession_free
void drmaa2_msession_free
delete reservationSession;

void drmaa2_j_free
delete job;

void drmaa2_jarray_free
delete jobArray;

void drmaa2_r_free
delete reservation;

drmaa2_string drmaa2_rsession_get_contact
reservationSession.getContact()

drmaa2_string drmaa2_rsession_get_session_name
reservationSession.getSessionName()

drmaa2_r drmaa2_rsession_get_reservation
reservationSession.getReservation()
pbs_statresv
drmaa2_r drmaa2_rsession_request_reservation
reservationSession.requestReservation()
pbs_submit_resv
drmaa2_r_list drmaa2_rsession_get_reservations
reservationSession.getReservations()
pbs_statresv
drmaa2_string drmaa2_r_get_id
reservation.getId()

drmaa2_string drmaa2_r_get_session_name
reservation.getId()

drmaa2_rtemplate drmaa2_r_get_reservation_template
reservation.getReservationTemplate()

drmaa2_rinfo drmaa2_r_get_info
reservation.getReservationInfo()
pbs_statresv
drmaa2_error drmaa2_r_terminate
reservation.terminate()
pbs_delresv
drmaa2_string drmaa2_jarray_get_id
jobArray.getId()

drmaa2_j_list drmaa2_jarray_get_jobs
jobArray.getJobs()
pbs_selectjob
drmaa2_string drmaa2_jarray_get_session_name
jobArray.getSessionName()

drmaa2_jtemplate drmaa2_jarray_get_job_template
jobArray.getJobTemplete()

drmaa2_error drmaa2_jarray_suspend
jobArray.suspend()
pbs_sigjob
drmaa2_error drmaa2_jarray_resume
jobArray.resume()
pbs_sigjob
drmaa2_error drmaa2_jarray_hold
jobArray.hold()
pbs_holdjob
drmaa2_error drmaa2_jarray_release
jobArray.release()
pbs_rlsjob
drmaa2_error drmaa2_jarray_terminate
jobArray.terminate()
pbs_deljob
drmaa2_string drmaa2_jsession_get_contact
jobSession.getContact()

drmaa2_string drmaa2_jsession_get_session_name
jobSession.getSessionName()

drmaa2_string_list drmaa2_jsession_get_job_categories
jobSession.getJobCategeries()

drmaa2_j_list drmaa2_jsession_get_jobs
jobSession.getJobs()
pbs_selectjob
drmaa2_jarray drmaa2_jsession_get_job_array
jobSession.getJobArray()
pbs_selectjob
drmaa2_j drmaa2_jsession_run_job
jobSession.runJob()
pbs_runjob
, pbs_asyrunjob
drmaa2_jarray drmaa2_jsession_run_bulk_jobs
jobSession.runBulkJobs
pbs_runjob
, pbs_asyrunjob
drmaa2_j drmaa2_jsession_wait_any_started
jobSession.waitAnyStarted
pbs_selectjob
drmaa2_j drmaa2_jsession_wait_any_terminated 
jobSession.waitAnyTerminated
pbs_selectjob
drmaa2_string drmaa2_j_get_id
job.getId()

drmaa2_string drmaa2_j_get_session_name
job.getSessionName

drmaa2_jtemplate drmaa2_j_get_jt
job.getJobTemplete()

drmaa2_error drmaa2_j_suspend
job.suspend()
pbs_sigjob
drmaa2_error drmaa2_j_resume
job.resume()
pbs_sigjob
drmaa2_error drmaa2_j_hold 
job.hold()
pbs_holdjob
drmaa2_error drmaa2_j_release
job.resume()
pbs_rlsjob
drmaa2_error drmaa2_j_terminate
job.terminate()
pbs_deljob
drmaa2_jstate drmaa2_j_get_state 
job.getState()

drmaa2_jinfo drmaa2_j_get
_info
_info
job.getInfo()

drmaa2_error drmaa2_j_wait_started
job.waitStarted()
pbs_selectjob
drmaa2_error drmaa2_j_wait_terminated
job.waitTerminated()
pbs_selectjob
drmaa2_r_list drmaa2_msession_get_all_reservations
monitoringSession.getAllReservations()
pbs_statresv
drmaa2_j_list drmaa2_msession_get_all_jobs
monitoringSession.getAllJobs()
pbs_selectjob
drmaa2_queueinfo_list drmaa2_msession_get_all_queues
monitoringSession.getAllQueues
pbs_statque
drmaa2_machineinfo_list drmaa2_msession_get_all_machines
monitoringSession.getAllMachines()
pbs_statnode
, pbs_stathost
,pbs_statvnode


drmaa2_string drmaa2_get_drms_name
sessionManager.getDrmsName()

drmaa2_version drmaa2_get_drms_version 
sessionManager.getDrmsVersion()

drmaa2_string drmaa2_get_drmaa_name
sessionManager.getDrmaaName()

drmaa2_version drmaa2_get_drmaa_version
sessionManager.getDrmaaName()

drmaa2_bool drmaa2_supports  
sessionManager.supports()

drmaa2_jsession drmaa2_create_jsession 
sessionManager.createJobSession()

drmaa2_rsession drmaa2_create_rsession  
sessionManager.createReservationSession()

drmaa2_jsession drmaa2_open_jsession 
sessionManager.openJobSession()

drmaa2_rsession drmaa2_open_rsession 
sessionManager.openReservationSession()

drmaa2_msession drmaa2_open_msession  
sessionManager.openMonitoringSession

drmaa2_error drmaa2_close_jsession 
sessionManager.closeJobSession()

drmaa2_error drmaa2_close_rsession  
sessionManager.closeReservationSession()

drmaa2_error drmaa2_close_msession  
sessionManager.closeMonitoringSession()

drmaa2_error drmaa2_destroy_jsession  
sessionManager.destroyJobSession()

drmaa2_error drmaa2_destroy_rsession 
sessionManager.closeReservationSession()

drmaa2_string_list drmaa2_get_jsession_names
sessionManager.getJobSessionNames()

drmaa2_string_list drmaa2_get_rsession_names  
sessionManager.getReservationSessionNames()

drmaa2_error drmaa2_register_event_notification  
sessionManager.registerEventNotification()


CPP-Style binding

Code Block
languagecpp
themeEclipse
titleCPP-style class defination
collapsetrue
  
namespace drmaa2 
{
  /** Forward declaration**/
  class  Job;          
  class  JobArray;    
  struct QueueInfo;
  struct MachineInfo;
  struct SlotInfo;
  class  Reservation;  
  class  JobSession;  
  class  JobTemplate;
  class  JobInfo;
  class  ReservationInfo;
  class  ReservationTemplate;


  class callback 
  {
    public:
      virtual void notify (notification notification);
  };
 
  class Reservation 
  {
    public:
      string               getReservationId       (void) const;
      ReservationSession  getSession              (void) const;
      ReservationTemplate getReservationTemplate (void) const;

      ReservationInfo     getInfo                  (void);
      void                 terminate                (void);
  };


  class JobArray 
  {
    public:
      string       getJobArrayId   (void) const;
      vector <Job> getJobs           (void) const;
      JobSession  getSession        (void) const;
      JobTemplate getJobTemplate   (void) const;

      void         suspend            (void);
      void         resume             (void);
      void         hold               (void);
      void         release            (void);
      void         terminate          (void);
  };

  /**    
    Every ReservationSession instance acts as container for advance reservations
     in the DRM system. Every Reservation instance SHALL belong only to one
        ReservationSession instance
  */
  class ReservationSession 
  {
    public:
      string            getContact         (void) const;
      string            getSessionName    (void) const;

      Reservation       getReservation      (string               reservationId);
      Reservation       requestReservation  (ReservationTemplate reservationTemplate);
      set <Reservation> getReservations     (void);
  };

  /**
     A job session instance acts as container for job instances controlled
     through the DRMAA API. The session methods support the submission of new
     jobs and the monitoring of existing jobs
  */

  class JobSession 
  {
    public:
      string       getSontact        (void) const;
      string       getSessionName   (void) const;
      set <string> getJobCategories (void) const;

      vector <job> getJobs            (JobInfo       filter);
      JobArray    getJobArray        (string         jobArrayId);
      job          runJob             (JobTemplate   jobTemplate);

      JobArray    runBulkJobs        (JobTemplate   jobTemplate,
                                       long           beginIndex,
                                       long           endIndex,
                                       long           step,
                                       long           maxParallel);
      job          waitAnyStarted     (vector <job> jobs, time_t timeout);
      job          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 
  {
    public:
      set <Reservation>  getAllReservations (void);
      vector <Job>       getAllJobs         (JobInfo     filter);
      set <QueueInfo>   getAllQueues       (set <string> names);
      set <MachineInfo> getAllMachines     (set <string> names);
  };
  /**
    The SessionManager interface is the main interface of a DRMAA implementation for
        establishing communication with the DRM system. By the help of this interface, sessions
        for job management, monitoring,and/or reservation management can be maintained.
   */

  class SessionManager 
  {
    public:
      string              getDrmsName             (void) const;
      version             getDrmsVersion          (void) const;
      version             getDrmaaVersion         (void) const;

      bool                supports                  (capability          capability);
      JobSession         createJobSession          (string              sessionName, 
                                                     string              contactString);
      ReservationSession createReservationSession  (string              sessionName,  
                                                     string              contactString);
      MonitoringSession  createMonitoringSession   (string              contactString);
      JobSession         openJobSession            (string              sessionName);
      ReservationSession openReservationSession    (string              sessionName);
      void                closeJobSession           (JobSession         s);
      void                closeReservationSession   (ReservationSession s);
      void                closeMonitoringSession    (MonitoringSession  s);
      void                destroyJobSession         (string              sessionName);
      void                destroyReservationSession (string              sessionName);
      set <string>        getJobSessions            (void);
      set <string>        getReservationSessions    (void);
      void                registerEventNotification (callback            callback);
  };
};


...

   ├──   ├── sessionManager.getDrmaaName()