- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -

CRAY XE6 Programming Hints

From HLRS Platforms
Revision as of 16:16, 18 March 2011 by Hpcraink (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Programming Hints

This page provides hints and howtos for common programming tasks and problems, that are specific to the Cray XE6. For general programming information, we refer to our Wiki pages such as usage of Open MPI, or Best practices for MPI-IO.

ALPS usage

Usually, the programmer does not need to get access to the ALPS launcher on Cray (MPI does everything necessary to set up the process. In order to write parallel applications, accessing uGNI, or in order to get information on the allocation (e.g to detect the number of threads that have been allocated in this qsub), one may access ALPS information, easily.

The main header files are libalps.h for ALPS access, libalpslli.h for the low-level interface and finally libalpsutil.h to get access to placement infos on the compute nodes (alps_get_placement_info).

The usage is quite easy: To request information (which requires a response), such as getting the application ID (apid), send a alps_app_lli_put_request, expect a response with alps_app_lli_get_response. If the status is OK (here only return value tested for), receive the actual message with alps_app_lli_get_response_bytes.

The following examples gets the application info (app_info which contains information like the GNI pTag and cookie):

 ret = alps_app_lli_put_request(ALPS_APP_LLI_ALPS_REQ_APID, NULL, 0);
 if (ALPS_APP_LLI_ALPS_STAT_OK != ret)
     ERROR (ret, "alps_app_lli_put_simple_request()");
 
 ret = alps_app_lli_get_response (&alps_status, &alps_count);
 if (ALPS_APP_LLI_ALPS_STAT_OK != ret)
     ERROR (ret, "alps_app_lli_get_response()");
 
 ret = alps_app_lli_get_response_bytes (&apid, sizeof(apid));
 if (ALPS_APP_LLI_ALPS_STAT_OK != ret)
     ERROR (ret, "alps_app_lli_get_response_bytes()");
 
 ret = alps_get_appinfo(apid, &app_info, &app_cmddetail, &app_places);
 if (-1 == ret)
     ERROR (ret, "alps_get_appinfo()");