Last active
December 24, 2015 17:39
-
-
Save dgruber/6837266 to your computer and use it in GitHub Desktop.
DRMAA2 C open existing job session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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