flux_shell_get_info(3)
SYNOPSIS
#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,
...);
Link with -lflux-core.
DESCRIPTION
flux_shell_get_info()
returns shell information as a json string
with the following layout:
"jobid":I,
"instance_owner":i,
"rank":i,
"size":i,
"ntasks";i,
"service";s,
"options": { "verbose":b, "standalone":b },
"jobspec":o,
"R":o
flux_shell_get_rank_info()
returns shell rank information as a json
string with the following layout:
"id":i,
"name":s,
"broker_rank":i,
"ntasks":i
"taskids":s
"resources": { "ncores":i, "cores":s, ... }
where id
is the shell rank, name
is the hostname of that shell
rank, 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.
RETURN VALUE
All functions return 0 on success and -1 on error.
ERRORS
- EINVAL
if
shell
is NULL, or eitherjson_str
orfmt
are NULL, or ifshell_rank
is less than -1.
RESOURCES
Flux: http://flux-framework.org
Flux RFC: https://flux-framework.readthedocs.io/projects/flux-rfc
Issue Tracker: https://github.com/flux-framework/flux-core/issues