#include <flux/shell.h>
#include <errno.h>
int flux_shell_get_info (flux_shell_t *shell,
                        char **json_str);
int flux_shell_info_unpack (flux_shell_t *shell,
                           const char *fmt,
int flux_shell_get_rank_info (flux_shell_t *shell,
                              int shell_rank,
                              char **json_str);
int flux_shell_rank_info_unpack (flux_shell_t *shell,
                                 int shell_rank,
                                 const char *fmt,


flux_shell_get_info() returns shell information as a json string with the following layout:

"options": { "verbose":b, "standalone":b },

flux_shell_get_rank_info() returns shell rank information as a json string with the following layout:

"resources": { "cores":s, ... }

where broker_rank is the broker rank on which the target shell rank of the query is running, ntasks is the number of tasks running under that shell rank, taskids is a list of task id assignments for those tasks (an RFC 22 idset string), and resources is a dictionary of resource name to resource ids assigned to the shell rank.

flux_shell_info_unpack() and flux_shell_rank_info_unpack() accomplished the same thing with Jansson-style formatting arguments.

If shell_rank is set to -1, the current shell rank is used.


All functions return 0 on success and -1 on error.



if shell is NULL, or either json_str or fmt are NULL, or if shell_rank is less than -1.


Flux: http://flux-framework.org

Jansson: https://jansson.readthedocs.io/en/2.10/apiref.html