...
Page Properties | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Goals
Implementation of DRMAAv2 Specification
Background and strategic fit
The Distributed Resource Management Application API Version 2 (DRMAA) specification defines an interface for tightly coupled, but still portable access to the majority of DRM systems. PBS is a Distributed Resource Management system(DRMS). Standardized access to PBS product through a DRMAAv2 implementation(API). High-level API designers, meta-scheduler architects and end users can rely on DRMAAv2 implementations for a unified access to execution resources.
DRMAAv2 Specification (Distributed Resource Management Application API 2)
Overview
As we all know open Open standards are taking major role in the exponential growth in many areas. DRMAA2 is such an open standard. It is the successor of the wide-spread DRMAA standard. DRMAA is generally used for submitting jobs (or creating job work-flows) into a compute cluster by using a cluster resource management system like PBS Professional. Unlike DRMAA, with DRMAA2 you can not only submit jobs, you can also get cluster related information, like getting host names, types and status information or insight about queues configured in the resource management system. You can also monitor jobs not submitted within the application. Overall it covers many more use cases than the old DRMAA standard.
...
https://www.ogf.org/documents/GFD.231.pdf
Assumptions
Color coding in Diagram
Requirements
The implementation of DRMAA2 specification for PBS Pro is broadly divided into the following requirements/user stories.
# | User Story | Importance | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 |
| ||||||||||||
2 |
| ||||||||||||
3 |
| ||||||||||||
4 |
| ||||||||||||
5 |
| ||||||||||||
6 |
| ||||||||||||
7 |
| ||||||||||||
8 |
| ||||||||||||
9 |
| ||||||||||||
10 |
| ||||||||||||
11 |
| ||||||||||||
12 |
|
Architecture and design
Application stack
DRMAA2 Layout
|
Note : Document is part of https://troeger.eu/files/talks/ogf35.pdf
Domain model diagram
...
ConnectionPool is a set of active connection connections with PBSPro. In multi-threaded application each thread uses one connection. ConnectionPool Is Member of DRMSystem
...
Job State model Defined in DRMAAv2 Specification
|
Note : Document is part of https://www.ogf.org/documents/GFD.231.pdf
DRMAA2 spec relies on concept of session to support the persistency of job and reservation information in multiple runs of short lived applications.
...
Refer DRMAAv2 document for description of Objects
Few important Sequence diagram
...
...
Source Directory structure in github
├── ...
├──
pbsproPBSPro
│ ├──
src│DRMAAv2 ├── ├── lib│ ├── ├──├──
Libdrmaa2#
DRMAAv2 module Top level directory
|├──
├──
-- configure.ac DRMAAv2 module Top level directory#
This │file dictates the ├──behavior ├──of├──
the├──
final libdrmaa2configure script that is generated by Autoconf.
|├──
├──
-- INSTALL#
Instructions for successful compilation of this
|├──
├──
All the function prototypes and definitions included in this API. Autoconf and libtool specification to create library.│-- autogen.sh#
This file provides automatic build system preparation and is useful for projects that use the GNU autotools.
|├──
├──
├──
├──
├──
-- drmaa2.cppAUTHORS#
Altair authors information API definitions│
|├──
├──
├──
├──
├── -- drmaa2.hChangeLog#
Delta API and declaration
│change information
|├──
├──
src -- COPYING├──
├──#
Altair Copyright information
|├──
├──
-- NEWS Core infrastructure source files │ ├── ├──├──
├──
inc#
Latest news and updates
|├──
├──
-- README Core infrastructure internal include files#
README│
|├──
├──
unittesting -- README.md├──
├──#
README
|├──
├──
api White-box testing │├──# ├──
This├──
directory├──
contains all├──
the srcfunction prototypes and definitions included in this API.
│ ├──
├──
├──
c-binding#
C style API Sourcedefinitions for unit-testingexternal use│ ├──
├── ├──
├──
├──
inc ├──
-- drmaa2.cpp#
API definitions
│ ├──
├──
├──
├──
-- drmaa2.h
Internal
include
#
API
files for
unit-testing
and declaration
│ ├──
m4
├──
├──
cpp-binding
#
CPP style class definitions for external use
│ ├──├──
├──
-- drmaa2.hpp
GNU m4 macros required for DRMAAv2
#
Class│
level declaration
|├──
doc
├──
src#
Core infrastructure source
files
|├──
├──
inc#
Core infrastructure internal include files
|├──
├──
m4 Doxygen and man pages │ -- Doxygen.in#
GNU m4 macros required for DRMAAv2
|├──
├──
docs#
Documentation files
|├──
├──
├──
man Doxygen configure file │ -- configure.ac#
Man pages
|├──
├──
├──
-- Doxygen.in#
Doxygen configure file
|├──
├──
test
Existing configure.ac is updated with DRMAAv2 configs
Directory structure in target
├── ...
├── $(PBS_EXEC)│#
Testing
|├──
lib
│ ├──
├──├──
libdrmaav2.so unittesting(using CppUnit).
#
White-box testing
|
├──
├──
├── benchmarks│ ├──
include
# Placeholder for Load and stress tests
Directory structure in target
├── ...
├──
$(DRMAAV2_LIB)
│ ├── ├──
drmaav2.hlibdrmaav2.so
├──
$(DRMAAV2_INCLUDE)
│ ├──
Dependent packages
PBSPro - libdrmaav2.so needs libpbs.so library for IFL calls
c-binding
│ ├──
├──
drmaa2.h
│ ├──
cpp-binding
│ ├──
├──
drmaav2.hpp
Dependent packages
PBSPro - libdrmaav2.so needs libpbs.so library for IFL calls
cppunit - for unittesting
doxygen - for generating docs
Compiling DRMAA2 applications for PBS Pro
It is assumed that libdrmaa2.so or libdrmaa2.a is installed as follows prior to compiling a DRMAA2 application.
rpm --install <rpm for libdrmaav2 for PBS Pro>libdrmaav2>
Example: rpm --install libdrmaav2_pbspro-1.0-17.x86_64.rpm
By default this will install the library to /usr/lib/libdrmaa2.*(so or a) and the headers are installed at /usr/include/drmaa2.
Now DRMAA2 application can be compiled as follows.
...
We also need to set the following before starting the application if in case we are using shared library.
export LD_LIBRARY_PATH=/usr/lib/libdrmaa2.so ./<drmaa2_app>
APIs defined in DRMAAv2 specification
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Code Block | ||||||||
| ||||||||
#include <drmaa2/c-binding/drmaa2.h>
...
...
void main() {
...
...
} |
Now DRMAA2 application can be compiled and run as follows.
gcc <drmaa2_app>.c -ldrmaa2 -o <drmaa2_app>
./<drmaa2_app>
IFL call mapping with C-Style and CPP-style binding
C-Style Binding | CPP-Style Binding | IFL calls |
---|---|---|
void | delete jobSession; | N/A |
void | delete reservationSession; | N/A |
void | delete job; | N/A |
void | delete jobArray; | N/A |
void | delete reservation; | N/A |
drmaa2_string | reservationSession.getContact() | N/A |
drmaa2_string | reservationSession.getSessionName() | N/A |
drmaa2_r | reservationSession.getReservation() | pbs_statresv |
drmaa2_r | reservationSession.requestReservation() | pbs_submit_resv |
drmaa2_r_list | reservationSession.getReservations() | pbs_statresv |
drmaa2_string | reservation.getId() | N/A |
drmaa2_string | reservation.getId() | N/A |
drmaa2_rtemplate | reservation.getReservationTemplate() | N/A |
drmaa2_rinfo | reservation.getReservationInfo() | pbs_statresv |
drmaa2_error | reservation.terminate() | pbs_delresv |
drmaa2_string | jobArray.getId() | N/A |
drmaa2_j_list | jobArray.getJobs() | pbs_selectjob |
drmaa2_string | jobArray.getSessionName() | N/A |
drmaa2_jtemplate | jobArray.getJobTemplete() | N/A |
drmaa2_error | jobArray.suspend() | pbs_sigjob |
drmaa2_error | jobArray.resume() | pbs_sigjob |
drmaa2_error | jobArray.hold() | pbs_holdjob |
drmaa2_error | jobArray.release() | pbs_rlsjob |
drmaa2_error | jobArray.terminate() | pbs_deljob |
drmaa2_string | jobSession.getContact() | N/A |
drmaa2_string | jobSession.getSessionName() | N/A |
drmaa2_string_list | jobSession.getJobCategeries() | N/A |
drmaa2_j_list | jobSession.getJobs() | pbs_selectjob |
drmaa2_jarray | jobSession.getJobArray() | pbs_selectjob |
drmaa2_j | jobSession.runJob() | pbs_runjob |
drmaa2_jarray | jobSession.runBulkJobs() | pbs_runjob |
drmaa2_j | jobSession.waitAnyStarted() | pbs_selectjob |
drmaa2_j | jobSession.waitAnyTerminated() | pbs_selectjob |
drmaa2_string | job.getId() | N/A |
drmaa2_string | job.getSessionName | N/A |
drmaa2_jtemplate | job.getJobTemplete() | N/A |
drmaa2_error | job.suspend() | pbs_sigjob |
drmaa2_error | job.resume() | pbs_sigjob |
drmaa2_error | job.hold() | pbs_holdjob |
drmaa2_error | job.resume() | pbs_rlsjob |
drmaa2_error | job.terminate() | pbs_deljob |
drmaa2_jstate | job.getState() | N/A |
drmaa2_jinfo | job.getInfo() | N/A |
drmaa2_error | job.waitStarted() | pbs_selectjob |
drmaa2_error | job.waitTerminated() | pbs_selectjob |
drmaa2_r_list | monitoringSession.getAllReservations() | pbs_statresv |
drmaa2_j_list | monitoringSession.getAllJobs() | pbs_selectjob |
drmaa2_queueinfo_list | monitoringSession.getAllQueues() | pbs_statque |
drmaa2_machineinfo_list | monitoringSession.getAllMachines() | pbs_statnode |
drmaa2_string | sessionManager.getDrmsName() | N/A |
drmaa2_version | sessionManager.getDrmsVersion() | N/A |
drmaa2_string | sessionManager.getDrmaaName() | N/A |
drmaa2_version | sessionManager.getDrmaaName() | N/A |
drmaa2_bool | sessionManager.supports() | N/A |
drmaa2_jsession | sessionManager.createJobSession() | N/A |
drmaa2_rsession | sessionManager.createReservationSession() | N/A |
drmaa2_jsession | sessionManager.openJobSession() | N/A |
drmaa2_rsession | sessionManager.openReservationSession() | N/A |
drmaa2_msession | sessionManager.openMonitoringSession | N/A |
drmaa2_error | sessionManager.closeJobSession() | N/A |
drmaa2_error | sessionManager.closeReservationSession() | N/A |
drmaa2_error | sessionManager.closeMonitoringSession() | N/A |
drmaa2_error | sessionManager.destroyJobSession() | N/A |
drmaa2_error | sessionManager.closeReservationSession() | N/A |
drmaa2_string_list | sessionManager.getJobSessionNames() | N/A |
drmaa2_string_list | sessionManager.getReservationSessionNames() | N/A |
drmaa2_error | sessionManager.registerEventNotification() | N/A |
CPP-Style binding
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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 Returns: ReservationTemplate& reservationTemplate_) = 0; virtual const ReservationList& getReservations(void) NULL= and0; also}; sets sets drmaa2_lasterror_v to DRMAA2_INVALID_SESSION error if fails DRMAA2_SUCCESS if succeedsclass JobSession { public: virtual ~JobSession(void); drmaa2_dict drmaa2_dict_create (const drmaa2_dict_entryfree callback) virtual const string& getContact(void) const = 0; Thisvirtual functionconst creates a drmaa dictionary. string& getSessionName(void) const = 0; virtual const Parameters: StringList getJobCategories(void) const = 0; virtual const JobList& getJobs(const callback - Call back function to call when free is called. Side-Effects: none JobInfo& filter_) = 0; virtual const JobArray& getJobArray(const string& jobArrayId_) = 0; virtual const string& runJob(const JobTemplate& jobTemplate_) = 0; virtual const Returns: JobArray& runBulkJobs(const JobTemplate& jobTemplate_, drmaa2_dict const long drmaa2beginIndex_error drmaa2_dict_del (drmaa2_dict d, const long endIndex_, const charlong *step_, key) This function deletes the entryconst withlong specifiedmaxParallel_) key= from0; the dictionary. virtual const Job& waitAnyStarted(const JobList& jobs_const, Parameters: dconst -TimeAmount Pointertimeout_) to= drmaa0; dict virtual const Job& waitAnyTerminated(const JobList& jobs_, key - pointer to key string const TimeAmount timeout_) Side-Effects: none= 0; }; class MonitoringSession { public: virtual ~MonitoringSession(void); virtual const Returns: MachineInfoList& getAllMachines(list<string> machines_) = 0; virtual const drmaa2_error ReservationList& getAllReservations(void) = 0; virtual const Return values: JobList& getAllJobs(JobInfo& filter_) = 0; virtual const QueueInfoList& getAllQueues(list<string> DRMAA2queues_INVALID_ARGUMENT) = 0; }; void drmaa2_dict_free (drmaa2_dict * dRef)class SessionManager { private: SessionManager(); public: This function frees a drmaa/** dict. * SessionManager as singleton Parameters: */ static SessionManager& dRefgetInstance() -= Pointer0; to drmaapublic: dict virtual ~SessionManager(void); Side-Effects: nonevirtual const string& getDrmsName(void) const = 0; virtual const Version& getDrmsVersion(void) const = Returns:0; virtual const Version& getDrmaaVersion(void) const = 0; void constvirtual char* drmaa2_dict_get bool supports(const DrmaaCapability& drmaa2capability_dict) d,= const0; char * key) virtual const JobSession& createJobSession(const string& ThissessionName_, function gets the key's value from the dictionary. const string& contact_) = Parameters:0; virtual const JobSession& openJobSession(const string& sessionName_) = d0; - Pointer to drmaa dictvirtual void closeJobSession(JobSession& session_) = 0; virtual void key - pointer to key stringdestroyJobSession(const string& sessionName_) = 0; virtual const Side-Effects: noneReservationSession& createReservationSession( const string& sessionName_, const Returns: string& contact_) = 0; virtual const ReservationSession& openReservationSession( char * drmaa2_bool drmaa2_dict_has (const drmaa2_dict d, const char * keystring& sessionName_) = 0; virtual This function checks for the presence of key in the dictionary. void closeReservationSession(ReservationSession& session_) = 0; void destroyReservationSession(const string& sessionName_) = 0; Parameters: virtual const MonitoringSession& openMonitoringSession( d - Pointer to drmaa dictconst string& contact_) = 0; virtual void key - pointer to key stringcloseMonitoringSession(MonitoringSession& session_) = 0; virtual const StringList& getReservationSessionNames(void) = 0; Side-Effects: none virtual const StringList& getJobSessionNames(void) = 0; }; Returns: drmaa2_bool |
C-Style binding APIs definition
Note: APIs are as defined in https://www.ogf.org/documents/GFD.230.pdf
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
typedef const char * drmaa2_string; typedef struct drmaa2_list_s * drmaa2_list; typedef struct drmaa2_list_s * drmaa2_string_list; typedef struct drmaa2_dictlist_lists (const* drmaa2_j_dictlist; d)typedef struct drmaa2_list_s This function returns a drmaa list of keys in the dictionary. Parameters: d - Pointer to drmaa dict Side-Effects: none Returns: drmaa2_string_list drmaa2_error drmaa2_dict_set (drmaa2_dict d, const char * key, const char * val) This function sets the key value pair to the dictionary. Parameters: * drmaa2_queueinfo_list; typedef struct drmaa2_list_s * drmaa2_machineinfo_list; typedef struct drmaa2_list_s * drmaa2_slotinfo_list; typedef struct drmaa2_list_s * drmaa2_r_list; typedef struct drmaa2_dict_s * drmaa2_dict; typedef drmaa2_jinfo_s * drmaa2_jinfo; typedef drmaa2_slotinfo_s * drmaa2_slotinfo; typedef drmaa2_rinfo_s * drmaa2_rinfo; typedef drmaa2_jtemplate_s * drmaa2_jtemplate; typedef drmaa2_rtemplate_s * drmaa2_rtemplate; typedef drmaa2_notification_s * drmaa2_notification; typedef drmaa2_queueinfo_s * drmaa2_queueinfo; typedef drmaa2_version_s * drmaa2_version; typedef drmaa2_machineinfo_s * drmaa2_machineinfo; typedef struct drmaa2_jsession_s * drmaa2_jsession; typedef struct drmaa2_rsession_s * drmaa2_rsession; typedef struct drmaa2_msession_s * drmaa2_msession; typedef struct drmaa2_j_s * drmaa2_j; typedef struct drmaa2_jarray_s * drmaa2_jarray; typedef struct drmaa2_r_s * drmaa2_r; d -/** Pointer Note to: drmaaNames dictending with _s are forward declaration **/ |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
typedef enum drmaa2_jstate { key - pointer to keyDRMAA2_UNDETERMINED string val - pointer to= value string0, DRMAA2_QUEUED Side-Effects: none = Returns: 1, DRMAA2_QUEUED_HELD drmaa2_error Return values: = 2, DRMAA2_RUNNING DRMAA2_INVALID_ARGUMENT DRMAA2_SUCCESS drmaa2_string drmaa2_get_drmaa_name (void) drmaa2_get_drmaa_name - returns the DRM application name = 3, DRMAA2_SUSPENDED Parameters: -= void 4, DRMAA2_REQUEUED Side-Effects: none = Returns:5, DRMAA2_REQUEUED_HELD drmaa2_string drmaa2_version drmaa2_get_drmaa_version (void) = 6, drmaa2_get_drmaa_version - returns the DRM application versionDRMAA2_DONE Parameters: = 7, - void DRMAA2_FAILED Side-Effects: none = 8 Returns: } drmaa2_jstate; /** Note : Refer DRMAA State Model in drmaa2_version specfication **/ |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
drmaa2_stringerror drmaa2_get_drms_name (voidclose_jsession (drmaa2_jsession js_) drmaa2_getclose_drms_namejsession - returnscloses the DRM system name drmaa2_job session pointed by js Parameters: js_ - voidpointer to drmaa2_job session which needs to be Side-Effects:closed none Side-Effects: none Returns: drmaa2_stringerror - returns drmaa2DRMAA2_version drmaa2_get_drms_version (void) drmaa2_get_drms_version - returns the DRM system version SUCCESS if successful DRMAA2_INVALID_SESSION if session is invalid drmaa2_error Parameters: drmaa2_close_msession (drmaa2_msession ms_) Dis-associates monitoring session -from voidDRMS. Should be callable only once else it should Side-Effects: none return DRMAA2_INVALID_SESSION error. Parameters: Returns: ms_ - pointer to drmaa2 monitoring session created drmaa2_versionearlier. drmaa2_string drmaa2_get_instance_value (const void * instance, const char * name)Side-Effects: none drmaa2_string_list drmaa2_get_jsession_names (void) Returns: drmaa2_get_jsession_names - returns theDRMAA2_SUCCESS listif ofsucceeds drmaa2_jobNULL sessionsand also sets sets drmaa2_lasterror_v to DRMAA2_INVALID_SESSION error if Side-Effects:fails none drmaa2_error drmaa2_close_rsession (drmaa2_rsession rs_) Disassociates reservation session Returns:from DRMS. Should be callable only once else it should return drmaa2DRMAA2_stringINVALID_list - returns list of job session names availableSESSION error. Parameters: drmaa2_string_list drmaa2_get_rsession_names (void) Getrs_ a- listpointer ofto alldrmaa2 reservation session created namesearlier. Side-Effects: none Returns: drmaa2DRMAA2_string_listSUCCESS if succeeds NULL and also sets sets drmaa2_lasterror_v Return values: to DRMAA2_INVALID_SESSION error if fails drmaa2_jsession drmaa2_create_jsession (const char NULL - If there are no existing reservation sessions · If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_j_free (drmaa2_j * j)* session_name_, const char * contact_) Creates a drmaa2 job session for a given name and contact. Parameters: drmaa2_j_free - frees the drmaa2_job structure pointed by j session_name_ - Name of the session . Parameters: jcontact_ - pointerDRMS toname. drmaa2_job Side-Effects: none Returns: Returns: drmaa2_jsession if succeeds NULL if fails and sets drmaa2_lasterror_v to voidDRMAA2_INVALID_ARGUMENT error. drmaa2_stringrsession drmaa2_jcreate_get_idrsession (const drmaa2_j j) char * session_name_, const char * contact_) Creates a drmaa2 reservation session drmaa2_j_get_id() - Returns newly allocated drmaa2_job id stringfor a given name and contact. Parameters: jsession_name_ - pointerName toof drmaa2_jobthe structuresession. Side-Effects: nonecontact_ - DRMS name. Side-Effects: none Returns: drmaa2_stringjsession if -succeeds GetsNULL theif jobfails idand fromsets drmaa2_jobDRMAA2_INVALID_ARGUMENT error. drmaa2_jinfostring drmaa2_jdescribe_get_infoattribute (const drmaa2_j j) void * instance, const char * name) drmaa2_error drmaa2_destroy_jsession (const char * drmaa2session_jname_get_info() - Gets drmaa2_destroy_jobjsession info- structuredestroys from the drmaa2_job session inpointed drmaa2_j structure.by js Parameters: jsession_name_ - pointer to drmaa2_job structure. session which needs to be closed Side-Effects: none @return Returns: DRMAA2_SUCCESS if successful drmaa2_jinfo - returns drmaa2DRMAA2_INVALID_jinfoARGUMENT if successful session name is invalid drmaa2_jtemplateerror drmaa2_jdestroy_get_jtrsession (const drmaa2_j j char * session_name_) Reaps the persisted drmaa2_j_get_jt() - Returns pointer of drmaa2_job template structure from Jobor cached state information for the given session name. Parameters: jsession_name_ - pointerName toof drmaa2_jobthe structuresession. Side-Effects: none Returns: drmaa2DRMAA2_stringSUCCESS if - Gets the job template from drmaa2_jobsuccessful DRMAA2_INVALID_ARGUMENT if session name is invalid drmaa2_stringdict drmaa2_j_get_session_namedict_create (const drmaa2_jdict_entryfree jcallback) This function creates drmaa2_j_get_session_name() - Returns newly allocated session name string a drmaa dictionary. Parameters: Parameters: callback - Call back function to jcall -when pointerfree to drmaa2_job structureis called. Side-Effects: none Returns: drmaa2_string - gets the session name fromdict drmaa2_session error drmaa2_jstate drmaa2_j_get_statedict_del (const drmaa2_jdict jd, const drmaa2_stringchar * substatekey) This function deletes drmaa2_j_get_state() - Gets drmaa2_job state the entry with specified key from the drmaa2_job in drmaa2_j structuredictionary. Parameters: jd - pointerPointer to drmaa2_job structure.drmaa dict substatekey - state of the drmaa2_job in drmaa2_j structurepointer to key string Side-Effects: none Returns: Returns:drmaa2_error - DRMAA2_SUCCESS drmaa2_jstate - returns current· drmaa2DRMAA2_INVALID_jobARGUMENT state void drmaa2_error drmaa2_j_holddict_free (drmaa2_jdict * jdRef) This function frees drmaa2_j_hold() - Holds the drmaa2_job in drmaa2_j structurea drmaa dict. Parameters: jdRef - pointerPointer to drmaa2_job structure.drmaa dict Side-Effects: none Returns: Returns: void const char* drmaa2_error - Returns DRMAA2_SUCCESS on success Returns DRMAA2_INVALID_STATE if job state is invalid for hold drmaa2_error drmaa2_j_release (drmaa2_j jdict_get (const drmaa2_dict d, const char * key) This function gets drmaa2_j_release() - Releases the drmaa2_job in drmaa2_j structurethe key's value from the dictionary. Parameters: jd - pointerPointer to drmaa2_job structure.drmaa dict Side-Effects: none key - pointer to key string ReturnsSide-Effects: none Returns: drmaa2_error - Returns DRMAA2_SUCCESS on success Returns DRMAA2_INVALID_STATE if job statechar is invalid* for release drmaa2_errorbool drmaa2_jdict_resumehas (const drmaa2_j j) dict d, const char * key) drmaa2_j_resume() - Resumes the drmaa2_job in drmaa2_j structureThis function checks for the presence of key in the dictionary. Parameters: jd - pointerPointer to drmaa2_job structure.drmaa dict Side-Effects: none key - pointer to key string Returns: Side-Effects: none drmaa2_error - Returns: DRMAA2_SUCCESS on success Returns DRMAA2_INVALID_STATE if job state is invalid for resumedrmaa2_bool drmaa2_string_errorlist drmaa2_jdict_suspendlist (const drmaa2_jdict jd) This function returns drmaa2_j_suspend() - Suspends the drmaa2_job in drmaa2_j structurea drmaa list of keys in the dictionary. Parameters: jd - pointerPointer to drmaa2_job structure.drmaa dict Side-Effects: none Returns: drmaa2_string_list drmaa2_error Returns: drmaa2_dict_set (drmaa2_dict d, const char * key, const char * val) drmaa2_error - Returns DRMAA2_SUCCESS on success Returns DRMAA2_INVALID_STATE if job state is invalid for suspend drmaa2_error drmaa2_j_terminate (drmaa2_j j)This function sets the key value pair to the dictionary. Parameters: d - Pointer to drmaa dict drmaa2_j_terminate() - Terminates the drmaa2_job in drmaa2_j structure. key - pointer to key Parameters:string jval - pointer to drmaa2_job structure.value string Side-Effects: none Returns: drmaa2_error - Returns DRMAA2_SUCCESS on success drmaa2_error drmaa2_j_wait_started (const drmaa2_j j, const· timeDRMAA2_INVALID_tARGUMENT timeout) drmaa2_string drmaa2_get_drmaa_name (void) drmaa2_jget_waitdrmaa_started()name - Blocksreturns till the drmaa2_jobDRM isapplication startedname or till timeout expires Parameters: j - pointervoid to drmaa2_job structure. Side-Effects: none timeout - Timeout in time_t format. · Side-Effects: none Returns: drmaa2_string Returns: drmaa2_version drmaa2_get_drmaa_version (void) drmaa2_get_errordrmaa_version - returns DRMAA2_SUCCESS if successful returns DRMAA2_TIMEOUT if timeout happened the DRM application version Parameters: drmaa2_error drmaa2_j_wait_terminated (const drmaa2_j j, const time_t timeout) - void drmaa2_j_wait_terminated() - Blocks till the drmaa2_job is terminated or till timeout expires Side-Effects: none Returns: Parameters: drmaa2_version drmaa2_string drmaa2_get_drms_name (void) j - pointer to drmaa2_job structure. get_drms_name - returns the DRM system name timeout - TimeoutParameters: in time_t format. Side-Effects: void none Side-Effects: none Returns: drmaa2_errorstring - returns DRMAA2_SUCCESS if successful returns DRMAA2_TIMEOUT if timeout happened voiddrmaa2_version drmaa2_jarrayget_drms_freeversion (drmaa2_jarray * javoid) drmaa2_jarrayget_drms_freeversion - freesreturns the drmaa2_jobDRM array structure pointed by jasystem version Parameters: ja - pointer to DRMAA jo arrayvoid Side-Effects: none Returns: voiddrmaa2_version drmaa2_string drmaa2_jarray_get_id (const drmaa2_jarray ja) drmaa2_jarray_get_id() Gets the id from drmaa2 drmaa2_job array. Parameters: get_instance_value (const void * instance, const char * name) drmaa2_string_list drmaa2_get_jsession_names (void) jadrmaa2_get_jsession_names - returns the pointerlist toof drmaa2_job arraysessions Side-Effects: none Returns: Returns: drmaa2_string_list - returns list of job session names available drmaa2_stringNULL -and joblast iderror of drmaa2_job arrayis set drmaa2_jtemplatestring_list drmaa2_jarray_get_jobrsession_templatenames (constvoid) drmaa2_jarray ja) Get drmaa2_jarray_get_job_template - returns the drmaa2_job template used to submit the drmaa2_job array. a list of all reservation session names. Side-Effects: none Parameters: Returns: ja - pointer to drmaa2_job array Side-Effects: none string_list - list of reservation sessions NULL - If there are no existing reservation sessions Returns: · If this feature is not supported, set drmaa2_jtemplatelasterror_v - returns job template from drmaa2_job arrayto DRMAA2_UNSUPPORTED_OPERATION void drmaa2_j_listfree (drmaa2_jarray_get_jobs (const drmaa2_jarray jaj * j) drmaa2_jarray_get_jobs() Returns the list of jobs inj_free - frees the drmaa2_job structure pointed arrayby structure.j Parameters: jaj - Pointerpointer to drmaa2_job array structure Side-Effects: none Returns: Returns: void drmaa2_string drmaa2_j_list - gets list of drmaa2_jobs from drmaa2_jarrayget_id (const drmaa2_j j) drmaa2_string drmaa2_jarray_get_session_name (const drmaa2_jarray ja) drmaa2_jarrayj_get_session_nameid() - getsReturns the session name in which thenewly allocated drmaa2_job arrayid is submittedstring Parameters: jaj - pointer to drmaa2_job arraystructure. Side-Effects: none Returns: Returns: drmaa2_string - Gets the job id from drmaa2_stringjob NULL - if returnsfails session name from drmaa2_job arrayand DRMAA2_INVALID_ARGUMENT error is set drmaa2_errorjinfo drmaa2_jarrayj_get_holdinfo (const drmaa2_jarrayj jaj) drmaa2_j_jarrayget_holdinfo() - holds Gets drmaa2_job info structure from the drmaa2_job array in drmaa2_j structure. Parameters: jaj - pointer to drmaa2_job arraystructure. Side-Effects: none Returns: drmaa2_errorjinfo - returns DRMAA2drmaa2_SUCCESSjinfo if successful returns NULL - if fails and DRMAA2_INVALID_STATE if job state not valid for holdARGUMENT error is set drmaa2_errorjtemplate drmaa2_jarrayj_get_releasejt (const drmaa2_jarrayj jaj) drmaa2_jarray_releasej_get_jt() - Returns releasespointer theof drmaa2_job array template structure from Job. Parameters: jaj - pointer to drmaa2_job arraystructure. Side-Effects: none Returns: Returns: drmaa2_string - gets the session name from drmaa2_errorsession NULL - returns DRMAA2_SUCCESS if successfulfails returnsand DRMAA2_INVALID_STATEARGUMENT iferror job state not valid for releaseis set drmaa2_errorstring drmaa2_j_get_jarraysession_resumename (const drmaa2_jarrayj jaj) drmaa2_jarray_resumej_get_session_name() - Returns resumesnewly allocated thesession drmaa2_jobname arraystring Parameters: jaj - pointer to drmaa2_job arraystructure. Side-Effects: none none Returns: drmaa2_errorstring - returns DRMAA2_SUCCESS gets the session name from drmaa2_session NULL - if successfulfails returnsand DRMAA2_INVALID_STATEARGUMENT iferror job state not valid for resumeis set drmaa2_errorjstate drmaa2_j_jarrayget_suspendstate (const drmaa2_j j, drmaa2_jarraystring * jasubstate) drmaa2_j_jarrayget_suspendstate() - suspendsGets drmaa2_job state from the drmaa2_job array in drmaa2_j structure. Parameters: jaj - pointer to drmaa2_job array structure. substate Side-Effects: none- state of the drmaa2_job in drmaa2_j structure Side-Effects: none Returns: drmaa2_errorjstate - returns DRMAA2_SUCCESS if successful returns DRMAA2_INVALID_STATE if current drmaa2_job state not valid for suspend drmaa2_error drmaa2_jarrayj_terminatehold (drmaa2_jarrayj jaj) drmaa2_jarrayj_terminatehold() - terminatesHolds the drmaa2_job array in drmaa2_j structure. Parameters: jaj - pointer to drmaa2_job arraystructure. Side-Effects: none Returns: drmaa2_error - returnsReturns DRMAA2_SUCCESS on success DRMAA2_INVALID_STATE if successful job state is invalid for hold drmaa2_jinfoerror drmaa2_jinfoj_createrelease (voiddrmaa2_j j) drmaa2_jinfoj_createrelease() - createsReleases athe drmaa2_job infoin drmaa2_j structure. and returns its pointer Parameters: Side-Effects: none j - pointer to drmaa2_job structure. Returns: Side-Effects: none Returns: drmaa2_jinfo - pointer to newly allocated drmaa2_jinfo structure NULLerror - ifReturns allocationDRMAA2_SUCCESS failson andsuccess DRMAA2_OUT_OF_RESOURCE error is setINVALID_STATE if job state is invalid for release voiddrmaa2_error drmaa2_jinfoj_freeresume (drmaa2_jinfoj j) * jiRef) drmaa2_jinfoj_freeresume() - freesResumes the drmaa2_job in infodrmaa2_j structure and its inner data types. Parameters: jiRefj - pointer to drmaa2_job info structure. Side-Effects: none Returns: drmaa2_error - Returns: DRMAA2_SUCCESS on success DRMAA2_INVALID_STATE if job state is invalid for resume void drmaa2_error drmaa2_stringj_listsuspend (drmaa2_jinfo_impl_spec (void)j j) drmaa2_jinfo_impl_specj_suspend() - ListsSuspends the drmaadrmaa2_job specin implementations supported for job info (e.g. drmaa, drmaa2)drmaa2_j structure. Side-Effects: none Parameters: Returns: j - pointer to drmaa2_string_listjob structure. Return valuesSide-Effects: none Returns: list of drmaa spec implementations supported drmaa2_error - Returns DRMAA2_SUCCESS on success DRMAA2_INVALID_STATE NULLif -job Ifstate thisis featureinvalid isfor notsuspend supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION voiddrmaa2_error drmaa2_jsessionj_freeterminate (drmaa2_jsession * js)j j) drmaa2_jsession_free Freesj_terminate() - Terminates the memorydrmaa2_job ofin Job session pointed by jsdrmaa2_j structure. Parameters: jsj - pointer to drmaa2_jsessionjob structure. Side-Effects: none Returns: drmaa2_error - Returns: DRMAA2_SUCCESS on success DRMAA2_INVALID_STATE if job state is invalid for terminate void drmaa2_stringerror drmaa2_jsessionj_getwait_contactstarted (const drmaa2_jsession js)_j j, const time_t timeout) drmaa2_jsessionj_getwait_contactstarted() - ReturnsBlocks till the DRMS name of the drmaa2_job sessiondrmaa2_job is started or till timeout expires Parameters: jsj - pointer to drmaa2_job sessionstructure. timeout Side-Effects: none - Timeout in time_t format. Side-Effects: none Returns: drmaa2_stringerror - returns the DRMS name from drmaa2_jsession DRMAA2_SUCCESS if successful DRMAA2_TIMEOUT if timeout happened drmaa2_jarrayerror drmaa2_jsessionj_getwait_job_arrayterminated (const drmaa2_jsessionj jsj, const drmaa2time_stringt jobarrayIdtimeout) drmaa2_jsessionj_get_job_arraywait_terminated() - returnsBlocks till the specifieddrmaa2_job jobis arrayterminated fromor thetill drmaa2_jobtimeout sessionexpires Parameters: jsj - pointer to drmaa2_job sessionstructure. jobarrayIdtimeout - JobTimeout arrayin id which needs to be retrievedtime_t format. Side-Effects: none Returns: drmaa2_jarrayerror - returns pointer to drmaa2_jarray with specified jobarrayId in the job sessionDRMAA2_SUCCESS if successful DRMAA2_TIMEOUT if timeout happened void drmaa2_stringjarray_listfree (drmaa2_jsession_get_job_categories (const drmaa2_jsession jsjarray * ja) drmaa2_jsession_get_job_categoriesjarray_free - returnsfrees the string list of drmaa2_job categoriesarray instructure thepointed drmaa2_jobby sessionja Parameters: jsja - pointer to DRMAA drmaa2_jobjo sessionarray Side-Effects: none Returns: drmaa2_string_listvoid - returns list of job categories from drmaa2_jsessionstring drmaa2_j_list drmaa2_jsessionjarray_get_jobsid (const drmaa2_jsession js, const drmaa2_jinfo filterjarray ja) drmaa2_jsessionjarray_get_jobsid() -Gets returnsthe listid of jobs in thefrom drmaa2 drmaa2_job session matching the jobinfo filterarray. Parameters: jsja - pointer to drmaa2_job session js filter - filter for getting jobs with specific conditionsarray Side-Effects: none Returns: Returns: drmaa2_string - job id of drmaa2_j_listjob -array returnsNULL list- ofif jobsfails matching the drmaa2_job filter providedand DRMAA2_INVALID_ARGUMENT error is set drmaa2_stringjtemplate drmaa2_jsessionjarray_get_sessionjob_nametemplate (const drmaa2_jsessionjarray jsja) drmaa2_jsessionjarray_get_sessionjob_nametemplate - returns the session name fromdrmaa2_job template used to submit the drmaa2_job sessionarray. Parameters: jsja - pointer to drmaa2_job sessionarray Side-Effects: none Returns: Returns: drmaa2_jtemplate - returns job template from drmaa2_job array NULL - drmaa2_stringif -fails returns session name from drmaa2_jsessionand DRMAA2_INVALID_ARGUMENT error is set drmaa2_jarrayj_list drmaa2_jsessionjarray_run_bulkget_jobs (const drmaa2_jsession js_, const drmaa2_jtemplate jt_, unsigned long begin_index_, unsigned long end_index_, unsigned long step_, unsigned long jarray ja) drmaa2_jarray_get_jobs() Returns the list of jobs in the drmaa2_job array structure. Parameters: ja - Pointer to drmaa2_job array structure Side-Effects: none Returns: max_parallel_) drmaa2_j_list - Writegets descriptionlist of function here. Parameters: drmaa2_jobs from drmaa2_jarray NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_string drmaa2_jarray_get_session_name (const drmaa2_jarray ja) js_ - pointer to drmaa2_job session jt_ - Job template to be considered or usedjarray_get_session_name - gets the session name in which the drmaa2_job array is submitted Parameters: begin_index_ja - Startingpointer index ofto drmaa2_job array Side-Effects: none end_index_ - Ending index of drmaa2_job arrayReturns: stepdrmaa2_string - Incrementreturns between each jobs max_parallel_ - Maximum parallel jobs to run Side-Effects: none session name from drmaa2_job array NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_error drmaa2_jarray_hold (drmaa2_jarray ja) drmaa2_jarray_hold - holds the drmaa2_job array ReturnsParameters: drmaa2_jarrayja - returns pointer to drmaa2_jarrayjob ifarray successful returns NULL and sets last error to DRMAA2_INVALID_ARGUMENT if any argument is invalid returns NULL and sets last error to Side-Effects: none Returns: DRMAA2_INTERNALSUCCESS if anysuccessful internaldrmaa2_error errorif occursfails drmaa2_jerror drmaa2_jsessionjarray_run_jobrelease (const drmaa2_jsession js_, const drmaa2_jtemplate jt_jarray ja) drmaa2_jsessionjarray_run_jobrelease - runs job in the job session withreleases the drmaa2_job templatearray specified Parameters: js_ja - pointer to drmaa2_job sessionarray Side-Effects: none jt_ - Job template that needs toReturns: be run Side-Effects: none DRMAA2_SUCCESS if successful drmaa2_error if fails drmaa2_error drmaa2_jarray_resume (drmaa2_jarray ja) Returns: drmaa2_jarray_resume - resumes the drmaa2_job array drmaa2_j - returns pointer to jobParameters: which is newly started in the job session returns NULL and setsja last- errorpointer to DRMAA2drmaa2_INVALID_ARGUMENTjob ifarray any argument is invalid returns NULL and sets Side-Effects: none Returns: last error to DRMAA2_INVALID_SESSION if session name is invalid DRMAA2_SUCCESS if successful drmaa2_j drmaa2_jsession_wait_any_started (const drmaa2_jsession js, const drmaa2_j_list l, const time_t timeouterror if fails drmaa2_error drmaa2_jarray_suspend (drmaa2_jarray ja) drmaa2_jsession_wait_any_startedjarray_suspend - blockssuspends till the drmaa2_job array in the drmaa2_job session started orParameters: till the time out ja Parameters:- pointer to drmaa2_job array js Side- pointer to drmaa2_job session Effects: none Returns: l -DRMAA2_SUCCESS listif ofsuccessful drmaa2_jobserror if fails drmaa2_error drmaa2_jarray_terminate (drmaa2_jarray ja) timeout - timeout to wait if event has not occurreddrmaa2_jarray_terminate - terminates the drmaa2_job array Side-EffectsParameters: none ja - pointer to drmaa2_job array Returns: Side-Effects: none drmaa2_j - returns pointer toReturns: drmaa2_job which started returns NULL and last error is set to DRMAA2_TIMEOUTSUCCESS if timeoutsuccessful happensdrmaa2_error if fails drmaa2_j drmaa2_jsession_wait_any_terminated (const drmaa2_jsession js, const jinfo drmaa2_jjinfo_list l, const time_t timeout)create (void) drmaa2_jsession_wait_any_terminatedjinfo_create() - blockscreates tilla the drmaa2_job in the drmaa2_job session ended or till the time out info structure and returns its pointer Side-Effects: none ParametersReturns: jsdrmaa2_jinfo - pointer to newly allocated drmaa2_jobjinfo sessionstructure NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is set l - list of drmaa2_jobsvoid drmaa2_jinfo_free (drmaa2_jinfo * jiRef) drmaa2_jinfo_free() - frees timeoutthe -drmaa2_job timeoutinfo tostructure waitand ifits eventinner hasdata not occurstypes Side-EffectsParameters: none jiRef - pointer to drmaa2_job info structure. Returns: Side-Effects: none drmaa2_j - returns pointer to drmaa2_job whichReturns: terminated returns NULL and last error is set to DRMAA2_TIMEOUT if timeoutvoid happens drmaa2_string_jtemplatelist drmaa2_jtemplatejinfo_impl_createspec (void) drmaa2_jinfo_jtemplateimpl_create()spec - creates a drmaa2_job template structure and returns its pointer Lists the drmaa spec implementations supported for job info (e.g. drmaa, drmaa2) Side-Effects: none Returns: drmaa2_string_jtemplatelist - pointerlist of todrmaa drmaa2_jtemplatespec ifimplementations allocatedsupported NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is set If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_jtemplatejsession_free (drmaa2_jtemplatejsession * jtemplatejs) drmaa2_jtemplatejsession_free() -Frees freesthe amemory drmaa2_jobof templateJob structuresession andpointed its inner data typesby js Parameters: jtemplatejs - pointer to drmaa2_job template structurejsession. Side-Effects: none Returns: void drmaa2_string_list drmaa2_jtemplatejsession_implget_speccontact (voidconst drmaa2_jsession js) drmaa2_jtemplatejsession_implget_speccontact - Lists the drmaa spec implementations supported for job template (e.g. drmaa, drmaa2) Returns the DRMS name of the drmaa2_job session Parameters: js - pointer to drmaa2_job session. Side-Effects: none Returns: DRMAA2_SUCCESS if successful drmaa2_string_list Return values:error if fails drmaa2_jarray drmaa2_jsession_get_job_array (const drmaa2_jsession js, const drmaa2_string jobarrayId) drmaa2_jsession_get_job_array - returns the specified job array listfrom ofthe drmaadrmaa2_job specsession implementations supported Parameters: NULL - If this feature is not supported,js set drmaa2_lasterror_v- pointer to DRMAA2drmaa2_UNSUPPORTED_OPERATIONjob session. drmaa2_error drmaa2_lasterror (void) jobarrayId - ThisJob array functionid returnswhich theneeds lastto occurredbe error.retrieved Side-Effects: none Returns: Returns: drmaa2_error drmaa2_jarray - returns pointer to drmaa2_jarray with specified jobarrayId in the job session NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_string_list drmaa2_jsession_lasterrorget_job_textcategories (voidconst drmaa2_jsession js) This functiondrmaa2_jsession_get_job_categories - returns the string list lastof occurreddrmaa2_job errorcategories in string.the drmaa2_job session Side-Effects: none Parameters: js - pointer to drmaa2_job Returns:session Side-Effects: none drmaa2_string - newly allocated string of last errorReturns: NULL - If no error text exists drmaa2_error drmaa2string_list_add (drmaa2_list l, const void * value) This function adds an element to the list. - returns list of job categories from drmaa2_jsession NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_j_list drmaa2_jsession_get_jobs Parameters: (const drmaa2_jsession js, const drmaa2_jinfo filter) ldrmaa2_jsession_get_jobs - Pointerreturns tolist drmaaof listjobs in the drmaa2_job session matching the jobinfo filter value - pointer to the element whichParameters: needs to be inserted js Side-Effects: nonepointer to drmaa2_job session js filter - Returns:filter for getting jobs with specific conditions drmaa2_error Side-Effects: none Return values: Returns: DRMAA2_INVALID_ARGUMENT DRMAA2_OUT_OF_RESOURCE DRMAA2_SUCCESS drmaa2_j_list - returns drmaa2_list_create (const drmaa2_listtype t, constof jobs matching the drmaa2_list_entryfree callback) This function creates a drmaa list. Parameters:job filter provided NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_string drmaa2_jsession_get_session_name (const drmaa2_jsession js) drmaa2_jsession_get_session_name - returns the session name from t - Type of the list which needs to be createddrmaa2_job session. Parameters: callbackjs - Callpointer back function to call when free is called.drmaa2_job session Side-Effects: none Returns: drmaa2_liststring - returns session name drmaa2_errorfrom drmaa2_list_del (drmaa2_list l, long pos) This function deletes an element from the list.jsession NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_jarray drmaa2_jsession_run_bulk_jobs (const Parameters: l - Pointer to drmaa listdrmaa2_jsession js_, const drmaa2_jtemplate jt_, unsigned long begin_index_, unsigned long end_index_, unsigned long step_, unsigned long max_parallel_) pos -Write positiondescription of thefunction here. element which needs to be deleted Parameters: Side-Effects: none js_ - pointer to drmaa2_job session Returns: jt_ - Job template to be considered or drmaa2_errorused Return values: begin_index_ - Starting index of drmaa2_job array DRMAA2_INVALID_ARGUMENT DRMAA2_SUCCESS void drmaa2end_listindex_free (drmaa2_list * l) - Ending index of drmaa2_job array s This function frees a drmaa list step_ - Increment between each Parameters:jobs lmax_parallel_ - Maximum Pointerparallel jobs to drmaarun list Side-Effects: none Returns: Returns: drmaa2_jarray - returns pointer to drmaa2_jarray if successful NULL and voidsets last error to DRMAA2_INVALID_ARGUMENT constif void* drmaa2_list_get (const drmaa2_list l, long index) any argument is invalid NULL and sets last error to DRMAA2_INTERNAL This function gets the element form a particular positionif ofany theinternal list.error occurs drmaa2_j drmaa2_jsession_run_job Parameters: (const drmaa2_jsession js_, const drmaa2_jtemplate jt_) ldrmaa2_jsession_run_job - Pointerruns tojob drmaain listthe job session with the drmaa2_job template specified index - postion from whcih theParameters: data has to be taken js_ - Side-Effects: none pointer to drmaa2_job session jt_ - Job template Returns:that needs to be run void* Side-Effects: pointernone to the element retured as void* NULL - IfReturns: the position is not valid long drmaa2_list_size (const drmaa2_listj l)- returns pointer to job which is newly Thisstarted function returnsin the sizejob ofsession theNULL list.and sets last error to DRMAA2_INVALID_ARGUMENT if any argument Parameters:is invalid NULL and sets last error to l - Pointer to drmaa list DRMAA2_INVALID_SESSION if session name is invalid Side-Effects: none Returns:drmaa2_j drmaa2_jsession_wait_any_started (const drmaa2_jsession js, const drmaa2_j_list l, const time_t timeout) drmaa2_jsession_wait_any_started - blocks till longthe drmaa2_job in the drmaa2_machineinfo drmaa2_machineinfo_create (void) job session started or till the time out drmaa2_machineinfo_create() - creates a drmaa2_machineinfo infoParameters: structure and returns its pointer js - Side-Effects: none pointer to drmaa2_job session l - list of Returns:drmaa2_jobs drmaa2_machineinfotimeout - pointertimeout to newly allocated drmaa2_machineinfo structure NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is set wait if event has not occurred Side-Effects: none void drmaa2_machineinfo_free (drmaa2_machineinfo * miRef) Returns: This function frees thedrmaa2_j pre-allocated returns drmaapointer machineto info structure. Parameters: drmaa2_job which started NULL and last error is set to DRMAA2_TIMEOUT if timeout happens drmaa2_j drmaa2_jsession_wait_any_terminated (const drmaa2_jsession miRefjs, - Pointer to drmaa machine infoconst drmaa2_j_list l, const time_t timeout) Side-Effects: none drmaa2_jsession_wait_any_terminated - blocks till the drmaa2_job in the drmaa2_job session ended or till the time out ReturnsParameters: voidjs - pointer to drmaa2_string_list drmaa2_machineinfo_impl_spec (void)job session l - list of drmaa2_machineinfo_impl_spec - Lists the machine info spec implementations supportedjobs timeout - timeout to Side-Effects: none wait if event has not occurs Returns: Side-Effects: none drmaa2_string_list Returns: Return values: drmaa2_j - returns pointer to drmaa2_job which terminated listNULL ofand machineinfolast specerror implementationsis supportedset to DRMAA2_TIMEOUT if timeout happens drmaa2_jtemplate NULL - If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_msession_free (drmaa2_msession * ms) drmaa2_j_list drmaa2_msession_get_all_jobs (const drmaa2_msession ms_, const drmaa2_jinfo filter_) drmaa2_jtemplate_create (void) drmaa2_jtemplate_create() - creates a drmaa2_job template structure and returns its pointer Side-Effects: none Returns: Returns the list of all jobs i.e. DRMAA2 jobs and the jobs submitted out of DRMAA2 library also. The list or number of jobs returned should adhere to DRMS policies. Ex: The list might be drmaa2_jtemplate - pointer to drmaa2_jtemplate if allocated NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is set void drmaa2_jtemplate_free (drmaa2_jtemplate * jtemplate) limited to contain only the jobs seen by the DRMAA2 user.drmaa2_jtemplate_free() - frees a drmaa2_job template structure and its inner data types Parameters: ms_jtemplate - pointer to drmaa2_msessionjob createdtemplate earlierstructure. filter_ - of type drmaa2_jinfo (through which we can query jobs per jobstate, job owner and per queue etcSide-Effects: none Returns: void Side-Effects: none drmaa2_string_list drmaa2_jtemplate_impl_spec (void) drmaa2_jtemplate_impl_spec - Lists the drmaa spec implementations supported Returns:for job template (e.g. drmaa, drmaa2) drmaa2_j_list if succeeds NULL if failsSide-Effects: none drmaa2_machineinfo_list drmaa2_msession_get_all_machines (const drmaa2_msession ms_, const drmaa2_string_list names_) Returns: drmaa2_string_list Returns- list of drmaa machinesspec orimplementations hostssupported availableNULL for- submittingIf jobsthis infeature theis DRMSnot system.supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION Parameters: drmaa2_error drmaa2_lasterror (void) This function ms_returns pointerthe tolast drmaa2_msession created earlieroccurred error. Side-Effects: none names_ a list of queue names actsReturns: as filter i.e. we fetch info of only these queues. drmaa2_error drmaa2_string Side-Effects: nonedrmaa2_lasterror_text (void) This function returns the last occurred error in string. Returns: Side-Effects: none drmaa2_machineinfo_list if succeeds NULL ifReturns: fails. drmaa2_queueinfo_list drmaa2_msession_get_all_queues (const drmaa2_msession ms_, const drmaa2_string_list names_)- newly allocated string of last error NULL Returns- listIf ofno queueserror availabletext forexists submitting jobs in the DRMS system. Parameters:drmaa2_error drmaa2_list_add (drmaa2_list l, const void * value) This function adds an ms_element pointerto to drmaa2_msession created earlierthe list. Parameters: names_ a list of queue names acts asl filter i.e. we fetch info of only these queues.- Pointer to drmaa list value Side-Effects: nonepointer to the element which needs to be inserted or MT-Safe ReturnsSide-Effects: none drmaa2_queueinfo_list if succeeds NULL if fails.Returns: drmaa2_r_list drmaa2_msession_get_all_reservations (const drmaa2_msession ms_)error - DRMAA2_INVALID_ARGUMENT Returns the list of all advance reservations visible for the user running the DRMAA-based application. The list or number of jobs returned should adhere to DRMS policies. Ex: The list might be limited to contain only the reservations seen by the DRMAA2 user· DRMAA2_OUT_OF_RESOURCE · DRMAA2_SUCCESS drmaa2_list drmaa2_list_create (const drmaa2_listtype t, const drmaa2_list_entryfree callback) This function creates a drmaa list. Parameters: ms_t pointer- toType drmaa2_msessionof createdthe earlierlist which needs to be created Side-Effects: none callback - Call back function to call when free is called. Returns: Side-Effects: none drmaa2_j_list if succeeds NULL if fails Returns: void drmaa2_notification_free (drmaa2_notification * nRef) drmaa2_list This function frees the pre-allocated drmaa notification structure. drmaa2_error drmaa2_list_del (drmaa2_list l, long pos) Parameters:This function deletes an element from the list. nRef - Pointer to drmaaParameters: notification Side-Effects: none l - Pointer to drmaa list Returns:pos - position of the element which needs to be deleted void drmaa2_string_list drmaa2_notification_impl_spec (void) Side-Effects: none drmaa2_notification_impl_spec - ListsReturns: the notification spec implementations supported drmaa2_error Side-Effects: none DRMAA2_INVALID_ARGUMENT Returns: · DRMAA2_SUCCESS void drmaa2_list_free (drmaa2_string_list * l) Return values:s This function frees a drmaa list list of notification specParameters: implementations supported l NULL - If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION drmaa2_jsession drmaa2_open_jsession (const char * session_name_) Pointer to drmaa list Side-Effects: none drmaa2_open_jsession - Opens anReturns: already existing drmaa2_job session void Parameters: const void* drmaa2_list_get (const drmaa2_list l, long index) session_name_ - Session name of the drmaa2_job sessionThis whichfunction needsgets tothe beelement openedform a particular position of the list. Side-Effects: none Parameters: l Returns:- Pointer to drmaa list drmaa2_jsession - returns pointer toindex drmaa2_jsession- forpostion afrom sessionwhcih whichthe isdata alreadyhas presentto be taken drmaa2_msession drmaa2_open_msession (const char * contact_) Side-Effects: none Opens the monitoring session.Returns: Parameters: void* - pointer to the element retured as void* contact_NULL - ContactIf the ofposition theis sessionnot valid long drmaa2_list_size Side-Effects: none(const drmaa2_list l) This function returns the size of the list. Returns: Parameters: drmaa2_msession if the session exists NULL ifl the- sessionPointer doesto notdrmaa existlist and if session name is invalid and also sets drmaa2_lasterror_v to DRMAA2_INVALID_ARGUMENT errorSide-Effects: none drmaa2_rsession drmaa2_open_rsession (const char * session_name_) Returns: Openslong the- previouslysize createdof session.list drmaa2_machineinfo drmaa2_machineinfo_create (void) Parameters: drmaa2_machineinfo_create() - creates a session_name_ - Name of the session.drmaa2_machineinfo info structure and returns its pointer Side-Effects: none Returns: drmaa2_rsessionmachineinfo if- apointer sessionto existsnewly NULLallocated ifdrmaa2_machineinfo thestructure session does not exist andNULL - if sessionallocation name isfails invalid and also sets drmaa2_lasterror_v to DRMAA2_INVALID_ARGUMENT error.DRMAA2_OUT_OF_RESOURCE error is set drmaa2_queueinfovoid drmaa2_queueinfomachineinfo_createfree (void)drmaa2_machineinfo * miRef) drmaa2_queueinfo_create() - creates a drmaa2_queueinfo structure and returns its pointer This function frees the pre-allocated drmaa machine info structure. Side-EffectsParameters: none miRef - Pointer to drmaa machine info Returns: Side-Effects: none drmaa2_queueinfo - pointer to newly allocated drmaa2_queueinfoReturns: structure NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is set void void drmaa2_queueinfostring_freelist (drmaa2_machineinfo_queueinfo * qiRefimpl_spec (void) This function freesdrmaa2_machineinfo_impl_spec - Lists the pre-allocated drmaa queueinfo structure.machine info spec implementations supported ParametersSide-Effects: none Returns: qiRef - Pointer to drmaa queueinfo Side-Effects: none Returns: void drmaa2_string_list drmaa2_queueinfo_impl_spec (void) drmaa2_queueinfo_impl_spec - Lists the queue info spec implementations supported Side-Effects: none Returns: drmaa2_string_list drmaa2_string_list -list of machineinfo spec implementations supported NULL - If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_msession_free (drmaa2_msession * ms) drmaa2_j_list drmaa2_msession_get_all_jobs (const drmaa2_msession ms_, const drmaa2_jinfo filter_) Returns the list of all jobs i.e. DRMAA2 jobs and the jobs submitted out of DRMAA2 library also. The list or number of jobs returned should adhere to DRMS policies. Ex: The list might be Return values: limited to contain only the jobs seen by the DRMAA2 user. list of queueinfo spec implementations supportedParameters: NULLms_ - Ifpointer thisto featuredrmaa2_msession iscreated notearlier supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_r_free (drmaa2_r * r) drmaa2_string drmaa2_r_get_id (const drmaa2_r r) Get the reservation id from a given reservation object. Parameters: filter_ - of type drmaa2_jinfo (through which we can query jobs per jobstate, job owner and per queue etc Side-Effects: none Returns: r - given reservation object drmaa2_j_list if succeeds NULL if fails Side-Effects: none drmaa2_machineinfo_list drmaa2_msession_get_all_machines (const drmaa2_msession ms_, const drmaa2_string_list names_) Returns: Returns list of machines or drmaa2_stringhosts available for submitting jobs in the DRMS system. Return values: Parameters: - reservation id drmaa2ms_rinfo drmaa2_r_get_info (const pointer to drmaa2_r r)msession created earlier Get the reservation info fromnames_ a given reservation object. Parameters:list of queue names acts as filter i.e. we fetch info of only these queues. Side-Effects: none r - given reservation object Returns: Side-Effects: none drmaa2_machineinfo_list if succeeds NULL Returns:if fails. drmaa2_queueinfo_list drmaa2_msession_get_all_queues (const drmaa2_msession ms_, const drmaa2_rinfo string_list names_) ReturnReturns values:list of queues available for submitting jobs in the DRMS system. - reservation info object Parameters: drmaa2_rtemplate drmaa2_r_get_reservation_template (const drmaa2_r r) ms_ Getpointer theto reservationdrmaa2_msession templatecreated fromearlier a given reservation object. names_ Parameters:a list of queue names acts as filter i.e. we fetch rinfo -of givenonly reservationthese objectqueues. Side-Effects: none Returns: drmaa2_queueinfo_rtemplatelist if succeeds NULL Return values: - reservation templateif fails. drmaa2_r_stringlist drmaa2_rmsession_get_sessionall_namereservations (const drmaa2_rmsession rms_) GetReturns the reservationlist sessionof nameall fromadvance areservations givenvisible reservationfor object.the user running the DRMAA-based application. The list or Parameters:number of jobs returned should adhere to DRMS policies. Ex: The list rmight - given reservation object be limited to contain only Side-Effects: none the reservations seen by the DRMAA2 user. Returns: Parameters: drmaa2_string ms_ pointer to drmaa2_msession Returncreated values:earlier Side- reservation session nameEffects: none drmaa2_error drmaa2_r_terminate (drmaa2_r r) Returns: Terminate a given reservation. drmaa2_j_list if succeeds NULL if fails Parameters: void drmaa2_notification_free (drmaa2_notification * nRef) r - given reservationThis objectfunction frees the pre-allocated drmaa notification structure. Side-Effects: none Parameters: Returns: nRef - Pointer to drmaa2_errordrmaa notification Return valuesSide-Effects: none Returns: DRMAA2_SUCCESS DRMAA2_DENIED_BY_DRMSvoid drmaa2_errorstring_list drmaa2_registernotification_eventimpl_notificationspec (const drmaa2_callback callbackvoid) Registers a drmaa2_callback with_notification_impl_spec - Lists the DRMSnotification library.spec Forimplementations thesupported first phase of implementation we do not support this. Side-Effects: none Parameters: Returns: callback - a structure of type drmaa2_string_callbacklist containing- thelist details of callbacknotification function,spec eventimplementations etcsupported NULL - If this feature is not Side-Effects: none supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION drmaa2_jsession drmaa2_open_jsession (const char * session_name_) Returns: drmaa2_open_jsession - Opens an already existing DRMAA2_UNSUPPORTED_OPERATION error if fails DRMAA2_SUCCESS if succeedsdrmaa2_job session Parameters: drmaa2_rinfo drmaa2_rinfo_create (void) drmaa2session_rinfoname_create() - Session name createsof athe drmaa2_reservationjob infosession structurewhich andneeds returnsto itsbe pointeropened Side-Effects: none : none Returns: drmaa2_rinfojsession - returns pointer to newly allocated drmaa2_rinfo structure drmaa2_jsession for a session which is already present NULL - if allocation fails and DRMAA2_OUTINVALID_OF_RESOURCEARGUMENT error is set voiddrmaa2_msession drmaa2_rinfoopen_freemsession (drmaa2_rinfoconst char * riRefcontact_) This functionOpens frees the pre-allocated drmaa rinfo structuremonitoring session. Parameters: riRefcontact_ - PointerContact toof drmaathe reservationsession info Side-Effects: none Returns: Returns: drmaa2_msession if the session exists NULL if the session voiddoes not exist and if drmaa2_string_list drmaa2_rinfo_impl_spec (void) Lists the drmaa spec implementations supported for reservation info (e.g. drmaa, drmaa2session name is invalid and also sets drmaa2_lasterror_v to DRMAA2_INVALID_ARGUMENT error drmaa2_rsession drmaa2_open_rsession (const char * session_name_) Opens the previously Side-Effects: nonecreated session. ReturnsParameters: drmaa2session_stringname_list - Name of the session. Return values: Side-Effects: none list of drmaa spec implementations supportedReturns: NULLdrmaa2_rsession -if Ifa thissession featureexists isNULL not supported, setif sets drmaa2_lasterror_v to DRMAA2_UNSUPPORTEDINVALID_OPERATIONARGUMENT error. void drmaa2_rsession_freequeueinfo (drmaa2_queueinfo_rsessioncreate *(void) rs) drmaa2_rsessionqueueinfo_freecreate() Frees- thecreates memorya ofdrmaa2_queueinfo Reservationstructure sessionand pointedreturns byits rspointer ParametersSide-Effects: none rs - pointer to drmaa2_rsession. Side-Effects: none Returns: drmaa2_queueinfo - pointer to newly Returns:allocated drmaa2_queueinfo structure NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is voidset drmaa2_stringvoid drmaa2_rsessionqueueinfo_get_contactfree (const drmaa2_rsessionqueueinfo * rsqiRef) GetThis thefunction contactfrees ofthe apre-allocated givendrmaa drmaa2queueinfo reservation sessionstructure. Parameters: rsqiRef - Pointer givento reservationdrmaa sessionqueueinfo Side-Effects: none Returns: void drmaa2_string_list drmaa2_queueinfo_impl_spec (void) Return values: drmaa2_queueinfo_impl_spec - Lists the queue info spec implementations supported Side- contact name associated with reservation sessionEffects: none Returns: drmaa2_string_list -list of queueinfo spec implementations supported NULL - ifIf reservationthis sessionfeature is not invalidsupported, set drmaa2_lasterror_v set to DRMAA2_INVALIDUNSUPPORTED_SESSIONOPERATION void drmaa2_r_free (drmaa2_rsession_get_reservation (constr * r) drmaa2_rsession rs, string drmaa2_r_get_id (const drmaa2_stringr reservationIdr) Get the reservation objectid from a specific reservation session with the given reservation idobject. Parameters: rsr - given reservation session object Side-Effects: none Returns: reservationId - given reservationdrmaa2_string id Return Side-Effectsvalues: none Returns: - reservation id drmaa2_rinfo drmaa2_r_get_info (const drmaa2_r r) Get the reservation info from Return values:a given reservation object. Parameters: - reservation interfacer - given reservation object NULL Side-Effects: ifnone reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION Returns: ·drmaa2_rinfo if- reservation idinfo object isNULL invalid, drmaa2_lasterror_v set to- if fails and DRMAA2_INVALID_ARGUMENT error is set drmaa2_r_listrtemplate drmaa2_rsessionr_get_reservationsreservation_template (const drmaa2_rsessionr rs_r) Get all the reservation objectstemplate from a specificgiven reservation sessionobject. Parameters: rs_r - given reservation sessionobject Side-Effects: none Returns: drmaa2_r_list Return values: rtemplate- - reservation interface list template NULL - if reservationfails session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSIONand DRMAA2_INVALID_ARGUMENT error is set drmaa2_string drmaa2_rsessionr_get_session_name (const drmaa2_rsessionr rsr) Get the reservation session name offrom a given drmaa2 reservation sessionobject. Parameters: rsr - given reservation sessionobject Side-Effects: none Returns: drmaa2_string - reservation session name NULL - if fails and DRMAA2_INVALID_ARGUMENT error is set Return values: drmaa2_error drmaa2_r_terminate (drmaa2_r r) - session nameTerminate associateda withgiven reservation session. Parameters: NULLr - ifgiven reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSIONobject Side-Effects: none Returns: drmaa2_error - on success DRMAA2_SUCCESS DRMAA2_DENIED_BY_DRMS if failed drmaa2_rerror drmaa2_rsessionregister_request_reservation (const drmaa2_rsession rs, event_notification (const drmaa2_rtemplatecallback rt_callback) CreatesRegisters a reservationdrmaa2_callback objectwith inthe aDRMS specific reservation session withlibrary. For the givenfirst reservationphase template.of itimplementation alsowe evaluatesdo reservationnot templatesupport forthis. the mandatory attributes and sends the request Parameters: to DRMS. callback - a structure Parameters:of type drmaa2_callback containing the details of callback function, event etc rs - given reservation session Side-Effects: none rt_ -Returns: given reservation template Side-Effects: none DRMAA2_SUCCESS if succeeds DRMAA2_UNSUPPORTED_OPERATION error if fails Returns: drmaa2_rinfo drmaa2_rinfo_create (void) drmaa2_rrinfo_create() - creates a drmaa2_reservation info structure and returns Returnits values:pointer - reservation interfaceSide-Effects: none Returns: NULL - if reservation session is invalid, drmaa2_lasterror_v setrinfo - pointer to DRMAA2_INVALID_SESSIONnewly allocated drmaa2_rinfo structure NULL - if allocation fails and DRMAA2_OUT_OF_RESOURCE error is ·set if reservation template evaluation fails,void drmaa2_lasterrorrinfo_v set to DRMAA2_UNSUPPORTED_ATTRIBUTE free (drmaa2_rinfo * riRef) This function frees ·the ifpre-allocated DRMSdrmaa rejectsrinfo reservationstructure. request, drmaa2_lasterror_v set to DRMAA2_DENIED_BY_DRMS Parameters: drmaa2_rtemplate drmaa2_rtemplate_create (void) This functionriRef frees- thePointer pre-allocatedto drmaa rtemplatereservation structure.info Side-Effects: none Returns: Returns: void drmaa2_string_list drmaa2_rinfo_impl_spec (void) Lists the drmaa drmaa2_rtemplatespec implementations supported for void drmaa2_rtemplate_free (drmaa2_rtemplate * rtreservation info (e.g. drmaa, drmaa2) This function frees the pre-allocated drmaa rtemplate structure. Side-Effects: none ParametersReturns: rtdrmaa2_string_list - Pointerlist toof drmaa rtemplatespec implementations supported NULL - If this feature is Side-Effects: none not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION void drmaa2_rsession_free (drmaa2_rsession * rs) Returns: drmaa2_rsession_free Frees the memory of Reservation session pointed by voidrs drmaa2_string_list drmaa2_rtemplate_impl_spec (void) Parameters: Lists the drmaa spec implementations supported forrs reservation template (e.g. drmaa, drmaa2)- pointer to drmaa2_rsession. Side-Effects: none Returns: void drmaa2_string_list drmaa2_rsession_get_contact (const drmaa2_rsession rs) Return values:Get the contact of a given drmaa2 reservation session. list of drmaa spec implementations supportedParameters: NULLrs - Ifgiven thisreservation featuresession is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION Side-Effects: none drmaa2_error drmaa2_set_instance_value (void * instance, const char * name, const char * value) Returns: void drmaa2_slotinfo_free (drmaa2_slotinfostring *- siRef)contact name associated with reservation This function frees the pre-allocated drmaa slotinfo. Parameters: session NULL - if reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION drmaa2_r drmaa2_rsession_get_reservation (const drmaa2_rsession siRefrs, -const Pointer to drmaa slotinfodrmaa2_string reservationId) Get the reservation Side-Effects: none object from a specific reservation session with the given reservation id. ReturnsParameters: voidrs - given reservation session void drmaa2_string_free (drmaa2_string * str) reservationId - Thisgiven functionreservation freesid the previously allocated drmaa2_string. Side-Effects: none Parameters: Returns: str - pointer to pre allocated drmaa2_stringr- reservation NULL Side-Effects: noneif reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION Returns: · if reservation id is invalid, drmaa2_lasterror_v set to voidDRMAA2_INVALID_ARGUMENT drmaa2_boolr_list drmaa2_rsession_get_supportsreservations (const drmaa2_capabilityrsession crs_) drmaa2_supportsGet -all returnsthe truereservation ifobjects drmaafrom supportsa thespecific provided drmaa2_capabilityreservation session. Parameters: crs_ - drmaa2_capabilitygiven enumreservation valuesession Side-Effects: none Returns: drmaa2_version void drmaa2_version_free (drmaa2_version * vRef) This function frees the pre-allocated drmaa version structure. Parameters: r_list - reservation interface list NULL - if reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION drmaa2_string drmaa2_rsession_get_session_name (const drmaa2_rsession rs) vRef - Pointer to drmaa version Side-Effects: none Get the session name of a given drmaa2 reservation session. Parameters: Returns: rs - given reservation session void |
Sample Example
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
drmaa2_jsession js; /* Job session object*/ drmaa2_jtemplate jt; /* Job session template*/Side-Effects: none Returns: drmaa2_jstring j;- session /*name Jobassociated object*/with reservation session NULL - ...if reservation session ... ... /* Create and open job session */ js = drmaa2_create_jsession("testsession", DRMAA2_UNSET_STRING);is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION drmaa2_r drmaa2_rsession_request_reservation (const drmaa2_rsession rs, const drmaa2_rtemplate rt_) if (js ==Creates NULL)a {reservation object in a ... return; } ... ... ... /* Create job template */ jt = drmaa2_jtemplate_create(); jt->remoteCommand = strdup("/bin/date"); j = drmaa2_jsession_run_job(js, jt);specific reservation session with the given reservation template. it also evaluates reservation template for the mandatory attributes and sends the request to DRMS. Parameters: rs - given reservation session ... ... rt_ - drmaa2_j_wait_terminated(j, DRMAA2_INFINITE_TIME);given reservation template drmaa2_jtemplate_free(&jt); drmaa2_destroy_jsession("testsession");Side-Effects: none ... Returns: ... ... drmaa2_j_free(&j); drmaa2_jsession_free(&js); ... ... ... | ||||||||||
Code Block | ||||||||||
| ||||||||||
...r- reservation NULL - if reservation session is invalid, drmaa2_lasterror_v set to DRMAA2_INVALID_SESSION ... ... drmaa2_jtemplate · if reservation template evaluation fails, drmaa2_lasterror_v jtset =to drmaa2DRMAA2_jtemplate_create(); /* job template object */ drmaa2_rtemplate UNSUPPORTED_ATTRIBUTE · if DRMS rejects reservation request, drmaa2_lasterror_v set to DRMAA2_DENIED_BY_DRMS rtdrmaa2_rtemplate = drmaa2_rtemplate_create (void); /* reservation template object */ This function frees drmaa2_string_list the pre-allocated drmaa rtemplate structure. cl = drmaa2_list_create(DRMAA2_STRINGLIST, NULL); / *create list of strings */ Side-Effects: none drmaa2_dict Returns: env = drmaa2_dict_create(NULL); /* create a dictionary */rtemplate void drmaa2_rtemplate_free (drmaa2_rtemplate * rt) drmaa2_jsession js = drmaa2_create_jsession("myjsession", NULL); /* open sessions to DRM system */This function frees the pre-allocated drmaa rtemplate structure. if (js ==Parameters: NULL) { ... rt - Pointer to drmaa rtemplate ... Side-Effects: none return; } Returns: drmaa2_rsession rs = drmaa2_create_rsession("myrsession", NULL); /* create a reservation sessionvoid */ if (rs == NULL)drmaa2_string_list drmaa2_rtemplate_impl_spec (void) {Lists the drmaa spec implementations supported for reservation template (e.g.. drmaa, drmaa2) ... Side-Effects: none return; Returns: } drmaa2_msession ms = drmaa2_open_msession(NULL); /*create and open monitoring session */ ml = drmaa2_msession_get_all_machines(ms, DRMAA2_UNSET_LIST);string_list - list of drmaa spec implementations supported NULL - If this feature is not supported, set drmaa2_lasterror_v to DRMAA2_UNSUPPORTED_OPERATION drmaa2_error drmaa2_set_instance_value (void /* determine instance, const char * name, ofconst first machinechar */ value) ifvoid (drmaa2_listslotinfo_size(ml) < 1) {free (drmaa2_slotinfo * siRef) ... This function frees the pre-allocated drmaa slotinfo. return; } Parameters: m = (drmaa2_machineinfo)drmaa2_list_get(ml, 0); drmaa2_list_add(cl, m->name); siRef rt->maxSlots =Pointer 4;to drmaa slotinfo Side-Effects: none Returns: void void drmaa2_string_free (drmaa2_string * /*str) perform advance reservation */ This ...function frees the previously allocated rt->machineOS=DRMAA2_LINUX;drmaa2_string. rt->candidateMachines = cl; Parameters: r = drmaa2_rsession_request_reservation(rs, rt); str jt->remoteCommand = strdup("/bin/date"); pointer to pre allocated drmaa2_string Side-Effects: none Returns: /* submit job */ void jt->reservationId = drmaa2_r_get_id(r); drmaa2_dict_set(env, "PBS_SCP", "/usr/bin/scp"); jt->jobEnvironment = env; j = drmaa2_jsession_run_job(js, jt);bool drmaa2_supports (const drmaa2_capability c) drmaa2_supports - returns true if drmaa supports the provided drmaa2_capability drmaa2_j_wait_terminated(j, DRMAA2_INFINITE_TIME); Parameters: c - drmaa2_capability enum value /* Wait for termination and print exit status */ Side-Effects: none ji = drmaa2_j_get_info(j); Returns: ... ... ... /* close sessions,drmaa2_version cleanup */ void drmaa2_jtemplateversion_free(&jt); drmaa2_rtemplate_free(&rt); drmaa2_jinfo_free(&ji); drmaa2_j_free(&j); drmaa2_r_free(&r); (drmaa2_version * vRef) This function frees the pre-allocated drmaa version structure. Parameters: drmaa2_close_msession(ms); drmaa2_close_rsession(rs);vRef - Pointer to drmaa version drmaa2_close_jsession(js); drmaa2_msession_free(&ms);Side-Effects: none drmaa2_rsession_free(&rs); drmaa2_jsession_free(&js);Returns: ... ... void |
Source code licensing
GNU Affero General Public License
Questions
Question | Outcome |
---|---|
How to do Black box testing ? Are there any application available to do black-box/manual testing ? | |
As PTL framework doesnt give session related automation, how to do automation? | |
Do we need to add customs DRMAAv2 APIs to support all IFL API's? |