User`s guide
Cray XMT™ Programming Environment User’s Guide
luc_service_type_t serviceType,
int serviceFunctionIndex,
void * userHandle,
luc_error_t remoteLucError)
{
// In the example given, 'userHandle' will equal 0xf00
return;
}
void LucClientOnlyUsageModel(void)
{
// First create an endpoint. This is used to make the remote calls.
LucEndpoint *client = luc_allocate_endpoint(LUC_CLIENT_ONLY);
// In order to issue the remote calls, we need to know where to send them.
// The library uses the abstract 64 bit 'luc_endpoint_id_t' value, so the
// client application has to get this value from the server by some other
// means.
luc_endpoint_id_t serverEndpointId;
// This example assumes that 'serverEndpointId' is filled in by some
// other means; environment variable, command line option, etc.
// Enable the local endpoint. This will create worker threads and allocate
// resources.
luc_error_t lucError = client->startService();
if (LUC_ERR_OK != lucError)
{
// error case
delete client;
return;
}
// Once the client object has been started successfully, the application
// can use it to make synchronous and asynchronous calls.
// A synchronous (blocking) call.
// The application is responsible for setting serviceType and
// serviceFunctionIndex to something meaningful (ie. something
// registered by the object at 'serverEndpointId').
luc_service_type_t serviceType = LUC_ST_QueryEngine;
int serviceFunctionIndex = QUERY_ENGINE_ALIVE_FCTN_ID;
// This particular remote call passes no data.
lucError = client->remoteCallSync(serverEndpointId,
serviceType,
serviceFunctionIndex,
NULL, // void *inputData,
0, // size_t inputDataLen,
NULL, // void *outputData,
0); // size_t *outputDataLen);
if(lucError == LUC_ERR_OK)
//RPC was successful
58 S–2479–20