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

C++ pack16函数代码示例

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

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



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

示例1: _pack_front_end

/*
 * _pack_front_end - dump all configuration information about a specific
 *	front_end node in machine independent form (for network transmission)
 * IN dump_front_end_ptr - pointer to front_end node for which information is
 *	requested
 * IN/OUT buffer - buffer where data is placed, pointers automatically updated
 * IN protocol_version - slurm protocol version of client
 * NOTE: if you make any changes here be sure to make the corresponding
 *	changes to load_front_end_config in api/node_info.c
 */
static void _pack_front_end(struct front_end_record *dump_front_end_ptr,
			    Buf buffer, uint16_t protocol_version)
{
	if (protocol_version >= SLURM_2_6_PROTOCOL_VERSION) {
		packstr(dump_front_end_ptr->allow_groups, buffer);
		packstr(dump_front_end_ptr->allow_users, buffer);
		pack_time(dump_front_end_ptr->boot_time, buffer);
		packstr(dump_front_end_ptr->deny_groups, buffer);
		packstr(dump_front_end_ptr->deny_users, buffer);
		packstr(dump_front_end_ptr->name, buffer);
		pack16(dump_front_end_ptr->node_state, buffer);

		packstr(dump_front_end_ptr->reason, buffer);
		pack_time(dump_front_end_ptr->reason_time, buffer);
		pack32(dump_front_end_ptr->reason_uid, buffer);

		pack_time(dump_front_end_ptr->slurmd_start_time, buffer);
	} else if (protocol_version >= SLURM_2_5_PROTOCOL_VERSION) {
		pack_time(dump_front_end_ptr->boot_time, buffer);
		packstr(dump_front_end_ptr->name, buffer);
		pack16(dump_front_end_ptr->node_state, buffer);

		packstr(dump_front_end_ptr->reason, buffer);
		pack_time(dump_front_end_ptr->reason_time, buffer);
		pack32(dump_front_end_ptr->reason_uid, buffer);

		pack_time(dump_front_end_ptr->slurmd_start_time, buffer);
	} else {
		error("_pack_front_end: Unsupported slurm version %u",
		      protocol_version);
	}
}
开发者ID:Cray,项目名称:slurm,代码行数:42,代码来源:front_end.c


示例2: select_nodeinfo_pack

extern int select_nodeinfo_pack(select_nodeinfo_t *nodeinfo, Buf buffer,
				uint16_t protocol_version)
{
	ListIterator itr;
	node_subgrp_t *subgrp = NULL;
	uint16_t count = 0;

	if (protocol_version >= SLURM_2_1_PROTOCOL_VERSION) {
		pack16(nodeinfo->bitmap_size, buffer);

		if (nodeinfo->subgrp_list)
			count = list_count(nodeinfo->subgrp_list);

		pack16(count, buffer);

		if (count > 0) {
			itr = list_iterator_create(nodeinfo->subgrp_list);
			while ((subgrp = list_next(itr))) {
				_pack_node_subgrp(subgrp, buffer,
						  protocol_version);
			}
			list_iterator_destroy(itr);
		}
	}
	return SLURM_SUCCESS;
}
开发者ID:donaghy1,项目名称:slurm,代码行数:26,代码来源:bg_node_info.c


示例3: pack_slurm_step_layout

extern void pack_slurm_step_layout(slurm_step_layout_t *step_layout,
				   Buf buffer, uint16_t protocol_version)
{
	uint32_t i = 0;

	if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) {
		if (step_layout)
			i=1;

		pack16(i, buffer);
		if (!i)
			return;
		packstr(step_layout->front_end, buffer);
		packstr(step_layout->node_list, buffer);
		pack32(step_layout->node_cnt, buffer);
		pack32(step_layout->task_cnt, buffer);
		pack16(step_layout->task_dist, buffer);

		for (i=0; i<step_layout->node_cnt; i++) {
			pack32_array(step_layout->tids[i],
				     step_layout->tasks[i],
				     buffer);
		}
	} else {
		error("pack_slurm_step_layout: protocol_version "
		      "%hu not supported", protocol_version);
	}
}
开发者ID:Thorso,项目名称:slurm,代码行数:28,代码来源:slurm_step_layout.c


示例4: slurm_ckpt_pack_job

extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
			       uint16_t protocol_version)
{
	struct check_job_info *check_ptr =
		(struct check_job_info *)jobinfo;

	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
		uint32_t x;
		uint32_t y;
		uint32_t z;
		uint32_t size;

		size = 0;
		pack16(CHECK_POE, buffer);
		x = get_buf_offset(buffer);
		pack32(size, buffer);

		y = get_buf_offset(buffer);

		pack16(check_ptr->disabled, buffer);
		pack16(check_ptr->node_cnt, buffer);
		pack16(check_ptr->reply_cnt, buffer);
		pack16(check_ptr->wait_time, buffer);
		pack32(check_ptr->error_code, buffer);
		packstr(check_ptr->error_msg, buffer);
		pack_time(check_ptr->time_stamp, buffer);

		z = get_buf_offset(buffer);
		set_buf_offset(buffer, x);
		pack32(z - y, buffer);
		set_buf_offset(buffer, z);
	}

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


示例5: main

void main()	{

	
	vec4 heightRT = texture2D( u_Texture0, v_TexCoords );
	vec4 normRT = texture2D( u_Texture1, v_TexCoords );
	vec3 baseNorm = (normRT.rgb-0.5)*2.0;
	baseNorm.z = 0.0;
	baseNorm = normalize(baseNorm);

	vec3 faceNorm = vec3(0.0,0.0,1.0);
	float curDis = heightRT.b;
	float maxDis = 128.0/255.0;
	float startZ = 0.0;
	float endZ = 1.0;
	float lerpPow = 2.0;
	float lerpAmount = max(maxDis-curDis,0.0)/maxDis;
	
	/*
	// sharp bevel
	lerpAmount = 0.5;
	if (curDis >= 80.0/255.0) {
		lerpAmount = 0.0;
	}*/
	if (curDis <= 16.0/255.0) {
		lerpAmount = 1.0;
	}

	vec3 finalNorm = mix(faceNorm, baseNorm, lerpAmount );

	finalNorm = normalize(finalNorm);


	float alphaVal = heightRT.g;

	
	if (alphaVal == 0.0) {
		discard;
	}

	

	vec4 gIdRGBA;

	float groupId = v_Data0.z;
	gIdRGBA.rg = pack16(groupId);
	//gIdRGBA.r = floor(groupId/256.0)/255.0;
	//gIdRGBA.g = mod(groupId,256.0)/255.0;

	float matId = v_Data0.w;

	gIdRGBA.ba = pack16(matId);
	//gIdRGBA.b = floor(matId/256.0)/255.0;
	//gIdRGBA.a = mod(matId,256.0)/255.0;


	
	gl_FragColor = gIdRGBA;
	
	
}
开发者ID:BrendanBuono,项目名称:voxelquestiso,代码行数:60,代码来源:textIdShader.c


示例6: _pack_alloc

static void _pack_alloc(struct bb_alloc *bb_alloc, Buf buffer,
			uint16_t protocol_version)
{
	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
		packstr(bb_alloc->account,      buffer);
		pack32(bb_alloc->array_job_id,  buffer);
		pack32(bb_alloc->array_task_id, buffer);
		pack_time(bb_alloc->create_time, buffer);
		pack32(bb_alloc->job_id,        buffer);
		packstr(bb_alloc->name,         buffer);
		packstr(bb_alloc->partition,    buffer);
		packstr(bb_alloc->pool,   	buffer);
		packstr(bb_alloc->qos,          buffer);
		pack64(bb_alloc->size,          buffer);
		pack16(bb_alloc->state,         buffer);
		pack32(bb_alloc->user_id,       buffer);
	} else {
		packstr(bb_alloc->account,      buffer);
		pack32(bb_alloc->array_job_id,  buffer);
		pack32(bb_alloc->array_task_id, buffer);
		pack_time(bb_alloc->create_time, buffer);
		pack32((uint32_t)0, buffer);
		pack32(bb_alloc->job_id,        buffer);
		packstr(bb_alloc->name,         buffer);
		packstr(bb_alloc->partition,    buffer);
		packstr(bb_alloc->qos,          buffer);
		pack64(bb_alloc->size,          buffer);
		pack16(bb_alloc->state,         buffer);
		pack32(bb_alloc->user_id,       buffer);
	}
}
开发者ID:Q-Leap-Networks,项目名称:qlustar-slurm,代码行数:31,代码来源:burst_buffer_common.c


示例7: _dump_part_state

/*
 * _dump_part_state - dump the state of a specific partition to a buffer
 * IN part_ptr - pointer to partition for which information
 *	is requested
 * IN/OUT buffer - location to store data, pointers automatically advanced
 */
static void _dump_part_state(struct part_record *part_ptr, Buf buffer)
{
	xassert(part_ptr);
	if (default_part_loc == part_ptr)
		part_ptr->flags |= PART_FLAG_DEFAULT;
	else
		part_ptr->flags &= (~PART_FLAG_DEFAULT);

	packstr(part_ptr->name,          buffer);
	pack32(part_ptr->grace_time,	 buffer);
	pack32(part_ptr->max_time,       buffer);
	pack32(part_ptr->default_time,   buffer);
	pack32(part_ptr->max_nodes_orig, buffer);
	pack32(part_ptr->min_nodes_orig, buffer);

	pack16(part_ptr->flags,          buffer);
	pack16(part_ptr->max_share,      buffer);
	pack16(part_ptr->preempt_mode,   buffer);
	pack16(part_ptr->priority,       buffer);

	pack16(part_ptr->state_up,       buffer);
	packstr(part_ptr->allow_groups,  buffer);
	packstr(part_ptr->allow_alloc_nodes, buffer);
	packstr(part_ptr->alternate,     buffer);
	packstr(part_ptr->nodes,         buffer);
}
开发者ID:lipari,项目名称:slurm,代码行数:32,代码来源:partition_mgr.c


示例8: io_hdr_pack

void
io_hdr_pack(io_hdr_t *hdr, Buf buffer)
{
	pack16(hdr->type, buffer);
	pack16(hdr->gtaskid, buffer);
	pack16(hdr->ltaskid, buffer);
	pack32(hdr->length, buffer);
}
开发者ID:A1ve5,项目名称:slurm,代码行数:8,代码来源:io_hdr.c


示例9: _select_jobinfo_pack

static void _select_jobinfo_pack(select_jobinfo_t *jobinfo, Buf buffer,
				 uint16_t protocol_version)
{
	if (!jobinfo) {
		pack16(0, buffer);
	} else {
		pack16(jobinfo->cleaning, buffer);
	}
}
开发者ID:mrhaoji,项目名称:slurm,代码行数:9,代码来源:select_cray.c


示例10: _pack_register_ctld_msg

static void _pack_register_ctld_msg(dbd_register_ctld_msg_t *msg,
				    uint16_t rpc_version, Buf buffer)
{
	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
		pack16(msg->dimensions, buffer);
		pack32(msg->flags, buffer);
		pack32(msg->plugin_id_select, buffer);
		pack16(msg->port, buffer);
	}
}
开发者ID:SchedMD,项目名称:slurm,代码行数:10,代码来源:slurmdbd_pack.c


示例11: _pack_node_subgrp

static int _pack_node_subgrp(node_subgrp_t *subgrp, Buf buffer,
			     uint16_t protocol_version)
{
	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
		pack_bit_fmt(subgrp->bitmap, buffer);
		pack16(subgrp->cnode_cnt, buffer);
		pack16(subgrp->state, buffer);
	}

	return SLURM_SUCCESS;
}
开发者ID:BYUHPC,项目名称:slurm,代码行数:11,代码来源:bg_node_info.c


示例12: _pack_jobacct_id

static void _pack_jobacct_id(jobacct_id_t *jobacct_id,
			     uint16_t rpc_version, Buf buffer)
{
	if (jobacct_id) {
		pack32((uint32_t) jobacct_id->nodeid, buffer);
		pack16((uint16_t) jobacct_id->taskid, buffer);
	} else {
		pack32((uint32_t) NO_VAL, buffer);
		pack16((uint16_t) NO_VAL, buffer);
	}
}
开发者ID:HPCNow,项目名称:slurm,代码行数:11,代码来源:slurm_jobacct_gather.c


示例13: slurm_persist_pack_rc_msg

extern void slurm_persist_pack_rc_msg(
	persist_rc_msg_t *msg, Buf buffer, uint16_t protocol_version)
{
	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
		packstr(msg->comment, buffer);
		pack16(msg->flags, buffer);
		pack32(msg->rc, buffer);
		pack16(msg->ret_info, buffer);
	} else {
		error("%s: invalid protocol version %u",
		      __func__, protocol_version);
	}
}
开发者ID:SchedMD,项目名称:slurm,代码行数:13,代码来源:slurm_persist_conn.c


示例14: slurm_persist_pack_init_req_msg

extern void slurm_persist_pack_init_req_msg(
	persist_init_req_msg_t *msg, Buf buffer)
{
	/* always send version field first for backwards compatibility */
	pack16(msg->version, buffer);

	if (msg->version >= SLURM_MIN_PROTOCOL_VERSION) {
		packstr(msg->cluster_name, buffer);
		pack16(msg->persist_type, buffer);
		pack16(msg->port, buffer);
	} else {
		error("%s: invalid protocol version %u",
		      __func__, msg->version);
	}
}
开发者ID:SchedMD,项目名称:slurm,代码行数:15,代码来源:slurm_persist_conn.c


示例15: switch_p_pack_jobinfo

int switch_p_pack_jobinfo(switch_jobinfo_t *switch_job, Buf buffer,
			  uint16_t protocol_version)
{
	sw_gen_step_info_t *gen_step_info = (sw_gen_step_info_t *) switch_job;
	sw_gen_node_t *node_ptr;
	sw_gen_ifa_t *ifa_ptr;
	int i, j;

	if (debug_flags & DEBUG_FLAG_SWITCH)
		info("switch_p_pack_jobinfo() starting");
	xassert(gen_step_info);
	xassert(gen_step_info->magic == SW_GEN_STEP_INFO_MAGIC);

	pack32(gen_step_info->node_cnt, buffer);
	for (i = 0; i < gen_step_info->node_cnt; i++) {
		node_ptr = gen_step_info->node_array[i];
		packstr(node_ptr->node_name, buffer);
		pack16(node_ptr->ifa_cnt, buffer);
		for (j = 0; j < node_ptr->ifa_cnt; j++) {
			ifa_ptr = node_ptr->ifa_array[j];
			if (debug_flags & DEBUG_FLAG_SWITCH) {
				info("node=%s name=%s family=%s addr=%s",
				     node_ptr->node_name, ifa_ptr->ifa_name,
				     ifa_ptr->ifa_family, ifa_ptr->ifa_addr);
			}
			packstr(ifa_ptr->ifa_addr, buffer);
			packstr(ifa_ptr->ifa_family, buffer);
			packstr(ifa_ptr->ifa_name, buffer);
		}
	}

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


示例16: slurm_persist_pack_rc_msg

extern void slurm_persist_pack_rc_msg(
	persist_rc_msg_t *msg, Buf buffer, uint16_t protocol_version)
{
	packstr(msg->comment, buffer);
	pack32(msg->rc, buffer);
	pack16(msg->ret_info, buffer);
}
开发者ID:jtfrey,项目名称:slurm,代码行数:7,代码来源:slurm_persist_conn.c


示例17: name_unpublish_up

extern int
name_unpublish_up(char *name)
{
	Buf buf = NULL, resp_buf = NULL;
	uint32_t size, tmp_32;
	int rc;

	buf = init_buf(1024);
	pack16((uint16_t)TREE_CMD_NAME_UNPUBLISH, buf);
	packstr(name, buf);
	size = get_buf_offset(buf);

	rc = tree_msg_to_srun_with_resp(size, get_buf_data(buf), &resp_buf);
	free_buf(buf);

	if (rc == SLURM_SUCCESS) {
		safe_unpack32(&tmp_32, resp_buf);
		rc = (int) tmp_32;
	}

unpack_error:
	if (resp_buf)
		free_buf(resp_buf);
	
	return rc;
}
开发者ID:A1ve5,项目名称:slurm,代码行数:26,代码来源:nameserv.c


示例18: slurm_persist_msg_pack

extern Buf slurm_persist_msg_pack(slurm_persist_conn_t *persist_conn,
				  persist_msg_t *req_msg)
{
	Buf buffer;

	xassert(persist_conn);

	if (persist_conn->flags & PERSIST_FLAG_DBD)
		buffer = pack_slurmdbd_msg((slurmdbd_msg_t *)req_msg,
					   persist_conn->version);
	else {
		slurm_msg_t msg;

		slurm_msg_t_init(&msg);

		msg.data      = req_msg->data;
		msg.data_size = req_msg->data_size;
		msg.msg_type  = req_msg->msg_type;
		msg.protocol_version = persist_conn->version;

		buffer = init_buf(BUF_SIZE);

		pack16(req_msg->msg_type, buffer);
		if (pack_msg(&msg, buffer) != SLURM_SUCCESS) {
			free_buf(buffer);
			return NULL;
                }
	}

	return buffer;
}
开发者ID:SchedMD,项目名称:slurm,代码行数:31,代码来源:slurm_persist_conn.c


示例19: _pack_roll_usage_msg

static void _pack_roll_usage_msg(dbd_roll_usage_msg_t *msg,
				 uint16_t rpc_version, Buf buffer)
{
	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
		pack16(msg->archive_data, buffer);
		pack_time(msg->end, buffer);
		pack_time(msg->start, buffer);
	}
}
开发者ID:SchedMD,项目名称:slurm,代码行数:9,代码来源:slurmdbd_pack.c


示例20: slurm_ckpt_pack_job

extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
			       uint16_t protocol_version)
{
	struct check_job_info *check_ptr =
		(struct check_job_info *)jobinfo;

	if (protocol_version >= SLURM_2_3_PROTOCOL_VERSION) {
		pack16(check_ptr->disabled, buffer);
		pack16(check_ptr->reply_cnt, buffer);
		pack16(check_ptr->wait_time, buffer);

		pack32(check_ptr->error_code, buffer);
		packstr(check_ptr->error_msg, buffer);
		pack_time(check_ptr->time_stamp, buffer);
	}

	return SLURM_SUCCESS;
}
开发者ID:kwangiit,项目名称:SLURMPP,代码行数:18,代码来源:checkpoint_ompi.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pack32函数代码示例发布时间:2022-05-30
下一篇:
C++ pack函数代码示例发布时间: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