From 4b9b335621e5bd5bfb652ca6cc145533a7e3f6e0 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 5 Dec 2002 21:18:26 +0000
Subject: [PATCH] Add batch_flag to job info dumped to user and printed.

---
 src/api/job_info.c               | 9 ++++++---
 src/api/slurm.h                  | 1 +
 src/common/slurm_protocol_pack.c | 2 ++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/api/job_info.c b/src/api/job_info.c
index 37d32adce1f..b11480db703 100644
--- a/src/api/job_info.c
+++ b/src/api/job_info.c
@@ -73,10 +73,12 @@ slurm_print_job_info ( FILE* out, job_info_t * job_ptr )
 
 	fprintf ( out, "JobId=%u UserId=%u Name=%s ", 
 		job_ptr->job_id, job_ptr->user_id, job_ptr->name);
-	fprintf ( out, "JobState=%s TimeLimit=%u ", 
+	fprintf ( out, "JobState=%s TimeLimit=%u\n", 
 		job_state_string(job_ptr->job_state), job_ptr->time_limit);
-	fprintf ( out, "Priority=%u Partition=%s\n", 
-		job_ptr->priority, job_ptr->partition);
+
+	fprintf ( out, "   Priority=%u Partition=%s BatchFlag=%u\n", 
+		job_ptr->priority, job_ptr->partition, job_ptr->batch_flag);
+
 	make_time_str ((time_t *)&job_ptr->start_time, time_str);
 	fprintf ( out, "   StartTime=%s ", time_str);
 	make_time_str ((time_t *)&job_ptr->end_time, time_str);
@@ -103,6 +105,7 @@ slurm_print_job_info ( FILE* out, job_info_t * job_ptr )
 	fprintf ( out, "MinTmpDisk=%u\n", job_ptr->min_tmp_disk);
 	fprintf ( out, "   Features=%s ReqNodeList=%s ", job_ptr->features, 
 		job_ptr->req_nodes);
+
 	fprintf ( out, "ReqNodeListIndecies=");
 	for (j = 0; job_ptr->req_node_inx; j++) {
 		if (j > 0)
diff --git a/src/api/slurm.h b/src/api/slurm.h
index d0953bf65ef..67f4fcdc54a 100644
--- a/src/api/slurm.h
+++ b/src/api/slurm.h
@@ -167,6 +167,7 @@ typedef struct job_descriptor {	/* For submit, allocate, and update requests */
 typedef struct job_info {
 	uint32_t job_id;	/* job ID */
 	char *name;		/* name of the job */
+	uint16_t batch_flag;	/* 1 if batch: queued job with script */
 	uint32_t user_id;	/* user the job runs as */
 	uint16_t job_state;	/* state of the job, see enum job_states */
 	uint32_t time_limit;	/* maximum run time in minutes or INFINITE */
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index a52a571244a..091844a398f 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -1483,7 +1483,9 @@ _unpack_job_info_members(job_info_t * job, Buf buffer)
 
 	safe_unpack32(&job->job_id, buffer);
 	safe_unpack32(&job->user_id, buffer);
+
 	safe_unpack16(&job->job_state, buffer);
+	safe_unpack16(&job->batch_flag, buffer);
 	safe_unpack32(&job->time_limit, buffer);
 
 	safe_unpack_time(&job->start_time, buffer);
-- 
GitLab