Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell: add shell.post-init plugin calllback topic between shell.init and first task.init #5719

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/man1/flux-shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ execution of the job:
* change working directory to the cwd of the job
* enter a barrier to ensure shell initialization is complete on all shells
* emit ``shell.init`` event to exec.eventlog
* call ``shell.post-init`` plugin callbacks
* create all local tasks. For each task, the following procedure is used

- call ``task.init`` plugin callback
Expand Down Expand Up @@ -142,6 +143,10 @@ topics:
**jobspec** and **R** from the KVS, but before any tasks
are started.

**shell.post-init**
Called after the shell initialization barrier has completed, but
before starting any tasks.

**task.init**
Called for each task after the task info has been constructed
but before the task is executed.
Expand Down
10 changes: 10 additions & 0 deletions src/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,11 @@ static int shell_init (flux_shell_t *shell)
return plugstack_call (shell->plugstack, "shell.init", NULL);
}

static int shell_post_init (flux_shell_t *shell)
{
return plugstack_call (shell->plugstack, "shell.post-init", NULL);
}

static int shell_task_init (flux_shell_t *shell)
{
return plugstack_call (shell->plugstack, "task.init", NULL);
Expand Down Expand Up @@ -1618,6 +1623,11 @@ int main (int argc, char *argv[])
&& shell_eventlogger_emit_event (shell.ev, "shell.init") < 0)
shell_die_errno (1, "failed to emit event shell.init");

/* Call shell.post-init plugins.
*/
if (shell_post_init (&shell) < 0)
shell_die_errno (1, "shell_post_init");

/* Create tasks
*/
if (!(shell.tasks = zlist_new ()))
Expand Down
Loading