• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ slurm_perror函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中slurm_perror函数的典型用法代码示例。如果您正苦于以下问题:C++ slurm_perror函数的具体用法?C++ slurm_perror怎么用?C++ slurm_perror使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了slurm_perror函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

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);
}
开发者ID:rathamahata,项目名称:slurm,代码行数:33,代码来源:sdiag.c


示例2: _get_job_size

static int _get_job_size(uint32_t job_id)
{
	job_info_msg_t *job_buffer_ptr;
	job_info_t * job_ptr;
	int i, size = 1;
	hostlist_t hl;

	if (slurm_load_jobs((time_t) 0, &job_buffer_ptr, SHOW_ALL)) {
		slurm_perror("slurm_load_jobs");
		return 1;
	}

	for (i = 0; i < job_buffer_ptr->record_count; i++) {
		job_ptr = &job_buffer_ptr->job_array[i];
		if (job_ptr->job_id != job_id)
			continue;
		hl = hostlist_create(job_ptr->nodes);
		if (hl) {
			size = hostlist_count(hl);
			hostlist_destroy(hl);
		}
		break;
	}
	slurm_free_job_info_msg (job_buffer_ptr);

#if _DEBUG
	printf("Size is %d\n", size);
#endif
	return size;
}
开发者ID:A1ve5,项目名称:slurm,代码行数:30,代码来源:slurm_prolog.c


示例3: scontrol_print_licenses

/* scontrol_print_licenses()
 *
 * Retrieve and display the license information
 * from the controller
 *
 */
void
scontrol_print_licenses(const char *name)
{
	int cc;
	license_info_msg_t *msg;
	uint16_t show_flags;
	static time_t last_update;

	show_flags = 0;
	/* call the controller to get the meat
	 */
	cc = slurm_load_licenses(last_update, &msg, show_flags);
	if (cc != SLURM_PROTOCOL_SUCCESS) {
		/* Hosed, crap out.
		 */
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror ("slurm_load_license error");
		return;
	}

	last_update = time(NULL);
	/* print the info
	 */
	_print_license_info(name, msg);

	/* free at last
	 */
	slurm_free_license_info_msg(msg);

	return;
}
开发者ID:FredHutch,项目名称:slurm,代码行数:38,代码来源:info_lics.c


示例4: _bg_report

/*
 * _bg_report - download and print current bgblock state information
 */
static int _bg_report(block_info_msg_t *block_ptr)
{
	int i;

	if (!block_ptr) {
		slurm_perror("No block_ptr given");
		return SLURM_ERROR;
	}

	if (!params.no_header)
		printf("BG_BLOCK         MIDPLANES       STATE    CONNECTION USE\n");
/*                      1234567890123456 123456789012 12345678 1234567890 12345+ */
/*                      RMP_22Apr1544018 bg[123x456]  READY    TORUS      COPROCESSOR */

	for (i=0; i<block_ptr->record_count; i++) {
		char *conn_str = conn_type_string_full(
			block_ptr->block_array[i].conn_type);
		printf("%-16.16s %-15.15s %-8.8s %-10.10s %s\n",
		       block_ptr->block_array[i].bg_block_id,
		       block_ptr->block_array[i].mp_str,
		       bg_block_state_string(
			       block_ptr->block_array[i].state),
		       conn_str,
		       node_use_string(
			       block_ptr->block_array[i].node_use));
		xfree(conn_str);
	}

	return SLURM_SUCCESS;
}
开发者ID:Q-Leap-Networks,项目名称:debian-slurm,代码行数:33,代码来源:sinfo.c


示例5: _clear_trigger

static int _clear_trigger(void)
{
	trigger_info_t ti;
	char tmp_c[128];

	slurm_init_trigger_msg(&ti);
	ti.trig_id	= params.trigger_id;
	ti.user_id	= params.user_id;
	if (params.job_id) {
		ti.res_type = TRIGGER_RES_TYPE_JOB;
		snprintf(tmp_c, sizeof(tmp_c), "%u", params.job_id);
		ti.res_id   = tmp_c;
	}
	if (slurm_clear_trigger(&ti)) {
		if (!params.quiet) {
			slurm_perror("slurm_clear_trigger");
			return 1;
		}
		return 0;
	}

	if (params.job_id)
		verbose("triggers for job %s cleared", ti.res_id);
	else if (params.user_id != NO_VAL)
		verbose("triggers for user %u cleared", ti.user_id);
	else
		verbose("trigger %u cleared", ti.trig_id);
	return 0;
}
开发者ID:Q-Leap-Networks,项目名称:qlustar-slurm,代码行数:29,代码来源:strigger.c


示例6: scontrol_print_cache

void
scontrol_print_cache(const char *name)
{
	int cc;
	cache_info_msg_t *msg;
	uint16_t show_flags;

	show_flags = 0;
	/* call the controller to get the meat
	 */
	cc = slurm_load_cache(&msg, show_flags);
	if (cc != SLURM_PROTOCOL_SUCCESS) {
		/* Hosed, crap out.
		 */
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror ("slurm_load_cache error");
		return;
	}

	/* print the info
	 */
	_print_cache_info(name, msg);

	/* free at last
	 */
	slurm_free_cache_info_msg(msg);

	return;
}
开发者ID:sblanton,项目名称:slurm,代码行数:30,代码来源:info_cache.c


示例7: state_control_configured_tres

extern int state_control_configured_tres(char *type)
{
	int i, cc;
	int rc = SLURM_ERROR;
	assoc_mgr_info_request_msg_t req;
	assoc_mgr_info_msg_t *msg = NULL;

	memset(&req, 0, sizeof(assoc_mgr_info_request_msg_t));
	cc = slurm_load_assoc_mgr_info(&req, &msg);
	if (cc != SLURM_PROTOCOL_SUCCESS) {
		slurm_perror("slurm_load_assoc_mgr_info error");
		goto cleanup;
	}

	for (i = 0; i < msg->tres_cnt; ++i) {
		if (!xstrcasecmp(msg->tres_names[i], type)) {
			rc = SLURM_SUCCESS;
			goto cleanup;
		}
	}

cleanup:
	slurm_free_assoc_mgr_info_msg(msg);
	return rc;
}
开发者ID:cread,项目名称:slurm,代码行数:25,代码来源:state_control.c


示例8: _is_configured_tres

/* -1 = error, 0 = is configured, 1 = isn't configured */
static int _is_configured_tres(char *type)
{

    int i, cc;
    assoc_mgr_info_request_msg_t req;
    assoc_mgr_info_msg_t *msg = NULL;

    memset(&req, 0, sizeof(assoc_mgr_info_request_msg_t));
    cc = slurm_load_assoc_mgr_info(&req, &msg);
    if (cc != SLURM_PROTOCOL_SUCCESS) {
        slurm_perror("slurm_load_assoc_mgr_info error");
        slurm_free_assoc_mgr_info_msg(msg);
        return SLURM_ERROR;
    }

    for (i = 0; i < msg->tres_cnt; ++i) {
        if (!strcasecmp(msg->tres_names[i], type)) {
            slurm_free_assoc_mgr_info_msg(msg);
            return SLURM_SUCCESS;
        }
    }

    error("'%s' is not a configured TRES", type);
    slurm_free_assoc_mgr_info_msg(msg);
    return SLURM_ERROR;

}
开发者ID:igor-ivanov,项目名称:slurm,代码行数:28,代码来源:create_res.c


示例9: scontrol_create_part

/*
 * scontrol_create_part - create a slurm partition configuration per the
 *	supplied arguments
 * IN argc - count of arguments
 * IN argv - list of arguments
 * RET 0 if no slurm error, errno otherwise. parsing error prints
 *			error message and returns 0
 */
extern int
scontrol_create_part (int argc, char *argv[])
{
	int update_cnt = 0;
	update_part_msg_t part_msg;

	slurm_init_part_desc_msg ( &part_msg );
	scontrol_parse_part_options (argc, argv, &update_cnt, &part_msg);

	if (part_msg.name == NULL) {
		exit_code = 1;
		error("PartitionName must be given.");
		return 0;
	} else if (xstrcasecmp(part_msg.name, "default") == 0) {
		exit_code = 1;
		error("PartitionName cannot be \"DEFAULT\".");
		return 0;
	}

	if (update_cnt == 0) {
		exit_code = 1;
		error("No parameters specified");
		return 0;
	}

	if (slurm_create_partition(&part_msg)) {
		exit_code = 1;
		slurm_perror("Error creating the partition");
		return slurm_get_errno ();
	} else
		return 0;
}
开发者ID:HDOD,项目名称:slurm,代码行数:40,代码来源:update_part.c


示例10: scontrol_print_node_list

/*
 * scontrol_print_node_list - print information about the supplied node list
 *	(or regular expression)
 * IN node_list - print information about the supplied node list
 *	(or regular expression)
 */
extern void
scontrol_print_node_list (char *node_list)
{
	node_info_msg_t *node_info_ptr = NULL;
	hostlist_t host_list;
	int error_code;
	uint16_t show_flags = 0;
	char *this_node_name;

	if (all_flag)
		show_flags |= SHOW_ALL;
	if (detail_flag)
		show_flags |= SHOW_DETAIL;

	error_code = scontrol_load_nodes(&node_info_ptr, show_flags);
	if (error_code) {
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror ("slurm_load_node error");
		return;
	}

	if (quiet_flag == -1) {
		char time_str[32];
		slurm_make_time_str ((time_t *)&node_info_ptr->last_update,
			             time_str, sizeof(time_str));
		printf ("last_update_time=%s, records=%d\n",
			time_str, node_info_ptr->record_count);
	}

	if (node_list == NULL) {
		scontrol_print_node (NULL, node_info_ptr);
	} else {
		if ((host_list = hostlist_create (node_list))) {
			while ((this_node_name = hostlist_shift (host_list))) {
				scontrol_print_node(this_node_name,
						    node_info_ptr);
				free(this_node_name);
			}

			hostlist_destroy(host_list);
		} else {
			exit_code = 1;
			if (quiet_flag != 1) {
				if (errno == EINVAL) {
					fprintf(stderr,
					        "unable to parse node list %s\n",
					        node_list);
				 } else if (errno == ERANGE) {
					fprintf(stderr,
					        "too many nodes in supplied range %s\n",
					        node_list);
				} else
					perror("error parsing node list");
			}
		}
	}
	return;
}
开发者ID:BYUHPC,项目名称:slurm,代码行数:65,代码来源:info_node.c


示例11: _print_job_steps

/* _print_job_step - print the specified job step's information */
static int
_print_job_steps( bool clear_old )
{
	int error_code;
	static job_step_info_response_msg_t * old_step_ptr = NULL;
	static job_step_info_response_msg_t  * new_step_ptr;
	uint16_t show_flags = 0;

	if (params.all_flag)
		show_flags |= SHOW_ALL;

	if (old_step_ptr) {
		if (clear_old)
			old_step_ptr->last_update = 0;
		/* Use a last_update time of 0 so that we can get an updated
		 * run_time for jobs rather than just its start_time */
		error_code = slurm_get_job_steps((time_t) 0, NO_VAL, NO_VAL,
						 &new_step_ptr, show_flags);
		if (error_code ==  SLURM_SUCCESS)
			slurm_free_job_step_info_response_msg( old_step_ptr );
		else if (slurm_get_errno () == SLURM_NO_CHANGE_IN_DATA) {
			error_code = SLURM_SUCCESS;
			new_step_ptr = old_step_ptr;
		}
	} else {
		error_code = slurm_get_job_steps((time_t) 0, NO_VAL, NO_VAL,
						 &new_step_ptr, show_flags);
	}
	if (error_code) {
		slurm_perror ("slurm_get_job_steps error");
		return SLURM_ERROR;
	}
	old_step_ptr = new_step_ptr;

	if (params.verbose) {
		printf ("last_update_time=%ld records=%u\n",
			(long) new_step_ptr->last_update,
			new_step_ptr->job_step_count);
	}

	if (!params.format && !params.format_long)
		params.format = "%.15i %.8j %.9P %.8u %.9M %N";

	if (!params.format_list) {
		if (params.format)
			parse_format(params.format);
		else if (params.format_long)
			parse_long_format(params.format_long);
	}

	print_steps_array( new_step_ptr->job_steps,
			   new_step_ptr->job_step_count,
			   params.format_list );
	return SLURM_SUCCESS;
}
开发者ID:bingzhang,项目名称:slurm,代码行数:56,代码来源:squeue.c


示例12: _get_info

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;
}
开发者ID:IFCA,项目名称:slurm,代码行数:11,代码来源:sdiag.c


示例13: scontrol_print_completing

/*
 * scontrol_print_completing - print jobs in completing state and
 *	associated nodes in COMPLETING or DOWN state
 */
extern void
scontrol_print_completing (void)
{
	int error_code, i;
	job_info_msg_t  *job_info_msg;
	job_info_t      *job_info;
	node_info_msg_t *node_info_msg;
	uint16_t         show_flags = 0;

	error_code = scontrol_load_job (&job_info_msg, 0);
	if (error_code) {
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror ("slurm_load_jobs error");
		return;
	}
	/* Must load all nodes including hidden for cross-index
	 * from job's node_inx to node table to work */
	/*if (all_flag)		Always set this flag */
	show_flags |= SHOW_ALL;
	if (federation_flag)
		show_flags |= SHOW_FEDERATION;
	if (local_flag)
		show_flags |= SHOW_LOCAL;
	error_code = scontrol_load_nodes(&node_info_msg, show_flags);
	if (error_code) {
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror ("slurm_load_nodes error");
		return;
	}

	/* Scan the jobs for completing state */
	job_info = job_info_msg->job_array;
	for (i = 0; i < job_info_msg->record_count; i++) {
		if (job_info[i].job_state & JOB_COMPLETING)
			scontrol_print_completing_job(&job_info[i],
						      node_info_msg);
	}
	slurm_free_node_info_msg(node_info_msg);
}
开发者ID:cread,项目名称:slurm,代码行数:45,代码来源:info_job.c


示例14: _reservation_report

/*
 * _reservation_report - print current reservation information
 */
static int _reservation_report(reserve_info_msg_t *resv_ptr)
{
	if (!resv_ptr) {
		slurm_perror("No resv_ptr given\n");
		return SLURM_ERROR;
	}
	if (resv_ptr->record_count != 0) {
		print_sinfo_reservation(resv_ptr);
	} else
		printf ("No reservations in the system\n");
	return SLURM_SUCCESS;
}
开发者ID:Q-Leap-Networks,项目名称:debian-slurm,代码行数:15,代码来源:sinfo.c


示例15: main

/* DO NOT RUN AGAINST PRODUCTION NODES, IT CAN MESS UP STATE */
int
main (int argc, char *argv[]) {
	int error_code;
	update_part_msg_t	part_update1 ;
	update_part_msg_t	part_update2 ;
	update_node_msg_t	node_update1 ;
	update_node_msg_t	node_update2 ;
	char node_name[NAME_LEN];

	slurm_init_part_desc_msg ( &part_update1 );
	slurm_init_part_desc_msg ( &part_update2 );
	part_update1 . name = "batch" ;
	part_update2 . name = "batch" ;
	part_update1 . state_up = false ;
	part_update2 . state_up = true ; 

	_getnodename(node_name, NAME_LEN);
	node_update1 . node_names = node_name ;
	node_update2 . node_names = node_name ;
	node_update1 . node_state = NODE_STATE_DRAIN ;
	node_update2 . node_state = NODE_RESUME ; 

	error_code = slurm_update_partition ( &part_update1);
	if (error_code)
		slurm_perror ("slurm_update_partition #1");

	error_code = slurm_update_partition ( &part_update2);
	if (error_code)
		slurm_perror ("slurm_update_partition #2");

	error_code = slurm_update_node ( &node_update1);
	if (error_code)
		slurm_perror ("slurm_update_node #1");

	error_code = slurm_update_node ( &node_update2);
	if (error_code)
		slurm_perror ("slurm_update_node #2");

	return (errno);
}
开发者ID:A1ve5,项目名称:slurm,代码行数:41,代码来源:update_config-tst.c


示例16: scontrol_print_bbstat

/*
 * scontrol_print_bbstat - Print burst buffer status information to stdout
 */
extern void scontrol_print_bbstat(int argc, char **argv)
{
	char *stat_resp = NULL;
	int error_code;

	error_code = slurm_load_burst_buffer_stat(argc, argv, &stat_resp);
	if (error_code) {
		exit_code = 1;
		if (quiet_flag != 1)
			slurm_perror("slurm_load_burst_buffer_stat error");
		return;
	}
	fprintf(stdout, "%s", stat_resp);
	xfree(stat_resp);
}
开发者ID:chrisdukey,项目名称:slurm,代码行数:18,代码来源:info_burst_buffer.c


示例17: _load_job_records

/* _load_job_records - load all job information for filtering
 * and verification
 */
static void
_load_job_records (void)
{
	int error_code;

	/* We need the fill job array string representation for identifying
	 * and killing job arrays */
	setenv("SLURM_BITSTR_LEN", "0", 1);
	error_code = slurm_load_jobs ((time_t) NULL, &job_buffer_ptr, 1);

	if (error_code) {
		slurm_perror ("slurm_load_jobs error");
		exit (1);
	}
}
开发者ID:adammoody,项目名称:slurm,代码行数:18,代码来源:scancel.c


示例18: scontrol_print_topo

/*
 * scontrol_print_topo - print the switch topology above the specified node
 * IN node_name - NULL to print all topology information
 */
extern void	scontrol_print_topo (char *node_list)
{
	static topo_info_response_msg_t *topo_info_msg = NULL;
	int i, match, match_cnt = 0;
	hostset_t hs;

	if ((topo_info_msg == NULL) &&
	    slurm_load_topo(&topo_info_msg)) {
		slurm_perror ("slurm_load_topo error");
		return;
	}

	if ((node_list == NULL) || (node_list[0] == '\0')) {
		slurm_print_topo_info_msg(stdout, topo_info_msg, one_liner);
		return;
	}

	/* Search for matching switch name */
	for (i=0; i<topo_info_msg->record_count; i++) {
		if (strcmp(topo_info_msg->topo_array[i].name, node_list))
			continue;
		slurm_print_topo_record(stdout, &topo_info_msg->topo_array[i],
					one_liner);
		return;
	}

	/* Search for matching node name */
	for (i=0; i<topo_info_msg->record_count; i++) {
		if ((topo_info_msg->topo_array[i].nodes == NULL) ||
		    (topo_info_msg->topo_array[i].nodes[0] == '\0'))
			continue;
		hs = hostset_create(topo_info_msg->topo_array[i].nodes);
		if (hs == NULL)
			fatal("hostset_create: memory allocation failure");
		match = hostset_within(hs, node_list);
		hostset_destroy(hs);
		if (!match)
			continue;
		match_cnt++;
		slurm_print_topo_record(stdout, &topo_info_msg->topo_array[i],
					one_liner);
	}

	if (match_cnt == 0) {
		error("Topology information contains no switch or "
		      "node named %s", node_list);
	}
}
开发者ID:VURM,项目名称:slurm,代码行数:52,代码来源:info_node.c


示例19: _single_cluster

static int _single_cluster(shares_request_msg_t *req_msg)
{
	int rc = SLURM_SUCCESS;
	shares_response_msg_t *resp_msg = NULL;

	rc = _get_info(req_msg, &resp_msg);
	if (rc) {
		slurm_perror("Couldn't get shares from controller");
		return rc;
	}

	process(resp_msg, options);
	slurm_free_shares_response_msg(resp_msg);

	return rc;
}
开发者ID:jtfrey,项目名称:slurm,代码行数:16,代码来源:sshare.c


示例20: scontrol_update_res

/*
 * scontrol_update_res - update the slurm reservation configuration per the
 *     supplied arguments
 * IN argc - count of arguments
 * IN argv - list of arguments
 * RET 0 if no slurm error, errno otherwise. parsing error prints
 *     error message and returns 0.
 */
extern int
scontrol_update_res(int argc, char *argv[])
{
    resv_desc_msg_t   resv_msg;
    int err, ret = 0;
    int free_user_str = 0, free_acct_str = 0, free_tres_license = 0,
        free_tres_bb = 0, free_tres_corecnt = 0, free_tres_nodecnt = 0;

    slurm_init_resv_desc_msg (&resv_msg);
    err = scontrol_parse_res_options(argc, argv, "No reservation update.",
                                     &resv_msg, &free_user_str,
                                     &free_acct_str, &free_tres_license,
                                     &free_tres_bb, &free_tres_corecnt,
                                     &free_tres_nodecnt);
    if (err)
        goto SCONTROL_UPDATE_RES_CLEANUP;

    if (resv_msg.name == NULL) {
        exit_code = 1;
        error("Reservation must be given.  No reservation update.");
        goto SCONTROL_UPDATE_RES_CLEANUP;
    }

    err = slurm_update_reservation(&resv_msg);
    if (err) {
        exit_code = 1;
        slurm_perror("Error updating the reservation");
        ret = slurm_get_errno();
    } else {
        printf("Reservation updated.\n");
    }

SCONTROL_UPDATE_RES_CLEANUP:
    if (free_user_str)
        xfree(resv_msg.users);
    if (free_acct_str)
        xfree(resv_msg.accounts);
    if (free_tres_license)
        xfree(resv_msg.licenses);
    if (free_tres_bb)
        xfree(resv_msg.burst_buffer);
    if (free_tres_corecnt)
        xfree(resv_msg.core_cnt);
    if (free_tres_nodecnt)
        xfree(resv_msg.node_cnt);
    return ret;
}
开发者ID:igor-ivanov,项目名称:slurm,代码行数:55,代码来源:create_res.c



注:本文中的slurm_perror函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ slurm_send_recv_controller_msg函数代码示例发布时间:2022-05-30
下一篇:
C++ slurm_mutex_unlock函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap