...
# | User Story | Importance | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 |
| ||||||||||||
2 |
| ||||||||||||
3 |
| ||||||||||||
4 |
| ||||||||||||
5 |
| ||||||||||||
6 |
| ||||||||||||
7 |
| ||||||||||||
8 |
| ||||||||||||
9 |
| ||||||||||||
10 |
| ||||||||||||
11 |
|
Sample Example
...
language | cpp |
---|---|
theme | Eclipse |
title | Example1: DRMAA2 Simple Application |
linenumbers | true |
...
...
Architecture and design
Application stack
DRMAA2 Layout
|
Domain model diagram
Overview of Object mapping
|
Sessions and Session Manager
DRMAAv2 Provides 3 different sessions.
- JobSession - To control jobs
- ReservationSession - To control reservation
- MonitoringSession - Read-only, to get nodes, jobs, reservations from all the Sessions
DRMAA2 spec relies on concept of session to support the persistency of job and reservation information in multiple runs of short lived applications.
The SessionManager interface is the main interface of a DRMAA implementation for establishing communication with the DRMS. By the help of this interface, sessions for job management, monitoring, and/or reservation management can be maintained.
JobSession allows us to submit, control and monitor jobs. As opposed to MonitoringSession this allows us to control and monitor only those jobs submitted with in this job session only.
MonitoringSession allows us to get on-line status of jobs submitted with in DRMAA2 JobSession/s as well as those submitted outside of DRMAA2 as well. Within a monitoring session we can't submit or control jobs. Due to this reason we can say that DRMAA2 is good to write Job Monitoring GUIs.
ReservationSession allows us to submit, control and monitor standing or advanced reservations.
Directory structure
/drmaa2 The entire DRMAA2 module.
| -- configure.ac This
...
file dictates the behavior of
...
the final configure script that
...
is generated by Autoconf.
|
...
language | cpp |
---|---|
theme | Eclipse |
title | Example2: DRMAA2 Advance Application |
linenumbers | true |
...
-- INSTALL Instructions for successful compilation of this library.
| -- autogen.sh This file provides automatic build system preparation and is useful for projects that use the GNU autotools.
| -- AUTHORS Altair authors information
| -- ChangeLog Delta change information
| -- COPYING
...
...
Altair Copyright information
| -- NEWS
...
...
...
...
...
...
...
...
...
...
Latest news and updates
|
...
--
...
README
...
README
|
...
--
...
/api This directory contains all the function prototypes and definitions included in this API.
| | -- drmaa2.cpp
| | -- drmaa2.h
| -- /src The C++ interface definition
| -- /inc The header files required by the source code.
| -- /m4 The GNU m4 macros that are called by configure.ac.
| -- /doc The documentation generated by the Doxygen tool.
| -- /man
...
Man
...
pages
| -- /libdrmaa2
...
...
...
...
...
...
...
...
...
...
...
...
Autoconf and libtool specification
...
to
...
create library.
| -- /unittesting The code for the unit testing library of C++, called CppUnit.
| | -- /src
| | -- /inc
Dependent packages
cppunit, doxygen, PBSPro,
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>
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.
gcc -I/usr/include/drmaa2 -L/usr/lib/libdrmaa2.so <drmaa2_app> -ldrmaa2
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>
Sample Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
drmaa2_jsession js; /* Job session object*/ drmaa2_jtemplate jt; /* Job session template*/ drmaa2_j j; /* Job object*/ ... ... ... /* Create and open job session */ js = drmaa2_create_jsession("testsession", DRMAA2_UNSET_STRING); if jt->remoteCommand(js == strdup("/bin/date");NULL) { ... return; } ... ... ... /* submitCreate job template */ jt->reservationId = drmaa2_rjtemplate_get_idcreate(r); drmaa2_dict_set(env, "PBS_SCP", "/usr/bin/scp"); jt->jobEnvironment = envjt->remoteCommand = strdup("/bin/date"); j = drmaa2_jsession_run_job(js, jt); drmaa2_j_wait_terminated(j, DRMAA2_INFINITE_TIME); /* Wait for termination and print exit status */ ji =... ... drmaa2_j_getwait_infoterminated(j, DRMAA2_INFINITE_TIME); drmaa2_jtemplate_free(&jt); ... ... ... drmaa2_destroy_jsession("testsession"); ... /* close sessions, cleanup */... ... drmaa2_jtemplatej_free(&jtj); drmaa2_rtemplatejsession_free(&rtjs); drmaa2_jinfo_free(&ji);... drmaa2_j_free(&j); ... ... |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
... drmaa2_r_free(&r); drmaa2_close_msession(ms); ... ... drmaa2_close_rsession(rs);jtemplate drmaa2_close_jsession(js); jt = drmaa2_msessionjtemplate_freecreate(&ms); /* job template drmaa2_rsession_free(&rs);object */ drmaa2_jsession_free(&js); rtemplate ... ... |
Architecture and design
Application stack
Internal architecture
<<Image>
...
|
Domain model diagram
Overview of Object mapping
|
Sessions and Session Manager
DRMAAv2 Provides 3 different sessions.
- JobSession - To control jobs
- ReservationSession - To control reservation
- MonitoringSession - Read-only, to get nodes, jobs, reservations from all the Sessions
DRMAA2 spec relies on concept of session to support the persistency of job and reservation information in multiple runs of short lived applications.
The SessionManager interface is the main interface of a DRMAA implementation for establishing communication with the DRMS. By the help of this interface, sessions for job management, monitoring, and/or reservation management can be maintained.
JobSession allows us to submit, control and monitor jobs. As opposed to MonitoringSession this allows us to control and monitor only those jobs submitted with in this job session only.
MonitoringSession allows us to get on-line status of jobs submitted with in DRMAA2 JobSession/s as well as those submitted outside of DRMAA2 as well. Within a monitoring session we can't submit or control jobs. Due to this reason we can say that DRMAA2 is good to write Job Monitoring GUIs.
ReservationSession allows us to submit, control and monitor standing or advanced reservations.
Directory structure
/drmaa2 The entire DRMAA2 module.
| -- configure.ac This file dictates the behavior of the final configure script that is generated by Autoconf.
| -- INSTALL Instructions for successful compilation of this library.
...
| -- ChangeLog Delta change information
...
rt = drmaa2_rtemplate_create(); /* reservation template object */ drmaa2_string_list cl = drmaa2_list_create(DRMAA2_STRINGLIST, NULL); / *create list of strings */ drmaa2_dict env = drmaa2_dict_create(NULL); /* create a dictionary */ drmaa2_jsession js = drmaa2_create_jsession("myjsession", NULL); /* open sessions to DRM system */ if (js == NULL) { ... ... return; } drmaa2_rsession rs = drmaa2_create_rsession("myrsession", NULL); /* create a reservation session */ if (rs == NULL) { ... ... return; } drmaa2_msession ms = drmaa2_open_msession(NULL); /*create and open monitoring session */ ml = drmaa2_msession_get_all_machines(ms, DRMAA2_UNSET_LIST); /* determine name of first machine */ if (drmaa2_list_size(ml) < 1) { ... return; } m = (drmaa2_machineinfo)drmaa2_list_get(ml, 0); drmaa2_list_add(cl, m->name); rt->maxSlots = 4; |
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
/* perform advance reservation */ |
...
... rt->machineOS=DRMAA2_LINUX; rt->candidateMachines = |
...
| | -- drmaa2.cpp
| | -- drmaa2.h
| -- /src The C++ interface definition
| -- /inc The header files required by the source code.
| -- /m4 The GNU m4 macros that are called by configure.ac.
| -- /doc The documentation generated by the Doxygen tool.
| -- /man Man pages
| -- /libdrmaa2 Autoconf and libtool specification to create library.
| -- /unittesting The code for the unit testing library of C++, called CppUnit.
| | -- /src
| | -- /inc
Dependent packages
cppunit, doxygen, PBSPro,
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>
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.
...
cl;
r = drmaa2_rsession_request_reservation(rs, rt);
jt->remoteCommand = strdup("/bin/date"); /* submit job */
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);
drmaa2_j_wait_terminated(j, DRMAA2_INFINITE_TIME); /* Wait for termination and print exit status */
ji = drmaa2_j_get_info(j);
...
...
...
/* close sessions, cleanup */
drmaa2_jtemplate_free(&jt);
drmaa2_rtemplate_free(&rt);
drmaa2_jinfo_free(&ji);
drmaa2_j_free(&j);
drmaa2_r_free(&r);
drmaa2_close_msession(ms);
drmaa2_close_rsession(rs);
drmaa2_close_jsession(js);
drmaa2_msession_free(&ms);
drmaa2_rsession_free(&rs);
drmaa2_jsession_free(&js);
...
...
|
Questions
Question | Outcome |
---|---|
Not Doing
...