ULogEvent * EventInfo::GenEventJobAborted( void ) { SetName( "Job aborted" ); JobAbortedEvent *e = new JobAbortedEvent; e->setReason("ABORT"); return SetEvent( e ); }
int writeJobAbortedEvent() { JobAbortedEvent jobabort; jobabort.setReason("cause I said so!"); if ( !logFile.writeEvent(&jobabort) ) { printf("Complain about bad jobabort write\n"); exit(1); } return(0); }
bool WriteAbortEventToUserLog( ClassAd *job_ad ) { int cluster, proc; char removeReason[256]; WriteUserLog *ulog = InitializeUserLog( job_ad ); if ( ulog == NULL ) { // User doesn't want a log return true; } job_ad->LookupInteger( ATTR_CLUSTER_ID, cluster ); job_ad->LookupInteger( ATTR_PROC_ID, proc ); dprintf( D_FULLDEBUG, "(%d.%d) Writing abort record to user logfile\n", cluster, proc ); JobAbortedEvent event; removeReason[0] = '\0'; job_ad->LookupString( ATTR_REMOVE_REASON, removeReason, sizeof(removeReason) ); event.setReason( removeReason ); int rc = ulog->writeEvent(&event,job_ad); delete ulog; if (!rc) { dprintf( D_ALWAYS, "(%d.%d) Unable to log ULOG_ABORT event\n", cluster, proc ); return false; } return true; }