Skip to content
Snippets Groups Projects
Commit 1a4f8c72 authored by David J. Bremer's avatar David J. Bremer
Browse files

Added the labelio flag, to support labelling i/o with a task number, when

a separate file is written per node or per task.
parent 77a05a94
No related branches found
No related tags found
No related merge requests found
...@@ -248,6 +248,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx, ...@@ -248,6 +248,7 @@ int slurm_step_launch (slurm_step_ctx_t *ctx,
launch.efname = params->remote_error_filename; launch.efname = params->remote_error_filename;
launch.ifname = params->remote_input_filename; launch.ifname = params->remote_input_filename;
launch.buffered_stdio = params->buffered_stdio ? 1 : 0; launch.buffered_stdio = params->buffered_stdio ? 1 : 0;
launch.labelio = params->labelio ? 1 : 0;
ctx->launch_state->io.normal = ctx->launch_state->io.normal =
client_io_handler_create(params->local_fds, client_io_handler_create(params->local_fds,
ctx->step_req->num_tasks, ctx->step_req->num_tasks,
......
...@@ -529,6 +529,7 @@ typedef struct launch_tasks_request_msg { ...@@ -529,6 +529,7 @@ typedef struct launch_tasks_request_msg {
char *efname; /* stderr filename pattern */ char *efname; /* stderr filename pattern */
char *ifname; /* stdin filename pattern */ char *ifname; /* stdin filename pattern */
uint8_t buffered_stdio; /* 1 for line-buffered, 0 for unbuffered */ 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 num_io_port;
uint16_t *io_port; /* array of available client IO listen ports */ uint16_t *io_port; /* array of available client IO listen ports */
/********** END "normal" IO only options **********/ /********** END "normal" IO only options **********/
......
...@@ -3470,6 +3470,7 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer) ...@@ -3470,6 +3470,7 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer)
packstr(msg->efname, buffer); packstr(msg->efname, buffer);
packstr(msg->ifname, buffer); packstr(msg->ifname, buffer);
pack8(msg->buffered_stdio, buffer); pack8(msg->buffered_stdio, buffer);
pack8(msg->labelio, buffer);
pack16(msg->num_io_port, buffer); pack16(msg->num_io_port, buffer);
for(i = 0; i < msg->num_io_port; i++) for(i = 0; i < msg->num_io_port; i++)
pack16(msg->io_port[i], buffer); pack16(msg->io_port[i], buffer);
...@@ -3550,6 +3551,7 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t ** ...@@ -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->efname, &uint32_tmp, buffer);
safe_unpackstr_xmalloc(&msg->ifname, &uint32_tmp, buffer); safe_unpackstr_xmalloc(&msg->ifname, &uint32_tmp, buffer);
safe_unpack8(&msg->buffered_stdio, buffer); safe_unpack8(&msg->buffered_stdio, buffer);
safe_unpack8(&msg->labelio, buffer);
safe_unpack16(&msg->num_io_port, buffer); safe_unpack16(&msg->num_io_port, buffer);
if (msg->num_io_port > 0) { if (msg->num_io_port > 0) {
msg->io_port = msg->io_port =
......
...@@ -255,6 +255,7 @@ job_create(launch_tasks_request_msg_t *msg) ...@@ -255,6 +255,7 @@ job_create(launch_tasks_request_msg_t *msg)
srun = srun_info_create(msg->cred, &resp_addr, &io_addr); srun = srun_info_create(msg->cred, &resp_addr, &io_addr);
job->buffered_stdio = msg->buffered_stdio; job->buffered_stdio = msg->buffered_stdio;
job->labelio = msg->labelio;
job->task_prolog = xstrdup(msg->task_prolog); job->task_prolog = xstrdup(msg->task_prolog);
job->task_epilog = xstrdup(msg->task_epilog); job->task_epilog = xstrdup(msg->task_epilog);
......
...@@ -176,6 +176,7 @@ typedef struct slurmd_job { ...@@ -176,6 +176,7 @@ typedef struct slurmd_job {
uint8_t buffered_stdio; /* stdio buffering flag, 1 for line-buffering, uint8_t buffered_stdio; /* stdio buffering flag, 1 for line-buffering,
* 0 for no 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 ioid; /* pthread id of IO thread */
pthread_t msgid; /* pthread id of message thread */ pthread_t msgid; /* pthread id of message thread */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment