Esempio n. 1
0
int main(int argc, char *argv[])
{
    int rc = 0;

    slurm_conf_init(NULL);
    parse_command_line(argc, argv);

    if (sdiag_param == STAT_COMMAND_RESET) {
        req.command_id = STAT_COMMAND_RESET;
        rc = slurm_reset_statistics((stats_info_request_msg_t *)&req);
        if (rc == SLURM_SUCCESS)
            printf("Reset scheduling statistics\n");
        else
            slurm_perror("slurm_reset_statistics");
    } else {
        req.command_id = STAT_COMMAND_GET;
        rc = slurm_get_statistics(&buf,
                                  (stats_info_request_msg_t *)&req);
        if (rc == SLURM_SUCCESS) {
            _sort_rpc();
            rc = _print_stats();
#ifdef MEMORY_LEAK_DEBUG
            uid_cache_clear();
            slurm_free_stats_response_msg(buf);
            xfree(rpc_type_ave_time);
            xfree(rpc_user_ave_time);
#endif
        } else
            slurm_perror("slurm_get_statistics");
    }

    exit(rc);
}
Esempio n. 2
0
File: sdiag.c Progetto: IFCA/slurm
static int _get_info(void)
{
	int rc;

	req.command_id = STAT_COMMAND_GET;
	rc = slurm_get_statistics(&buf, (stats_info_request_msg_t *)&req);
	if (rc != SLURM_SUCCESS)
		slurm_perror("slurm_get_statistics");

	return rc;
}