Main Page Alphabetical List Compound List File List Compound Members File Members
job.c File ReferenceSource file for the sample Job CPI provider.
More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GATCPI.h"
#include "GATJobCPIInstanceData.h"
Include dependency graph for job.c:
Go to the source code of this file.
|
Defines |
| #define | __countof(x) (sizeof(x)/sizeof(x[0])) |
| #define | METRIC_STATUS_CHANGED 0 |
Functions |
| void | resourcebroker_adaptor_GATJobCPI_Destroy (void *data) |
| GATResult | resourcebroker_adaptor_GATJobCPI_ServiceActions (void *data, GATJobCPI_Instance *instance_data, GATTimePeriod_const timeout) |
| | resourcebroker_adaptor_GATJobCPI_ServiceActions
|
| GATResult | resourcebroker_adaptor_GATJobCPI_CreateInstance (void *data, GATJobCPI_Instance *instance_data, void *initialisation_data) |
| | resourcebroker_adaptor_GATJobCPI_CreateInstance Create a new CPI object instance.
|
| void | resourcebroker_adaptor_GATJobCPI_DestroyInstance (void *data, GATJobCPI_Instance *instance_data) |
| | resourcebroker_adaptor_GATJobCPI_DestroyInstance Destroy a CPI object instance.
|
| GATResult | resourcebroker_adaptor_GATJobCPI_CloneInstance (void *data, GATJobCPI_Instance const *instance_data, GATJobCPI_Instance *new_instance_data) |
| | resourcebroker_adaptor_GATJobCPI_CloneInstance Clone a CPI object instance.
|
| GATResult | resourcebroker_adaptor_GATJobCPI_EqualsInstance (void *data, GATJobCPI_Instance const *lhs, GATJobCPI_Instance const *rhs, GATBool *isequal) |
| | resourcebroker_adaptor_GATJobCPI_EqualsInstance Clone a CPI object instance.
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetMetrics (void *data, GATJobCPI_Instance const *instance_data, GATList_GATMetric *metrics) |
| | resourcebroker_adaptor_GATJobCPI_GetMetrics
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetMetricEvent (void *data, GATJobCPI_Instance const *instance_data, GATMetric metric, GATMetricEvent *event) |
| | resourcebroker_adaptor_GATJobCPI_GetMetricEvent
|
| GATResult | resourcebroker_adaptor_GATJobCPI_Serialise (void *data, GATJobCPI_Instance const *instance_data, GATObject stream, GATBool clear_dirty) |
| | resourcebroker_adaptor_GATJobCPI_Serialise
|
| GATResult | resourcebroker_adaptor_GATJobCPI_DeSerialise (void *data, GATObject stream, GATJobCPI_Instance *instance_data) |
| | resourcebroker_adaptor_GATJobCPI_DeSerialise
|
| GATResult | resourcebroker_adaptor_GATJobCPI_UnSchedule (void *data, GATJobCPI_Instance const *instance_data) |
| | resourcebroker_adaptor_GATJobCPI_UnSchedule
|
| GATResult | resourcebroker_adaptor_GATJobCPI_Checkpoint (void *data, GATJobCPI_Instance const *instance_data) |
| | resourcebroker_adaptor_GATJobCPI_Checkpoint
|
| GATResult | resourcebroker_adaptor_GATJobCPI_CloneJob (void *data, GATJobCPI_Instance const *instance_data, GATHardwareResource_const hr, GATJob *cloned_job) |
| | resourcebroker_adaptor_GATJobCPI_CloneJob
|
| GATResult | resourcebroker_adaptor_GATJobCPI_Migrate (void *data, GATJobCPI_Instance const *instance_data, GATHardwareResource_const hr, GATJob *migrated_job) |
| | resourcebroker_adaptor_GATJobCPI_Migrate
|
| GATResult | resourcebroker_adaptor_GATJobCPI_Stop (void *data, GATJobCPI_Instance const *instance_data) |
| | resourcebroker_adaptor_GATJobCPI_Stop
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetJobDescription (void *data, GATJobCPI_Instance const *instance_data, GATJobDescription_const *jd) |
| | resourcebroker_adaptor_GATJobCPI_GetJobDescription
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetInfo (void *data, GATJobCPI_Instance const *instance_data, GATTable_const *jobinfo) |
| | resourcebroker_adaptor_GATJobCPI_GetInfo
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetJobID (void *data, GATJobCPI_Instance const *instance_data, GATJobID_const *jobid) |
| | resourcebroker_adaptor_GATJobCPI_GetJobID
|
| GATResult | resourcebroker_adaptor_GATJobCPI_GetStatus (void *data, GATJobCPI_Instance const *instance_data, GATStatus_const *jobstatus) |
| | resourcebroker_adaptor_GATJobCPI_GetStatus
|
| GATResult | resourcebroker_adaptor_Register_GATJobCPI (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/job.c,v 1.12 2004/04/26 15:45:00 hartmutkaiser Exp $" |
| GATStaticMetric | metric_data [] |
Detailed Description
Source file for the sample Job CPI provider.
- Date:
-
Sat Oct 25 2003
- Version:
-
- Header:
-
/export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/job.c,v 1.12 2004/04/26 15:45:00 hartmutkaiser Exp
Copyright (C) Hartmut Kaiser This file is part of the GAT Engine. Contributed by Hartmut Kaiser <hartm utkaiser [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 job.c.
Define Documentation
| #define __countof |
( |
x |
|
) |
(sizeof(x)/sizeof(x[0]))
|
|
|
|
Definition at line 29 of file job.c. |
| #define METRIC_STATUS_CHANGED 0
|
|
Function Documentation
| void resourcebroker_adaptor_GATJobCPI_Destroy |
( |
void * |
data |
) |
[static] |
|
|
|
resourcebroker_adaptor_GATJobCPI_ServiceActions
The function resourcebroker_adaptor_GATJobCPI_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 244 of file job.c.
References data, GAT_NOTIMPL, and GATTimePeriod_const.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
| GATResult resourcebroker_adaptor_GATJobCPI_CreateInstance |
( |
void * |
data, |
|
|
GATJobCPI_Instance * |
new_instance_data, |
|
|
void * |
initialisation_data |
|
) |
[static] |
|
| void resourcebroker_adaptor_GATJobCPI_DestroyInstance |
( |
void * |
data, |
|
|
GATJobCPI_Instance * |
instance_data |
|
) |
[static] |
|
| GATResult resourcebroker_adaptor_GATJobCPI_GetMetrics |
( |
void * |
data, |
|
|
GATJobCPI_Instance const * |
instance_data, |
|
|
GATList_GATMetric * |
metrics |
|
) |
[static] |
|
|
|
resourcebroker_adaptor_GATJobCPI_GetMetrics
The function resourcebroker_adaptor_GATJobCPI_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 379 of file job.c.
References __countof, data, and GATMetric_CreateListOfMetrics().
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_GetMetricEvent
The function resourcebroker_adaptor_GATJobCPI_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 406 of file job.c.
References data, GAT_NOTIMPL, and GATMetric.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_UnSchedule
The function resourcebroker_adaptor_GATJobCPI_UnSchedule guarantees that the GATJob corresponding to this GATJobCPI is not scheduled to a job queue, its state is GAT Initial. This operation can only be called on a GATJob in the GAT Scheduled state, otherwise an error will is issued. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
- Returns:
-
An error code.
Definition at line 490 of file job.c.
References data, and GAT_NOTIMPL.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_Checkpoint
The function resourcebroker_adaptor_GATJobCPI_Checkpoint triggers a checkpoint operation for the given GATJob. The call can only succeed on processes which support application level checkpointing, or on resources which provide system level checkpointing. The call returns immediately after delivering the checkpointing request to the job or to the resource the job is running on; the actual checkpoint may happen some time after this return. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
- Returns:
-
An error code.
Definition at line 512 of file job.c.
References data, and GAT_NOTIMPL.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_CloneJob
The function resourcebroker_adaptor_GATJobCPI_CloneJob creates a copy of the GATJob. The resulting GATJob has the same GATSoftwareDescription in its GATJobDescription, but the GATResourceDescriptions or GATResources of its GATJobDescription may be altered. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
| hr |
(optional) The GATHardwareResource to use to schedule the clones job. If this parameter is not given (zero) the GATHardwareResource is used, which was used to create the current GATJob. |
| cloned_job |
The pointer to a variable receiving the cloned job object. |
- Returns:
-
An error code.
Definition at line 535 of file job.c.
References data, GAT_NOTIMPL, GATHardwareResource_const, and GATJob.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_Migrate
The function resourcebroker_adaptor_GATJobCPI_Migrate provides similar functionality as the resourcebroker_adaptor_GATJobCPI_CloneJob operation. The only difference is that the calling GATJob instance is discontinued after the new job is spawned off successfully — its state is GATJobState_Stopped then. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
| hr |
(optional) The GATHardwareResource to use to schedule the clones job. If this parameter is not given (zero) the GATHardwareResource is used, which was used to create the current GATJob. |
| migrated_job |
The pointer to a variable receiving the cloned job object. |
- Returns:
-
An error code.
Definition at line 561 of file job.c.
References data, GAT_NOTIMPL, GATHardwareResource_const, and GATJob.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_Stop
The function resourcebroker_adaptor_GATJobCPI_Stop stops the GATJob. Upon a successful call to this operation, the processes associated with the GATJob are forcibly terminated. This operation can only be called on a GATJob in the GATJobState_Running state. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
- Returns:
-
An error code.
Definition at line 581 of file job.c.
References data, and GAT_NOTIMPL.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_GetInfo
The function resourcebroker_adaptor_GATJobCPI_GetInfo returns an instance of the class GATTable, which contains the essential information about the GATJob object, such as the host name, the schedule time, the start time, the stop time, whether the GATJob is checkpointable etc. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
| jobinfo |
The pointer to a variable, which should receive the returned GATTable containing the job information. |
- Returns:
-
An error code.
Definition at line 632 of file job.c.
References GATJobCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_PARAMETER, GAT_RETURN_STATUS, GAT_USES_STATUS, GATTable_const, and GATJobCPI_Instance::instance_data.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
resourcebroker_adaptor_GATJobCPI_GetJobID
The function resourcebroker_adaptor_GATJobCPI_GetJobID returns the job id, a globally unique identifier for the represented process corresponding to this instance. This operation SHOULD be called on a GATJob instance only when the instance is in a GAT Running or GAT Scheduled state, otherwise an error will be issued. - Parameters:
-
| data |
Adaptor-provided data object. |
| instance_data |
The instance data of this CPI object. |
| jobid |
The pointer to a variable, which should receive the resulting job id. |
- Returns:
-
An error code.
Definition at line 665 of file job.c.
References GATJobCPI_Instance::context, data, GAT_CREATE_STATUS, GAT_INVALID_PARAMETER, GAT_RETURN_STATUS, GAT_USES_STATUS, GATJobID_const, and GATJobCPI_Instance::jobid.
Referenced by resourcebroker_adaptor_Register_GATJobCPI(). |
|
|
Definition at line 140 of file job.c.
References GATJobCPI_Data::checkpoint, GATJobCPI_Data::clone_instance, GATJobCPI_Data::clonejob, cpi, GATJobCPI_Data::create_instance, GATJobCPI_Data::data, GATJobCPI_Data::deserialise, GATJobCPI_Data::destroy, GATJobCPI_Data::destroy_instance, GATJobCPI_Data::equals_instance, GAT_CREATE_STATUS, GAT_CURRENT_STATUS, GAT_FAILED, GAT_RETURN_STATUS, GAT_USES_STATUS, GATJobCPI_Create(), GATJobCPI_Destroy(), GATJOBCPI_VERSION, GATPreferences_Add(), GATPreferences_Create(), GATPreferences_Destroy(), GATResult, GATTable_const, GATJobCPI_Data::get_jobdescription, GATJobCPI_Data::get_jobid, GATJobCPI_Data::get_jobinfo, GATJobCPI_Data::get_metric_event, GATJobCPI_Data::get_metrics, GATJobCPI_Data::get_status, GATJobCPI_Data::migratejob, resourcebroker_adaptor_GATJobCPI_Checkpoint(), resourcebroker_adaptor_GATJobCPI_CloneInstance(), resourcebroker_adaptor_GATJobCPI_CloneJob(), resourcebroker_adaptor_GATJobCPI_CreateInstance(), resourcebroker_adaptor_GATJobCPI_DeSerialise(), resourcebroker_adaptor_GATJobCPI_Destroy(), resourcebroker_adaptor_GATJobCPI_DestroyInstance(), resourcebroker_adaptor_GATJobCPI_EqualsInstance(), resourcebroker_adaptor_GATJobCPI_GetInfo(), resourcebroker_adaptor_GATJobCPI_GetJobDescription(), resourcebroker_adaptor_GATJobCPI_GetJobID(), resourcebroker_adaptor_GATJobCPI_GetMetricEvent(), resourcebroker_adaptor_GATJobCPI_GetMetrics(), resourcebroker_adaptor_GATJobCPI_GetStatus(), resourcebroker_adaptor_GATJobCPI_Migrate(), resourcebroker_adaptor_GATJobCPI_Serialise(), resourcebroker_adaptor_GATJobCPI_ServiceActions(), resourcebroker_adaptor_GATJobCPI_Stop(), resourcebroker_adaptor_GATJobCPI_UnSchedule(), GATJobCPI_Data::serialise, GATJobCPI_Data::service_actions, GATJobCPI_Data::stopjob, token, and GATJobCPI_Data::unschedule.
Referenced by resourcebroker_adaptor_register(). |
Variable Documentation
const char* rcsid = "$Header: /export/cvs-gridlab/wp-1/Codes/GATEngine/C-reference/adaptors/resourcebroker/job.c,v 1.12 2004/04/26 15:45:00 hartmutkaiser Exp $" [static]
|
|
|
|
Definition at line 17 of file job.c. |
|
|
Initial value:
Definition at line 122 of file job.c. |
|