Skip to content

Instantly share code, notes, and snippets.

@dgruber
Last active Dec 24, 2015
Embed
What would you like to do?
DRMAA2 C open existing job session
long i, available = 0;
/* get a copy of the jsession names list */
drmaa2_string_list sessions = drmaa2_get_jsession_names();
drmaa2_jsession jsession;
for (i = 0; i < drmaa2_list_size(sessions); i++) {
const char* session = drmaa2_list_get(sessions, i);
if (strncmp(session, "mySession", sizeof("mySession")) == 0) {
available = 1;
break;
}
}
/* frees all entries since the list was initialized internally with
drmaa2_string_free() as callback function */
drmaa2_list_free(&sessions);
if (available) {
jsession = drmaa2_open_jsession("mySession");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment