Cray CX1000 Guide de l'utilisateur Page 57

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 169
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 56
Developing LUC Applications [5]
shutdown the service. For instance, if a serious application internal error occurs
or an application shutdown request is received, the server must be told to halt
by the application.
Example 12. LUC Server code example
#include <luc/luc_exported.h>
#include <user_app_definitions.h> (see below, step 6)
void server()
{
LucEndpoint *svrEndpoint;
luc_error_t err;
svrEndpoint = luc_allocate_endpoint(LUC_SERVER_ONLY);
err = svrEndpoint->registerRemoteCall(QUERY_ENGINE,
FUNC_QUERY1, query1);
if (err != LUC_ERR_OK)
{
// Process LUC error code
delete svrEndpoint;
return;
}
// Register more remote calls as above ....
err = svrEndpoint->startService();
if (err != LUC_ERR_OK)
{
// process LUC error code
delete svrEndpoint;
return;
}
readfe(&haltService); // MTK full-empty synchronization
svrEndpoint->stopService();
delete svrEndpoint;
return;
}
5.4 Communication Between LUC Objects
The following example shows how the application uses the client and server objects
to communicate.
Example 13. Allocating and using LucEndpoint objects to communicate
// Application-specific definitions
#define QUERY_ENGINE_ALIVE_FCTN_ID 1
#define QUERY_ENGINE_DATA_BOUNCE_FCTN_ID 2
//
// This asynchronous completion handler conforms to LUC_Completion_Handler
//
void ClientCompletionHandler(luc_endpoint_id_t destAddr,
S247920 57
Vue de la page 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 168 169

Commentaires sur ces manuels

Pas de commentaire