GridLab
Grid Application Toolkit

A simple API for Grid Applications
GAT

Menu



Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

resource.c File Reference

Source file for the GATResourceCPI provider class for the resourcebroker adaptor. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GATCPI.h"
#include "GATResourceCPIInstanceData.h"

Include dependency graph for resource.c:

Include dependency graph

Go to the source code of this file.

Functions

void resourcebroker_adaptor_GATResourceCPI_Destroy (void *data)
GATResult resourcebroker_adaptor_GATResourceCPI_ServiceActions (void *data, GATResourceCPI_Instance *instance_data, GATTimePeriod_const timeout)
 resourcebroker_adaptor_GATResourceCPI_ServiceActions

GATResult resourcebroker_adaptor_GATResourceCPI_CreateInstance (void *data, GATResourceCPI_Instance *instance_data, void *initialisation_data)
 resourcebroker_adaptor_GATResourceCPI_CreateInstance Create a new CPI object instance.

void resourcebroker_adaptor_GATResourceCPI_DestroyInstance (void *data, GATResourceCPI_Instance *instance_data)
 resourcebroker_adaptor_GATResourceCPI_DestroyInstance Destroy a CPI object instance.

GATResult resourcebroker_adaptor_GATResourceCPI_CloneInstance (void *data, GATResourceCPI_Instance const *instance_data, GATResourceCPI_Instance *new_instance_data)
 resourcebroker_adaptor_GATResourceCPI_CloneInstance Clone a CPI object instance.

GATResult resourcebroker_adaptor_GATResourceCPI_EqualsInstance (void *data, GATResourceCPI_Instance const *lhs, GATResourceCPI_Instance const *rhs, GATBool *isequal)
 resourcebroker_adaptor_GATResourceCPI_EqualsInstance Clone a CPI object instance.

GATResult resourcebroker_adaptor_GATResourceCPI_GetMetrics (void *data, GATResourceCPI_Instance const *instance_data, GATList_GATMetric *metrics)
 resourcebroker_adaptor_GATResourceCPI_GetMetrics

GATResult resourcebroker_adaptor_GATResourceCPI_GetMetricEvent (void *data, GATResourceCPI_Instance const *instance_data, GATMetric metric, GATMetricEvent *event)
 resourcebroker_adaptor_GATResourceCPI_GetMetricEvent

GATResult resourcebroker_adaptor_GATResourceCPI_Serialise (void *data, GATResourceCPI_Instance const *instance_data, GATObject stream, GATBool clear_dirty)
 resourcebroker_adaptor_GATResourceCPI_Serialise

GATResult resourcebroker_adaptor_GATResourceCPI_DeSerialise (void *data, GATObject stream, GATResourceCPI_Instance *instance_data)
 resourcebroker_adaptor_GATResourceCPI_DeSerialise

GATResult resourcebroker_adaptor_GATResourceCPI_GetResourceDescription (void *data, GATResourceCPI_Instance const *instance_data, GATResourceDescription_const *description)
 resourcebroker_adaptor_GATResourceCPI_GetResourceDescription

GATResult resourcebroker_adaptor_GATResourceCPI_GetReservation (void *data, GATResourceCPI_Instance const *instance_data, GATReservation_const *reservation)
GATResult resourcebroker_adaptor_Register_GATResourceCPI (GATContext error_context, GATRegistry registry, GATTable_const system_config, GATTable_const instance_config, void *token)

Variables

const char * rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/resource.c,v 1.11 2004/04/27 11:34:50 hartmutkaiser Exp $"


Detailed Description

Source file for the GATResourceCPI provider class for the resourcebroker adaptor.

TODO: Fill in the description of the new CPI provider here

Date:
Wed Nov 19 2003
Version:
Header:
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/resource.c,v 1.11 2004/04/27 11:34:50 hartmutkaiser Exp

Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Hartmut Kaiser <hartmutkaiser [at] t-online [dot] de>.

Use, modification and distribution is subject to the Gridlab Software License. (See accompanying file GLlicense.txt or copy at http://www.gridlab.org/GLlicense.txt)

Definition in file resource.c.


Function Documentation

void resourcebroker_adaptor_GATResourceCPI_Destroy void *    data [static]
 

Definition at line 178 of file resource.c.

References assert, and data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_ServiceActions void *    data,
GATResourceCPI_Instance   instance_data,
GATTimePeriod_const    timeout
[static]
 

resourcebroker_adaptor_GATResourceCPI_ServiceActions

The function resourcebroker_adaptor_GATResourceCPI_ServiceActions is called, whenever the client calls GATContext_ServiceActions. This function is called for every created object. This function should be used to update all instance specific data, which may have been changed asynchronously or to fire pending events.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
timeout  This may be a 0 timeout to indicate no timeout at all, or a specific time length.
Returns:
An error code.

Definition at line 203 of file resource.c.

References data, GAT_NOTIMPL, and GATTimePeriod_const.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_CreateInstance void *    data,
GATResourceCPI_Instance   new_instance_data,
void *    initialisation_data
[static]
 

resourcebroker_adaptor_GATResourceCPI_CreateInstance Create a new CPI object instance.

Adaptor implementation of create instance capability.

Parameters:
data  Adaptor-provided data object.
context  The GATContext for this CPI instance
target  The location of the file in question.
new_instance_data  The pointer to the variable, where the instance data of this CPI object is to be returned to.
Returns:
An error code.

Definition at line 222 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATResourceCPIInstance_Data_Clone(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

void resourcebroker_adaptor_GATResourceCPI_DestroyInstance void *    data,
GATResourceCPI_Instance   instance_data
[static]
 

resourcebroker_adaptor_GATResourceCPI_DestroyInstance Destroy a CPI object instance.

Adaptor implementation of destroy instance capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of the CPI object to destroy.

Definition at line 247 of file resource.c.

References data, GATResourceCPIInstance_Data_Destroy(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_CloneInstance void *    data,
GATResourceCPI_Instance const *    instance_data,
GATResourceCPI_Instance   new_instance_data
[static]
 

resourcebroker_adaptor_GATResourceCPI_CloneInstance Clone a CPI object instance.

Adaptor implementation of the clone instance capability.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object
new_instance_data  The pointer to the variable, where the instance data of the cloned CPI object is to be returned to.
Returns:
An error code.

Definition at line 269 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_INVALID_PARAMETER, GAT_RETURN_STATUS, GAT_USES_STATUS, GATResourceCPIInstance_Data_Clone(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_EqualsInstance void *    data,
GATResourceCPI_Instance const *    lhs,
GATResourceCPI_Instance const *    rhs,
GATBool   isequal
[static]
 

resourcebroker_adaptor_GATResourceCPI_EqualsInstance Clone a CPI object instance.

Adaptor implementation of the clone instance capability.

Parameters:
data  Adaptor-provided data object.
lhs  The instance data of the left CPI object.
lhs  The instance data of the right CPI object.
isequal  The pointer to the variable, where the result is to be returned to.
Returns:
An error code.

Definition at line 306 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATBool, GATResourceCPIInstance_Data_Equals(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_GetMetrics void *    data,
GATResourceCPI_Instance const *    instance_data,
GATList_GATMetric *    metrics
[static]
 

resourcebroker_adaptor_GATResourceCPI_GetMetrics

The function resourcebroker_adaptor_GATResourceCPI_GetMetrics should return a list of GATMetric objects supported by this adaptor. I.e. the adaptor is capable to fire GATMetricEvents for the returned metrics. This list should include all the supported metrics, event like and continuous ones.

Parameters:
data  Adaptor-provided data object.
instance_data  Instance data for the CPI provider object.
metrics  The pointer to the variable, which receives the returned list of metrics.
Returns:
An error code.

Definition at line 349 of file resource.c.

References data, GAT_NOTIMPL, and GATResult.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_GetMetricEvent void *    data,
GATResourceCPI_Instance const *    instance_data,
GATMetric    metric,
GATMetricEvent   event
[static]
 

resourcebroker_adaptor_GATResourceCPI_GetMetricEvent

The function resourcebroker_adaptor_GATResourceCPI_GetMetricEvent should return the GATMetricEvent associated with the given continuous metric. This function gets called for continuous metrics only, since returning the metric event object to the caller is th only way for the client to get access to it.

Parameters:
data  Adaptor-provided data object.
instance_data  Instance data for the CPI provider object.
metric  The metric instance describing the metric event to return. This metric should be equivalent to one of the metrics returned by our own GetMetrics CPI function (see above). If this is another (not known to us metric), an error should be returned.
event  The pointer to the variable, which receives the metric event to return.
Returns:
An error code.

Definition at line 377 of file resource.c.

References data, GAT_NOTIMPL, GATMetric, and GATResult.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_Serialise void *    data,
GATResourceCPI_Instance const *    instance_data,
GATObject    stream,
GATBool    clear_dirty
[static]
 

resourcebroker_adaptor_GATResourceCPI_Serialise

The function resourcebroker_adaptor_GATResourceCPI_Serialise is called by the GAT engine, whenever the client requested a Serialise operation on the corresponding object. The function should serialise into the given stream all the instance specific data of the object.

Parameters:
data  Adaptor-provided data object.
instance_data  The instance data of this CPI object.
stream  The GATSTream object to use for serialisation of the instance data.
Returns:
An error code

Definition at line 403 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATBool, GATResourceCPIInstance_Data_Serialize(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_DeSerialise void *    data,
GATObject    stream,
GATResourceCPI_Instance   instance_data
[static]
 

resourcebroker_adaptor_GATResourceCPI_DeSerialise

The function resourcebroker_adaptor_GATResourceCPI_DeSerialise is called by the GATEngine, whenever the client requested a DeSerialise operation for a corresponding object. The function should deserialise all the instance specific data of the object from the given stream.

Parameters:
data  Adaptor-provided data object.
stream  The GATSTream object to use for de-serialisation of the instance data.
instance_data  The instance data of this CPI object.
Returns:
An error code

Definition at line 436 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATResourceCPIInstance_Data_DeSerialize(), and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_GetResourceDescription void *    data,
GATResourceCPI_Instance const *    instance_data,
GATResourceDescription_const   description
[static]
 

resourcebroker_adaptor_GATResourceCPI_GetResourceDescription

Definition at line 461 of file resource.c.

References GATResourceCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_HANDLE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATResourceCPIInstance_Data_GetResourceDescription(), GATResourceDescription_const, and GATResourceCPI_Instance::instance_data.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_GATResourceCPI_GetReservation void *    data,
GATResourceCPI_Instance const *    instance_data,
GATReservation_const   reservation
[static]
 

Definition at line 480 of file resource.c.

References data, GAT_NOTIMPL, GATReservation_const, and GATResult.

Referenced by resourcebroker_adaptor_Register_GATResourceCPI().

GATResult resourcebroker_adaptor_Register_GATResourceCPI GATContext    error_context,
GATRegistry    registry,
GATTable_const    system_config,
GATTable_const    instance_config,
void *    token
 

Definition at line 99 of file resource.c.

References GATResourceCPI_Data::clone_instance, cpi, GATResourceCPI_Data::create_instance, GATResourceCPI_Data::data, GATResourceCPI_Data::deserialise, GATResourceCPI_Data::destroy, GATResourceCPI_Data::destroy_instance, GATResourceCPI_Data::equals_instance, GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_FAILED, GAT_MEMORYFAILURE, GAT_RETURN_STATUS, GAT_USES_STATUS, GATPreferences_Add(), GATPreferences_Create(), GATPreferences_Destroy(), GATResourceCPI_Create(), GATResourceCPI_Destroy(), GATRESOURCECPI_VERSION, GATResult, GATTable_const, GATResourceCPI_Data::get_metric_event, GATResourceCPI_Data::get_metrics, GATResourceCPI_Data::get_reservation, GATResourceCPI_Data::get_resource_description, resourcebroker_adaptor_GATResourceCPI_CloneInstance(), resourcebroker_adaptor_GATResourceCPI_CreateInstance(), resourcebroker_adaptor_GATResourceCPI_DeSerialise(), resourcebroker_adaptor_GATResourceCPI_Destroy(), resourcebroker_adaptor_GATResourceCPI_DestroyInstance(), resourcebroker_adaptor_GATResourceCPI_EqualsInstance(), resourcebroker_adaptor_GATResourceCPI_GetMetricEvent(), resourcebroker_adaptor_GATResourceCPI_GetMetrics(), resourcebroker_adaptor_GATResourceCPI_GetReservation(), resourcebroker_adaptor_GATResourceCPI_GetResourceDescription(), resourcebroker_adaptor_GATResourceCPI_Serialise(), resourcebroker_adaptor_GATResourceCPI_ServiceActions(), GATResourceCPI_Data::serialise, GATResourceCPI_Data::service_actions, and token.

Referenced by resourcebroker_adaptor_register().


Variable Documentation

const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/resource.c,v 1.11 2004/04/27 11:34:50 hartmutkaiser Exp $" [static]
 

Definition at line 20 of file resource.c.