您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timestamp_get函数代码示例

51自学网 2021-06-03 08:51:55
  C++
这篇教程C++ timestamp_get函数代码示例写得很实用,希望能帮到您。

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

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

示例1: makeflow_alloc_release_space

int makeflow_alloc_release_space( struct makeflow_alloc *a, struct dag_node *n, uint64_t size, makeflow_alloc_release release){	uint64_t start = timestamp_get();	struct makeflow_alloc *alloc1;	makeflow_alloc_print_stats(a, "RELEASE");	if(a->enabled == MAKEFLOW_ALLOC_TYPE_OFF){		a->storage->used -= size;		dynamic_alloc += timestamp_get() - start;		return 1;	}	alloc1 = makeflow_alloc_traverse_to_node(a, n);	if(alloc1->nodeid != n->nodeid){		dynamic_alloc += timestamp_get() - start;		return 0;	}	makeflow_alloc_shrink_alloc(alloc1, size, release);	if(alloc1->storage->total == 0){		makeflow_alloc_delete(alloc1);	}	dynamic_alloc += timestamp_get() - start;	makeflow_alloc_print_stats(a, "RELEASE");	return 1;}
开发者ID:Nekel-Seyew,项目名称:cctools,代码行数:29,


示例2: makeflow_gc_all

static void makeflow_gc_all( struct dag *d, struct batch_queue *queue, int maxfiles ){	int collected = 0;	struct dag_file *f;	char *name;	timestamp_t start_time, stop_time;	/* This will walk the table of files to collect and will remove any	 * that are below or equal to the threshold. */	start_time = timestamp_get();	hash_table_firstkey(d->files);	while(hash_table_nextkey(d->files, &name, (void **) &f) && collected < maxfiles) {		if(f->state == DAG_FILE_STATE_COMPLETE			&& !dag_file_is_source(f)			&& !set_lookup(d->outputs, f)			&& !set_lookup(d->inputs, f)			&& makeflow_file_clean(d, queue, f, 0)){			collected++;		}	}	stop_time = timestamp_get();	/* Record total amount of files collected to Makeflowlog. */	if(collected > 0) {		makeflow_gc_collected += collected;		makeflow_log_gc_event(d,collected,stop_time-start_time,makeflow_gc_collected);	}}
开发者ID:isanwong,项目名称:cctools,代码行数:30,


示例3: do_put

static INT64_T do_put(int argc, char **argv){	char target_full_path[CHIRP_PATH_MAX];	char source_full_path[CHIRP_PATH_MAX];	timestamp_t start, stop;	double elapsed;	INT64_T result;	if(!argv[2])		argv[2] = (char *) path_basename(argv[1]);	complete_local_path(argv[1], source_full_path);	complete_remote_path(argv[2], target_full_path);	start = timestamp_get();	result = chirp_recursive_put(current_host, source_full_path, target_full_path, stoptime);	stop = timestamp_get();	elapsed = (stop - start) / 1000000.0;	if(result > 0) {		printf("%sB written in %.2fs ", string_metric(result, -1, 0), elapsed);		printf("(%sB/s)/n", string_metric(result / elapsed, -1, 0));	}	return result;}
开发者ID:ailurus1991,项目名称:cctools,代码行数:27,


示例4: romstage_init

void romstage_init(void){	void *entry;	#if CONFIG_COLLECT_TIMESTAMPS	uint64_t start_romstage_time;	uint64_t before_dram_time;	uint64_t after_dram_time;	uint64_t base_time = timestamp_get();	start_romstage_time = timestamp_get();#endif	rkclk_set_pll();	console_init();#if CONFIG_COLLECT_TIMESTAMPS	before_dram_time = timestamp_get();#endif	dram_main();#if CONFIG_COLLECT_TIMESTAMPS	after_dram_time = timestamp_get();#endif	udelay(100);	cbmem_initialize_empty();#if CONFIG_COLLECT_TIMESTAMPS	timestamp_init(base_time);	timestamp_add(TS_START_ROMSTAGE, start_romstage_time );	timestamp_add(TS_BEFORE_INITRAM, before_dram_time );	timestamp_add(TS_AFTER_INITRAM, after_dram_time );#endif	entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");#if CONFIG_COLLECT_TIMESTAMPS	timestamp_add_now(TS_END_ROMSTAGE);#endif	stage_exit(entry);}
开发者ID:kleopatra999,项目名称:coreboot,代码行数:33,


示例5: makeflow_alloc_commit_space

int makeflow_alloc_commit_space( struct makeflow_alloc *a, struct dag_node *n){	uint64_t start = timestamp_get();	if(!a)		return 0;	makeflow_alloc_print_stats(a, "COMMIT");	if(a->enabled == MAKEFLOW_ALLOC_TYPE_OFF)		return 1;	struct dag_node *node1;	struct makeflow_alloc *alloc1, *alloc2;	alloc1 = makeflow_alloc_traverse_to_node(a, n);	if(alloc1->nodeid == n->nodeid && (a->enabled == MAKEFLOW_ALLOC_TYPE_OUT)){		if(!(makeflow_alloc_grow_alloc(alloc1, makeflow_alloc_node_size(a, n, n)))){			dynamic_alloc += timestamp_get() - start;			return 0;		}	} else if(alloc1->nodeid == n->nodeid){		if(alloc1->storage->free < n->footprint->target_size){			dynamic_alloc += timestamp_get() - start;			return 0;		}	} else {		while((node1 = list_peek_current(n->footprint->residual_nodes))){			alloc2 = makeflow_alloc_create(node1->nodeid, alloc1, 0, 0, a->enabled);			if(!(makeflow_alloc_grow_alloc(alloc2, makeflow_alloc_node_size(a, node1, n))				|| (n == node1 && set_size(n->descendants) < 2 &&					makeflow_alloc_grow_alloc(alloc2, node1->footprint->self_res)))){				dynamic_alloc += timestamp_get() - start;				return 0;			}			list_push_tail(alloc1->residuals, alloc2);			alloc1 = alloc2;			list_next_item(n->footprint->residual_nodes);		}	}	alloc1->storage->greedy += n->footprint->target_size;	alloc1->storage->free   -= n->footprint->target_size;	makeflow_alloc_print_stats(alloc1, "GREEDY");	alloc1 = alloc1->parent;	while(alloc1){		alloc1->storage->greedy += n->footprint->target_size;		alloc1->storage->commit -= n->footprint->target_size;		makeflow_alloc_print_stats(alloc1, "GREEDY");		alloc1 = alloc1->parent;	}	dynamic_alloc += timestamp_get() - start;	return 1;}
开发者ID:Nekel-Seyew,项目名称:cctools,代码行数:55,


示例6: main

void main(void){#if CONFIG_COLLECT_TIMESTAMPS	uint64_t start_romstage_time;	uint64_t before_dram_time;	uint64_t after_dram_time;	uint64_t base_time = timestamp_get();	start_romstage_time = timestamp_get();#endif	console_init();	configure_l2ctlr();	tsadc_init();	/* vdd_log 1200mv is enough for ddr run 666Mhz */	regulate_vdd_log(1200);#if CONFIG_COLLECT_TIMESTAMPS	before_dram_time = timestamp_get();#endif	sdram_init(get_sdram_config());#if CONFIG_COLLECT_TIMESTAMPS	after_dram_time = timestamp_get();#endif	/* Now that DRAM is up, add mappings for it and DMA coherency buffer. */	mmu_config_range((uintptr_t)_dram/MiB,			 sdram_size_mb(), DCACHE_WRITEBACK);	mmu_config_range((uintptr_t)_dma_coherent/MiB,			 _dma_coherent_size/MiB, DCACHE_OFF);	cbmem_initialize_empty();#if CONFIG_COLLECT_TIMESTAMPS	timestamp_init(base_time);	timestamp_add(TS_START_ROMSTAGE, start_romstage_time);	timestamp_add(TS_BEFORE_INITRAM, before_dram_time);	timestamp_add(TS_AFTER_INITRAM, after_dram_time);	timestamp_add_now(TS_END_ROMSTAGE);#endif#if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE)	void *entry = vboot2_load_ramstage();	if (entry != NULL)		stage_exit(entry);#endif	run_ramstage();}
开发者ID:zamaudio,项目名称:coreboot,代码行数:48,


示例7: motor_driver_get_trajectory_point

void motor_driver_get_trajectory_point(motor_driver_t *d,                                       int64_t timestamp_us,                                       float *position,                                       float *velocity,                                       float *acceleration,                                       float *torque){    if (d->control_mode != MOTOR_CONTROL_MODE_TRAJECTORY) {        chSysHalt("motor driver get trajectory wrong setpt mode");    }    float *t = trajectory_read(d->setpt.trajectory, timestamp_us);    if (t == NULL) {        // chSysHalt("control error"); // todo        log_message("trajectory read: %d failed", timestamp_get());        *position = 0;        *velocity = 0;        *acceleration = 0;        *torque = 0;        return;    }    *position = t[0];    *velocity = t[1];    *acceleration = t[2];    *torque = t[3];}
开发者ID:SyrianSpock,项目名称:master-firmware,代码行数:25,


示例8: dag_node_state_change

void dag_node_state_change(struct dag *d, struct dag_node *n, int newstate){	debug(D_DEBUG, "node %d %s -> %s/n", n->nodeid, dag_node_state_name(n->state), dag_node_state_name(newstate));	if(d->node_states[n->state] > 0) {		d->node_states[n->state]--;	}	n->state = newstate;	d->node_states[n->state]++;	/**	 * Line format : timestamp node_id new_state job_id nodes_waiting nodes_running nodes_complete nodes_failed nodes_aborted node_id_counter	 *	 * timestamp - the unix time (in microseconds) when this line is written to the log file.	 * node_id - the id of this node (task).	 * new_state - a integer represents the new state this node (whose id is in the node_id column) has just entered. The value of the integer ranges from 0 to 4 and the states they are representing are:	 *	0. waiting	 *	1. running	 *	2. complete	 *	3. failed	 *	4. aborted	 * job_id - the job id of this node in the underline execution system (local or batch system). If the makeflow is executed locally, the job id would be the process id of the process that executes this node. If the underline execution system is a batch system, such as Condor or SGE, the job id would be the job id assigned by the batch system when the task was sent to the batch system for execution.	 * nodes_waiting - the number of nodes are waiting to be executed.	 * nodes_running - the number of nodes are being executed.	 * nodes_complete - the number of nodes has been completed.	 * nodes_failed - the number of nodes has failed.	 * nodes_aborted - the number of nodes has been aborted.	 * node_id_counter - total number of nodes in this makeflow.	 *	 */	fprintf(d->logfile, "%" PRIu64 " %d %d %d %d %d %d %d %d %d/n", timestamp_get(), n->nodeid, newstate, n->jobid, d->node_states[0], d->node_states[1], d->node_states[2], d->node_states[3], d->node_states[4], d->nodeid_counter);}
开发者ID:dcbradley,项目名称:cctools,代码行数:32,


示例9: main

void main(void){	extern struct mem_timings mem_timings;	int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);	int power_init_failed;	exynos5420_config_smp();	power_init_failed = setup_power(is_resume);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);	/* Clock must be initialized before console_init, otherwise you may need	 * to re-initialize serial console drivers again. */	system_clock_init();	exynos_pinmux_uart3();	console_init();	exception_init();	if (power_init_failed)		die("Failed to intialize power./n");	/* re-initialize PMIC I2C channel after (re-)setting system clocks */	i2c_init(PMIC_I2C_BUS, 1000000, 0x00); /* 1MHz */	timestamp_add_now(TS_BEFORE_INITRAM);	setup_memory(&mem_timings, is_resume);	timestamp_add_now(TS_AFTER_INITRAM);	primitive_mem_test();	trustzone_init();	if (is_resume) {		wakeup();	}	setup_gpio();	setup_ec();	simple_spi_test();	/* Set SPI (primary CBFS media) clock to 50MHz. */	/* if this is uncommented SPI will not work correctly. */	clock_set_rate(PERIPH_ID_SPI1, 50000000);	exynos_pinmux_spi1();	simple_spi_test();	cbmem_initialize_empty();	simple_spi_test();	timestamp_add_now(TS_END_ROMSTAGE);	run_ramstage();}
开发者ID:bitpick,项目名称:coreboot,代码行数:59,


示例10: estimate_run_time

double estimate_run_time( struct text_list *seta, struct text_list *setb ){	char line[ALLPAIRS_LINE_MAX];	timestamp_t starttime, stoptime;	int x,y;	fprintf(stderr, "%s: sampling execution time of %s.../n",progname,allpairs_compare_program);	starttime = timestamp_get();	for(x=0;x<xstop;x++) {		for(y=0;y<ystop;y++) {			sprintf(line,"./%s %s %s %s",				string_basename(allpairs_compare_program),				extra_arguments,				text_list_get(seta,x),				text_list_get(setb,y)				);			FILE *file = fast_popen(line);			if(!file) {				fprintf(stderr,"%s: couldn't execute %s: %s/n",progname,line,strerror(errno));				exit(1);			}			while(fgets(line,sizeof(line),file)) {				fprintf(stderr,"%s",line);			}			fast_pclose(file);			stoptime = timestamp_get();					if(stoptime-starttime>5000000) break;		}		if(stoptime-starttime>5000000) break;	}	double t = (double)(stoptime - starttime) / (x * ystop + y + 1) / 1000000;	if(t<0.01) t = 0.01;	return t;}
开发者ID:rmcgibbo,项目名称:cctools-3.4.2-fork,代码行数:44,


示例11: measure_task_time

static double measure_task_time(){	struct wavefront_task *t = wavefront_task_create(1,1,1,1);	struct batch_job_info info;	batch_job_id_t jobid;	int test_jobs_complete = 0;	batch_q = batch_queue_create(BATCH_QUEUE_TYPE_LOCAL);	timestamp_t start = timestamp_get();	timestamp_t stop;	printf("Measuring wavefront_task execution time.../n");	do {		jobid = wavefront_task_submit_single(t);		if(jobid<0) {			fprintf(stderr,"wavefront: couldn't create a local process: %s/n",strerror(errno));			exit(1);		}		jobid = batch_job_wait(batch_q,&info);		if(jobid<0) {			fprintf(stderr,"wavefront: couldn't wait for process %" PRIbjid ": %s/n",jobid,strerror(errno));			exit(1);		}		if(!info.exited_normally || info.exit_code!=0) {			fprintf(stderr,"wavefront: %s exited with an error. See files R.1.1 and E.1.1 for details./n",function);			exit(1);		}		test_jobs_complete++;		stop = timestamp_get();	} while((stop-start)<5000000);	double task_time = (stop-start)/test_jobs_complete/1000000.0;	printf("Average execution time is %0.02lf/n",task_time);	return task_time;}
开发者ID:LyonsLab,项目名称:cctools,代码行数:43,


示例12: main

void main(void){	uint64_t base_timestamp = 0;	init_timer();	if (IS_ENABLED(CONFIG_COLLECT_TIMESTAMPS))		base_timestamp = timestamp_get();	bootblock_main_with_timestamp(base_timestamp);}
开发者ID:lynxis,项目名称:coreboot-signed,代码行数:11,


示例13: makeflow_alloc_check_space

int makeflow_alloc_check_space( struct makeflow_alloc *a, struct dag_node *n){	uint64_t start = timestamp_get();	if(!a){		dynamic_alloc += timestamp_get() - start;		makeflow_alloc_print_stats(a, "CHECK FAIL NON-EXIST");		return 0;	}	makeflow_alloc_print_stats(a, "CHECK");	if(a->enabled == MAKEFLOW_ALLOC_TYPE_OFF){		dynamic_alloc += timestamp_get() - start;		makeflow_alloc_print_stats(a, "CHECK SUCCESS");		return 1;	}	struct dag_node *node1;	struct makeflow_alloc *alloc1, *alloc2;	alloc1 = makeflow_alloc_traverse_to_node(a, n);	if(alloc1->nodeid == n->nodeid){		if(a->enabled != MAKEFLOW_ALLOC_TYPE_OUT &&			(alloc1->storage->free < n->footprint->target_size)){			dynamic_alloc += timestamp_get() - start;			//printf("%d/t", n->nodeid);			makeflow_alloc_print_stats(alloc1, "CHECK FAIL PRE-ALLOC");			return 0;		}		dynamic_alloc += timestamp_get() - start;		makeflow_alloc_print_stats(alloc1, "CHECK SUCCESS");		return 1;	}	while((node1 = list_peek_current(n->footprint->residual_nodes))){		alloc2 = makeflow_alloc_create(node1->nodeid, alloc1, 0, 0, a->enabled);		if(!(makeflow_alloc_try_grow_alloc(alloc2, makeflow_alloc_node_size(a, node1, n))			|| (n == node1 && set_size(n->descendants) < 2 &&				makeflow_alloc_try_grow_alloc(alloc2, node1->footprint->self_res)))){			dynamic_alloc += timestamp_get() - start;			//printf("%d/t%"PRIu64"/t", n->nodeid, makeflow_alloc_node_size(a, node1, n));			makeflow_alloc_print_stats(alloc1, "CHECK FAIL NON-FIT");			makeflow_alloc_delete(alloc2);			return 0;		}		makeflow_alloc_delete(alloc2);		list_next_item(n->footprint->residual_nodes);	}	dynamic_alloc += timestamp_get() - start;	makeflow_alloc_print_stats(alloc1, "CHECK SUCCESS");	return 1;}
开发者ID:Nekel-Seyew,项目名称:cctools,代码行数:55,


示例14: rate_limiter_should_run

bool rate_limiter_should_run(rate_limiter_t *rl){    bool should_run = true;    timestamp_t now = timestamp_get();    if (timestamp_duration(rl->last_update, now) >= 1.0f/parameter_scalar_read(&rl->rate)) {        should_run = true;        rl->last_update = now;    } else {        should_run = false;    }    return should_run;}
开发者ID:Stapelzeiger,项目名称:INS-board-fw,代码行数:13,


示例15: work_queue_process_execute

pid_t work_queue_process_execute( struct work_queue_process *p ){	fflush(NULL); /* why is this necessary? */		p->output_file_name = strdup(task_output_template);	p->output_fd = mkstemp(p->output_file_name);	if (p->output_fd == -1) {		debug(D_WQ, "Could not open worker stdout: %s", strerror(errno));		return 0;	}	p->execution_start = timestamp_get();	p->pid = fork();		if(p->pid > 0) {		// Make child process the leader of its own process group. This allows		// signals to also be delivered to processes forked by the child process.		// This is currently used by kill_task(). 		setpgid(p->pid, 0); 				debug(D_WQ, "started process %d: %s", p->pid, p->task->command_line);		return p->pid;	} else if(p->pid < 0) {		debug(D_WQ, "couldn't create new process: %s/n", strerror(errno));		unlink(p->output_file_name);		close(p->output_fd);		return p->pid;	} else {		if(chdir(p->sandbox)) {			fatal("could not change directory into %s: %s", p->sandbox, strerror(errno));		}				int fd = open("/dev/null", O_RDONLY);		if (fd == -1) fatal("could not open /dev/null: %s", strerror(errno));		int result = dup2(fd, STDIN_FILENO);		if (result == -1) fatal("could not dup /dev/null to stdin: %s", strerror(errno));		result = dup2(p->output_fd, STDOUT_FILENO);		if (result == -1) fatal("could not dup pipe to stdout: %s", strerror(errno));		result = dup2(p->output_fd, STDERR_FILENO);		if (result == -1) fatal("could not dup pipe to stderr: %s", strerror(errno));		close(p->output_fd);		execlp("sh", "sh", "-c", p->task->command_line, (char *) 0);		_exit(127);	// Failed to execute the cmd.	}	return 0;}
开发者ID:LyonsLab,项目名称:cctools,代码行数:51,


示例16: makeflow_log_state_change

void makeflow_log_state_change( struct dag *d, struct dag_node *n, int newstate ){	debug(D_MAKEFLOW_RUN, "node %d %s -> %s/n", n->nodeid, dag_node_state_name(n->state), dag_node_state_name(newstate));	if(d->node_states[n->state] > 0) {		d->node_states[n->state]--;	}	n->state = newstate;	d->node_states[n->state]++;	fprintf(d->logfile, "%" PRIu64 " %d %d %" PRIbjid " %d %d %d %d %d %d/n", timestamp_get(), n->nodeid, newstate, n->jobid, d->node_states[0], d->node_states[1], d->node_states[2], d->node_states[3], d->node_states[4], d->nodeid_counter);	makeflow_log_sync(d,0);}
开发者ID:xavierdingdev,项目名称:cctools,代码行数:14,


示例17: makeflow_gc_all

static void makeflow_gc_all( struct dag *d, int maxfiles ){	int collected = 0;	struct dag_file *f;	timestamp_t start_time, stop_time;	/* This will walk the table of files to collect and will remove any	 * that are below or equal to the threshold. */	start_time = timestamp_get();	set_first_element(d->collect_table);	while((f = set_next_element(d->collect_table)) && collected < maxfiles) {		if(f->ref_count < 1 && makeflow_gc_file(d, f))			collected++;	}	stop_time = timestamp_get();	/* Record total amount of files collected to Makeflowlog. */	if(collected > 0) {		makeflow_gc_collected += collected;		makeflow_log_gc_event(d,collected,stop_time-start_time,makeflow_gc_collected);	}}
开发者ID:andreyto,项目名称:at-fork-cctools,代码行数:23,


示例18: makeflow_log_file_state_change

void makeflow_log_file_state_change( struct dag *d, struct dag_file *f, int newstate ){	debug(D_MAKEFLOW_RUN, "file %s %s -> %s/n", f->filename, dag_file_state_name(f->state), dag_file_state_name(newstate));	f->state = newstate;	timestamp_t time = timestamp_get();	fprintf(d->logfile, "# %d %s %" PRIu64 "/n", f->state, f->filename, time);	if(f->state == DAG_FILE_STATE_EXISTS){		d->completed_files += 1;		f->creation_logged = (time_t) (time / 1000000);	} else if(f->state == DAG_FILE_STATE_DELETE) {		d->deleted_files += 1;	}	makeflow_log_sync(d,0);}
开发者ID:xavierdingdev,项目名称:cctools,代码行数:16,


示例19: bootblock_soc_init

void bootblock_soc_init(void){	timestamp_init(timestamp_get());	rkclk_init();	mmu_init();	/* Start with a clean slate. */	mmu_config_range(0, 4096, DCACHE_OFF);	/* SRAM is tightly wedged between registers, need to use subtables. Map	 * write-through as equivalent for non-cacheable without XN on A17. */	mmu_config_range_kb((uintptr_t)_sram/KiB,			    _sram_size/KiB, DCACHE_WRITETHROUGH);	dcache_mmu_enable();	rkclk_configure_crypto(148500*KHz);}
开发者ID:MikeeHawk,项目名称:coreboot,代码行数:17,


示例20: dag_node_state_change

void dag_node_state_change(struct dag *d, struct dag_node *n, int newstate){	static time_t last_fsync = 0;	debug(D_DEBUG, "node %d %s -> %s/n", n->nodeid, dag_node_state_name(n->state), dag_node_state_name(newstate));	if(d->node_states[n->state] > 0) {		d->node_states[n->state]--;	}	n->state = newstate;	d->node_states[n->state]++;	/**	 * Line format : timestamp node_id new_state job_id nodes_waiting nodes_running nodes_complete nodes_failed nodes_aborted node_id_counter	 *	 * timestamp - the unix time (in microseconds) when this line is written to the log file.	 * node_id - the id of this node (task).	 * new_state - a integer represents the new state this node (whose id is in the node_id column) has just entered. The value of the integer ranges from 0 to 4 and the states they are representing are:	 *	0. waiting	 *	1. running	 *	2. complete	 *	3. failed	 *	4. aborted	 * job_id - the job id of this node in the underline execution system (local or batch system). If the makeflow is executed locally, the job id would be the process id of the process that executes this node. If the underline execution system is a batch system, such as Condor or SGE, the job id would be the job id assigned by the batch system when the task was sent to the batch system for execution.	 * nodes_waiting - the number of nodes are waiting to be executed.	 * nodes_running - the number of nodes are being executed.	 * nodes_complete - the number of nodes has been completed.	 * nodes_failed - the number of nodes has failed.	 * nodes_aborted - the number of nodes has been aborted.	 * node_id_counter - total number of nodes in this makeflow.	 *	 */	fprintf(d->logfile, "%" PRIu64 " %d %d %" PRIbjid " %d %d %d %d %d %d/n", timestamp_get(), n->nodeid, newstate, n->jobid, d->node_states[0], d->node_states[1], d->node_states[2], d->node_states[3], d->node_states[4], d->nodeid_counter);	if(time(NULL) - last_fsync > 60) {		/* We use fsync here to gurantee that the log is syncronized in AFS,		 * even if something goes wrong with the node running makeflow. Using		 * fsync comes with an overhead, so we do not fsync more than once per		 * minute. This avoids hammering AFS, and reduces the overhead for		 * short running tasks, while having the desired effect for long		 * running workflows. */		fsync(fileno(d->logfile)); 		last_fsync = time(NULL);	}}
开发者ID:badi,项目名称:cctools,代码行数:46,


示例21: main

void main(void){	init_timer();	if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION))		timestamp_init(timestamp_get());	bootblock_mainboard_early_init();#if CONFIG_BOOTBLOCK_CONSOLE	console_init();	exception_init();#endif	bootblock_soc_init();	bootblock_mainboard_init();	run_romstage();}
开发者ID:RafaelRMachado,项目名称:Coreboot,代码行数:18,


示例22: work_queue_process_kill

void  work_queue_process_kill( struct work_queue_process *p ){	//make sure a few seconds have passed since child process was created to avoid sending a signal 	//before it has been fully initialized. Else, the signal sent to that process gets lost.		timestamp_t elapsed_time_execution_start = timestamp_get() - p->execution_start;		if (elapsed_time_execution_start/1000000 < 3)		sleep(3 - (elapsed_time_execution_start/1000000));			debug(D_WQ, "terminating task %d pid %d",p->task->taskid,p->pid);	// Send signal to process group of child which is denoted by -ve value of child pid.	// This is done to ensure delivery of signal to processes forked by the child. 	kill((-1*p->pid), SIGKILL);		// Reap the child process to avoid zombies.	waitpid(p->pid, NULL, 0);}
开发者ID:LyonsLab,项目名称:cctools,代码行数:18,


示例23: log_work_queue_status

void log_work_queue_status(struct work_queue *q) {	struct work_queue_stats s;	work_queue_get_stats(q, &s);	fprintf(logfile, "QUEUE %" PRIu64 " ", timestamp_get());			fprintf(logfile, "%d %d %d ", s.workers_init, s.workers_ready, s.workers_busy);			fprintf(logfile, "%d %d %d ", s.tasks_running, s.tasks_waiting, s.tasks_complete);			fprintf(logfile, "%d %d ", s.total_tasks_dispatched, s.total_tasks_complete);			fprintf(logfile, "%d %d ", s.total_workers_joined, s.total_workers_removed);			fprintf(logfile, "%" PRId64 " %" PRId64 " ", s.total_bytes_sent, s.total_bytes_received);			fprintf(logfile, "%.2f %.2f ", s.efficiency, s.idle_percentage);			fprintf(logfile, "%d %d ", s.capacity, s.avg_capacity); 			fprintf(logfile, "%d ", s.total_workers_connected);			fprintf(logfile, "/n");	fflush(logfile);	fsync(fileno(logfile));}
开发者ID:brenden,项目名称:cctools,代码行数:18,


示例24: romstage_main

void * asmlinkage romstage_main(unsigned long bist){	int cbmem_was_initted;	/* init_timer(); */	post_code(0x05);	i82801ix_early_init();	console_init();	/* Halt if there was a built in self test failure */	report_bist_failure(bist);	cbmem_was_initted = !cbmem_recovery(0);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);	/* Emulation uses fixed low stack during ramstage. */	return NULL;}
开发者ID:lynxis,项目名称:coreboot-signed,代码行数:21,


示例25: main

void main(unsigned long bist){	int cbmem_was_initted;	/* init_timer(); */	post_code(0x05);	console_init();	/* Halt if there was a built in self test failure */	report_bist_failure(bist);	//print_pci_devices();	//dump_pci_devices();	cbmem_was_initted = !cbmem_recovery(0);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);}
开发者ID:MrTomasz,项目名称:coreboot,代码行数:21,


示例26: dispatch_task

int dispatch_task(struct link *mpi_link, struct mpi_queue_task *t, int timeout){	struct mpi_queue_file *tf;	int stoptime = time(0) + timeout;	debug(D_MPI, "sending task %d/n", t->taskid);	if(t->input_files) {		list_first_item(t->input_files);		while((tf = list_next_item(t->input_files))) {			link_putfstring(mpi_link, "stat %d %s/n", stoptime, t->taskid, tf->name);		}	}	t->start_time = timestamp_get();	link_putfstring(mpi_link, "work %d %zu/n%s", stoptime, t->taskid, strlen(t->command_line), t->command_line);	t->status = MPI_QUEUE_TASK_STATUS_EXECUTING;	link_putfstring(mpi_link, "close %d/n", stoptime, t->taskid);	debug(D_MPI, "'%s' sent as task %d", t->command_line, t->taskid);	return 1;}
开发者ID:LyonsLab,项目名称:cctools,代码行数:22,


示例27: mpi_queue_submit

int mpi_queue_submit(struct mpi_queue *q, struct mpi_queue_task *t){	/* If the task has been used before, clear out accumlated state. */	static int next_taskid = 1;	if(t->output) {		free(t->output);		t->output = 0;	}	t->status = MPI_QUEUE_TASK_STATUS_READY;	t->total_transfer_time = 0;	t->result = MPI_QUEUE_RESULT_UNSET;	//Increment taskid. So we get a unique taskid for every submit.	t->taskid = next_taskid++;		/* Then, add it to the ready list and mark it as submitted. */	list_push_tail(q->ready_list, t);	t->submit_time = timestamp_get();	q->total_tasks_submitted++;	return (t->taskid);}
开发者ID:LyonsLab,项目名称:cctools,代码行数:23,


示例28: batch_job_wait_mpi_queue

batch_job_id_t batch_job_wait_mpi_queue( struct batch_queue *q, struct batch_job_info *info, time_t stoptime ){	static FILE *logfile = 0;//	struct work_queue_stats s;	int timeout, taskid = -1;	if(!logfile) {		logfile = fopen(q->logfile, "a");		if(!logfile) {			debug(D_NOTICE, "couldn't open logfile %s: %s/n", q->logfile, strerror(errno));			return -1;		}	}	if(stoptime == 0) {		timeout = MPI_QUEUE_WAITFORTASK;	} else {		timeout = MAX(0, stoptime - time(0));	}	struct mpi_queue_task *t = mpi_queue_wait(q->mpi_queue, timeout);	if(t) {		info->submitted = t->submit_time / 1000000;		info->started = t->start_time / 1000000;		info->finished = t->finish_time / 1000000;		info->exited_normally = 1;		info->exit_code = t->return_status;		info->exit_signal = 0;		/*		   If the standard ouput of the job is not empty,		   then print it, because this is analogous to a Unix		   job, and would otherwise be lost.  Important for		   capturing errors from the program.		 */		if(t->output && t->output[0]) {			if(t->output[1] || t->output[0] != '/n') {				string_chomp(t->output);				printf("%s/n", t->output);			}		}		char *outfile = itable_remove(q->output_table, t->taskid);		if(outfile) {			FILE *file = fopen(outfile, "w");			if(file) {				fwrite(t->output, strlen(t->output), 1, file);				fclose(file);			}			free(outfile);		}		fprintf(logfile, "TASK %llu %d %d %d %llu %llu /"%s/" /"%s/"/n", timestamp_get(), t->taskid, t->result, t->return_status, t->submit_time, t->finish_time, t->tag ? t->tag : "", t->command_line);		taskid = t->taskid;		mpi_queue_task_delete(t);	}	// Print to work queue log since status has been changed.//	mpi_queue_get_stats(q->mpi_queue, &s);//	fprintf(logfile, "QUEUE %llu %d %d %d %d %d/n", timestamp_get(), s.tasks_running, s.tasks_waiting, s.tasks_complete, s.total_tasks_dispatched, s.total_tasks_complete);//	fflush(logfile);//	fsync(fileno(logfile));	if(taskid >= 0) {		return taskid;	}	if(mpi_queue_empty(q->mpi_queue)) {		return 0;	} else {		return -1;	}}
开发者ID:dcbradley,项目名称:parrot_cvmfs,代码行数:74,



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


C++ timestamp_init函数代码示例
C++ timestamp_elapsed函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。