diff --git a/src/api/step_launch.c b/src/api/step_launch.c
index 1a0045a0638b8c1ca8693fb00866276d63ff67c6..82681a401290f13c79b2c3c58ae1be87b46ed0e1 100644
--- a/src/api/step_launch.c
+++ b/src/api/step_launch.c
@@ -248,6 +248,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx,
 		launch.efname = params->remote_error_filename;
 		launch.ifname = params->remote_input_filename;
 		launch.buffered_stdio = params->buffered_stdio ? 1 : 0;
+		launch.labelio = params->labelio ? 1 : 0;
 		ctx->launch_state->io.normal =
 			client_io_handler_create(params->local_fds,
 						 ctx->step_req->num_tasks,
diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h
index 894c7b142636689bb0667f83c0fbea1ac4345d95..1fabd0bdea31259a5375a665bf8fc6e4f4c84311 100644
--- a/src/common/slurm_protocol_defs.h
+++ b/src/common/slurm_protocol_defs.h
@@ -529,6 +529,7 @@ typedef struct launch_tasks_request_msg {
 	char     *efname; /* stderr filename pattern */
 	char     *ifname; /* stdin filename pattern */
 	uint8_t   buffered_stdio; /* 1 for line-buffered, 0 for unbuffered */
+	uint8_t   labelio;  /* prefix output lines with the task number */
 	uint16_t  num_io_port;
 	uint16_t  *io_port;  /* array of available client IO listen ports */
 	/**********  END  "normal" IO only options **********/
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index f94998f4490f0b49a4e0842f6ac509c485b889ec..1d73ef495d0adf3b7e7b6fdcf8e9c88f158a2c83 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -3470,6 +3470,7 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer)
 		packstr(msg->efname, buffer);
 		packstr(msg->ifname, buffer);
 		pack8(msg->buffered_stdio, buffer);
+		pack8(msg->labelio, buffer);
 		pack16(msg->num_io_port, buffer);
 		for(i = 0; i < msg->num_io_port; i++)
 			pack16(msg->io_port[i], buffer);
@@ -3550,6 +3551,7 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 		safe_unpackstr_xmalloc(&msg->efname, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&msg->ifname, &uint32_tmp, buffer);
 		safe_unpack8(&msg->buffered_stdio, buffer);
+		safe_unpack8(&msg->labelio, buffer);
 		safe_unpack16(&msg->num_io_port, buffer);
 		if (msg->num_io_port > 0) {
 			msg->io_port =
diff --git a/src/slurmd/slurmstepd/slurmstepd_job.c b/src/slurmd/slurmstepd/slurmstepd_job.c
index 14b1f55f397deed3483dc036e77500c78944729f..9b1eb5c233465e5b411af8e250ebfeb948f9f579 100644
--- a/src/slurmd/slurmstepd/slurmstepd_job.c
+++ b/src/slurmd/slurmstepd/slurmstepd_job.c
@@ -255,6 +255,7 @@ job_create(launch_tasks_request_msg_t *msg)
 	srun = srun_info_create(msg->cred, &resp_addr, &io_addr);
 
 	job->buffered_stdio = msg->buffered_stdio;
+	job->labelio = msg->labelio;
 
 	job->task_prolog = xstrdup(msg->task_prolog);
 	job->task_epilog = xstrdup(msg->task_epilog);
diff --git a/src/slurmd/slurmstepd/slurmstepd_job.h b/src/slurmd/slurmstepd/slurmstepd_job.h
index e4ca0e8aeaa08307690ee88dbb8c2d02866a7623..a9c37120d30c7b9546f125839162fc909ca178af 100644
--- a/src/slurmd/slurmstepd/slurmstepd_job.h
+++ b/src/slurmd/slurmstepd/slurmstepd_job.h
@@ -176,6 +176,7 @@ typedef struct slurmd_job {
 	uint8_t	buffered_stdio; /* stdio buffering flag, 1 for line-buffering,
 				 * 0 for no buffering
 				 */
+	uint8_t labelio;	/* 1 for labelling output with the task id */
 
 	pthread_t      ioid;  /* pthread id of IO thread                    */
 	pthread_t      msgid; /* pthread id of message thread               */