source: branches/2.0/drmaa2_testsuite/drmaa_example1.c @ 82

Revision 82, 873 bytes checked in by mmamonski, 7 years ago (diff)

DRMAA 2.0 example

Line 
1#include <stdio.h>
2
3#include <drmaa2.h>
4
5int main (int argc, char **argv)
6{
7        drmaa2_jsession job_session = NULL;
8
9        if ((job_session = drmaa2_create_jsession("my_session", NULL)) == NULL) {
10                drmaa2_string errmsg = drmaa2_lasterror_text();
11                drmaa2_error errcode = drmaa2_lasterror();
12                fprintf (stderr, "Could not create Job Session: %s (errcode=%d)\n", errmsg, errcode);
13                drmaa2_string_free(&errmsg);
14
15                return 1;
16        }
17
18        printf("DRMAA 2.0 Job Session created successfully\n");
19
20        if ((drmaa2_destroy_jsession("my_session") != DRMAA2_SUCCESS)) {
21                        drmaa2_string errmsg = drmaa2_lasterror_text();
22                        drmaa2_error errcode = drmaa2_lasterror();
23                        fprintf (stderr, "Could not destroy Job Session: %s (errcode=%d)\n", errmsg, errcode);
24                        drmaa2_string_free(&errmsg);
25
26                        drmaa2_jsession_free(&job_session);
27
28                        return 1;
29                }
30
31        drmaa2_jsession_free(&job_session);
32
33        return 0;
34}
Note: See TracBrowser for help on using the repository browser.