mirror of https://github.com/BOINC/boinc.git
convert condor event to api event
git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@661 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
8a0f222b5b
commit
35c99add70
|
@ -16,6 +16,8 @@
|
||||||
#include "dc_common.h"
|
#include "dc_common.h"
|
||||||
|
|
||||||
#include "condor_defs.h"
|
#include "condor_defs.h"
|
||||||
|
#include "condor_result.h"
|
||||||
|
#include "condor_wu.h"
|
||||||
#include "condor_log.h"
|
#include "condor_log.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +54,8 @@ _DC_wu_update_condor_events(DC_Workunit *wu)
|
||||||
ULogEvent *event;
|
ULogEvent *event;
|
||||||
while (log.readEvent(event) == ULOG_OK)
|
while (log.readEvent(event) == ULOG_OK)
|
||||||
{
|
{
|
||||||
printf("%d %s\n", event->eventNumber,
|
/*printf("%d %s\n", event->eventNumber,
|
||||||
ULogEventNumberNames[event->eventNumber]);
|
ULogEventNumberNames[event->eventNumber]);*/
|
||||||
if (wu->condor_events->len < i)
|
if (wu->condor_events->len < i)
|
||||||
{
|
{
|
||||||
struct _DC_condor_event e;
|
struct _DC_condor_event e;
|
||||||
|
@ -78,4 +80,35 @@ _DC_wu_update_condor_events(DC_Workunit *wu)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DC_MasterEvent *
|
||||||
|
_DC_wu_condor2api_event(DC_Workunit *wu)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
if (!_DC_wu_check(wu))
|
||||||
|
return(NULL);
|
||||||
|
for (i= 0; i < wu->condor_events->len; i++)
|
||||||
|
{
|
||||||
|
struct _DC_condor_event *ce;
|
||||||
|
ce= &g_array_index(wu->condor_events,
|
||||||
|
struct _DC_condor_event,
|
||||||
|
i);
|
||||||
|
if (ce->event == ULOG_JOB_TERMINATED)
|
||||||
|
{
|
||||||
|
DC_MasterEvent *e;
|
||||||
|
e= g_new0(DC_MasterEvent, 1);
|
||||||
|
DC_log(LOG_DEBUG, "API event created: %p", e);
|
||||||
|
e->type= DC_MASTER_RESULT;
|
||||||
|
e->wu= wu;
|
||||||
|
e->result= _DC_create_result(wu);
|
||||||
|
DC_log(LOG_DEBUG, "Result of the event: %p",
|
||||||
|
e->result);
|
||||||
|
wu->state= DC_WU_FINISHED;
|
||||||
|
return(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* End of condor_log.cc */
|
/* End of condor_log.cc */
|
||||||
|
|
|
@ -13,6 +13,7 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
extern char *_DC_wu_update_condor_events(DC_Workunit *wu);
|
extern char *_DC_wu_update_condor_events(DC_Workunit *wu);
|
||||||
|
extern DC_MasterEvent *_DC_wu_condor2api_event(DC_Workunit *wu);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
Loading…
Reference in New Issue