drmaa_misc(3)

πŸ’– drmaa_misc β€” the little grab-bag of DRMAA besties πŸ’–

okay so this is drmaa_misc(3), a page straight out of the Grid Engine DRMAA manual, and it's basically the miscellaneous-functions drawer of the DRMAA API. No cap. Four little helpers that tell you who you're talking to, what version you're on, and what went wrong.


✨ NAME ✨

drmaa_strerror, drmaa_get_contact, drmaa_version, drmaa_get_DRM_system β€” Miscellaneous DRMAA functions. the whole friend group πŸ’…


🌸 SYNOPSIS 🌸

#include "drmaa.h"

const char *drmaa_strerror(
       int drmaa_errno
);

int drmaa_get_contact(
       char *contact,
       size_t contact_len,
       char *error_diagnosis,
       size_t error_diag_len
);

int drmaa_version(
       unsigned int *major,
       unsigned int *minor,
       char *error_diagnosis,
       size_t error_diag_len
);

int drmaa_get_DRM_system(
       char *drm_system,
       size_t drm_system_len,
       char *error_diagnosis,
       size_t error_diag_len
);

int drmaa_get_DRMAA_implementation(
       char *drm_impl,
       size_t drm_impl_len,
       char *error_diagnosis,
       size_t error_diag_len
);

πŸ¦‹ DESCRIPTION πŸ¦‹

So drmaa_strerror() hands you back a message text that goes with the DRMAA error number you pass in as drmaa_errno. That's it, that's the whole job. But heads up: if you feed it a DRMAA error code that isn't valid, you get NULL back. Not a cute string, not a vibe, just NULL. πŸ’€

🌟 drmaa_get_contact() 🌟

drmaa_get_contact() gives you an opaque string stuffed with contact info about the DRMAA session you're currently in, and it's meant to be used with the drmaa_init(3) function. The tea here is that this opaque string holds everything drmaa_init() needs to reconnect to the session you're already in instead of spinning up a brand new one. no starting over, we're picking up where we left off. drmaa_init(3) function.

And the slay part: drmaa_get_contact() returns the exact same value both before and after drmaa_init(3) gets called. consistent queen. πŸ‘‘

🌟 drmaa_version() 🌟

drmaa_version() drops the major and minor version numbers of the DRMAA library into the integers that major and minor point to. If you're running a DRMAA 1.0 compliant implementation, you'll get 1 in major and 0 in minor. respectively. math is mathing.

🌟 drmaa_get_DRM_system() 🌟

drmaa_get_DRM_system() fills drm_system with up to drm_system_len characters of a string holding the Grid Engine product and version information. receipts! ✨

Same energy as the contact one: drmaa_get_DRM_system() returns the same value both before and after drmaa_init(3) is called.

🌟 drmaa_get_DRMAA_implementation() 🌟

drmaa_get_DRMAA_implementation() returns into drm_system up to drm_system_len characters of a string containing the Grid Engine DRMAA implementation version information. (yes bestie, the original really does say drm_system and drm_system_len right there in the implementation function's description β€” we're just the messengers πŸ™ˆ). And in the current implementation? drmaa_get_DRMAA_implementation() gives you the exact same result as the drmaa_get_DRM_system() function. twins fr fr. πŸ‘―

And yup, drmaa_get_DRMAA_implementation() returns the same value both before and after drmaa_init(3) is called.


🌈 ENVIRONMENTAL VARIABLES 🌈

  • SGE_ROOT β€” tells you where the Grid Engine standard configuration files live. the home base of it all.
  • SGE_CELL β€” if it's set, it specifies the default Grid Engine cell to be used. When Grid Engine needs to address a cell, it goes in this order of precedence:
    1. The name of the cell specified in the environment variable SGE_CELL, if it is set.
    2. The name of the default cell, i.e. default.
  • SGE_DEBUG_LEVEL β€” if it's set, debug information gets written to stderr. On top of that, it defines the level of detail in which that debug information is generated. spill the tea, verbosely πŸ’…
  • SGE_QMASTER_PORT β€” if it's set, it specifies the tcp port on which sge_qmaster(8) is expected to listen for communication requests. Most installations will use a services map entry instead to define that port. old school vs. new school, whatever works.

πŸ’œ RETURN VALUES πŸ’œ

If everything goes well, drmaa_get_contact(), drmaa_version(), and drmaa_get_DRM_system() return DRMAA_ERRNO_SUCCESS. we love a success story 🫢 Any other value means something went wrong, and then up to error_diag_len characters of error related diagnosis information get handed to you in the buffer error_diagnosis. so you're not left guessing, bestie.


πŸ”₯ ERRORS πŸ”₯

drmaa_get_contact(), drmaa_version(), drmaa_get_DRM_system(), and drmaa_get_DRMAA_implementation() can all fail with:

  • DRMAA_ERRNO_INTERNAL_ERROR β€” unexpected or internal DRMAA error, like system call failure, etc. the universe simply said no.
  • DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE β€” could not contact the DRM system for this request. πŸ“΅
  • DRMAA_ERRNO_AUTH_FAILURE β€” the specified request is not processed successfully due to authorization failure. you shall not pass, babe.
  • DRMAA_ERRNO_INVALID_ARGUMENT β€” the input value for an argument is invalid.
  • DRMAA_ERRNO_NO_MEMORY β€” failed allocating memory. 😭

And these two specific icons, drmaa_get_contact() and drmaa_get_DRM_system(), can also fail with:

  • DRMAA_ERRNO_NO_ACTIVE_SESSION β€” failed because there is no active session. no session, no service. πŸ’€

πŸŽ€ SEE ALSO πŸŽ€

drmaa_session(3).


and that's the whole page, bestie. this came from the SGE 8.1.3pre manual, dated $Date: 2008-07-08 09:10:04 $ β€” yes, an actual vintage. it's giving historical artifact, and honestly? iconic. now go reconnect to that session. periodt. πŸ’…βœ¨πŸ¦‹