#include "glite/lb/context-int.h"
#include "glite/lb/consumer.h"
#include "glite/lb/xml_conversions.h"
+#include "glite/lb/jobstat.h"
static void dgerr(edg_wll_Context,char *);
static void printstat(edg_wll_JobStat,int);
printf("%s\t%s \n", ind, stat.user_fqans[i]);
}
printf("%ssandbox_retrieved : %d\n", ind, stat.sandbox_retrieved);
+ printf("%sjw_status : %s\n", ind, edg_wll_JWStatToString(stat.jw_status));
/* PBS state section */
if (stat.jobtype == EDG_WLL_STAT_PBS) {
UI_HOST
USER_FQANS
SANDBOX_RETRIEVED
+ JW_STATUS
/;
*/
extern char *edg_wll_StatToString(edg_wll_JobStatCode);
+/**
+ * Convert string Job Wrapper status to numeric code.
+ */
+extern enum edg_wll_StatJw_status edg_wll_StringToJWStat(const char *);
+
+/**
+ * Convert numeric Job Wrapper status code to string representation
+ */
+extern char *edg_wll_JWStatToString(enum edg_wll_StatJw_status);
+
/*@}*/
/*
#include <stdlib.h>
#include <string.h>
-#include "glite/lb/jobstat.h"
+#include "jobstat.h"
static const struct timeval null_timeval = {0,0};
if ((int)statCode < 0 || statCode >= sizeof(statNames)/sizeof(statNames[0])) return (char *) NULL;
return strdup(statNames[statCode]);
}
+
+static const char * const jw_statNames[] = {
+@@@{
+ my $f = selectField $status jw_status;
+ if ($f->{codes}) {
+ for (@{$f->{codes}}) {
+ my $lc = lc $_->{name};
+ my $uc = ucfirst $lc;
+ gen qq{
+! "$uc",
+};
+ }
+ }
+@@@}
+};
+
+enum edg_wll_StatJw_status edg_wll_StringToJWStat(const char *name)
+{
+ unsigned int i;
+
+ for (i=0; i<sizeof(jw_statNames)/sizeof(jw_statNames[0]); i++)
+ if (strcasecmp(jw_statNames[i],name) == 0) return (enum edg_wll_StatJw_status) i;
+ return (enum edg_wll_StatJw_status) -1;
+}
+
+char *edg_wll_JWStatToString(enum edg_wll_StatJw_status statCode)
+{
+ if ((int)statCode < 0 || statCode >= sizeof(jw_statNames)/sizeof(jw_statNames[0])) return (char *) NULL;
+ return strdup(jw_statNames[statCode]);
+}
+
+
if (ret) ret = enc_string(ret, stat->ui_host);
if (ret) ret = enc_strlist(ret, stat->user_fqans);
if (ret) ret = enc_int(ret, stat->sandbox_retrieved);
+ if (ret) ret = enc_int(ret, stat->jw_status);
if (ret) ret = enc_string(ret, stat->pbs_state);
if (ret) ret = enc_string(ret, stat->pbs_queue);
if (ret) ret = enc_string(ret, stat->pbs_owner);
if (tmp_in != NULL) stat->ui_host = dec_string(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->user_fqans = dec_strlist(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->sandbox_retrieved = dec_int(tmp_in, &tmp_in);
+ if (tmp_in != NULL) stat->jw_status = dec_int(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->pbs_state = dec_string(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->pbs_queue = dec_string(tmp_in, &tmp_in);
if (tmp_in != NULL) stat->pbs_owner = dec_string(tmp_in, &tmp_in);
/* where Z.XX is version from indent + 1 (version after commit), Y = Z+1 */
/* and DESCRIPTION is short hit why version changed */
-#define INTSTAT_VERSION "revision 2.4 - proxy merge"
+#define INTSTAT_VERSION "revision 2.5 - proxy merge"
// Internal error codes
_code_ USER User retrieved output sandbox.
_code_ TIMEOUT Timed out, resource forced purge of the sandbox.
_code_ NOOUTPUT No output was generated.
+int jw_status Status of Job wrapper
+ _code_ UNKNOWN Status of JW unknown
+ _code_ WRAPPER_RUNNING Wrapper started
+ _code_ PAYLOAD_RUNNING Payload running
+ _code_ DONE JW finished
_pad_ 55