Skip to content

Commit

Permalink
shell: support per-task output
Browse files Browse the repository at this point in the history
Problem: The job shell output plugin does not support per-task or
per-node output.

Support opening per-task output via a new task_output abstraction in
output/task.[ch].

Detect if output is per-node in config and use this to determine if
output files need to be opened up on ranks other than 0.
  • Loading branch information
grondo committed Dec 25, 2024
1 parent 75f48ca commit 971f08e
Show file tree
Hide file tree
Showing 4 changed files with 434 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/shell/output/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

#include "output/conf.h"

static bool template_is_per_shell (flux_shell_t *shell,
const char *template)
{
return strstr (template, "{{node") || strstr (template, "{{task");
}

static int output_stream_getopts (flux_shell_t *shell,
const char *name,
struct output_stream *stream)
Expand All @@ -54,8 +60,10 @@ static int output_stream_getopts (flux_shell_t *shell,
stream->type = FLUX_OUTPUT_TYPE_KVS;
return 0;
}
if (stream->template)
if (stream->template) {
stream->type = FLUX_OUTPUT_TYPE_FILE;
stream->per_shell = template_is_per_shell (shell, stream->template);
}

if (strcasecmp (stream->buffer_type, "none") == 0)
stream->buffer_type = "none";
Expand Down
2 changes: 1 addition & 1 deletion src/shell/output/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct output_stream {
const char *template;
const char *mode;
bool label;
struct file_entry *fp;
bool per_shell;
};

struct output_config {
Expand Down
Loading

0 comments on commit 971f08e

Please sign in to comment.