コード例 #1
0
ファイル: sand_filter_master.c プロジェクト: nbest937/cctools
static void display_progress()
{
    static int row_limit = 25;
    static int row_count = 0;
    static time_t last_display_time = 0;
    struct work_queue_stats info;
    time_t current = time(0);

    if((current - last_display_time) < 5)
        return;

    work_queue_get_stats(q, &info);

    if(row_count == 0) {
        printf(" Total | Workers   | Tasks                      Avg | Candidates\n");
        printf("  Time | Idle Busy | Submit Idle  Run   Done   Time | Found\n");
        row_count = row_limit;
    }

    printf("%6d | %4d %4d | %6d %4d %4d %6d %6.02lf | %lu\n", (int) (current - start_time), info.workers_init + info.workers_ready, info.workers_busy, total_submitted, info.tasks_waiting, info.tasks_running, total_processed,
           (tasks_runtime / 1000000.0) / total_processed, cand_count);

    fflush(stdout);
    row_count--;

    last_display_time = current;
}
コード例 #2
0
static void display_progress( struct work_queue *q )
{
        struct work_queue_stats info;
        time_t current = time(0);
        work_queue_get_stats(queue,&info);
        if(current==start_time) current++;
        double speedup = (sequential_run_time*tasks_done)/(current-start_time);
        printf("%2.02lf%% %6d %6ds %4d %4d %4d %4d %4d %4d %.02lf\n",100.0*cells_complete/cells_total,cells_complete,(int)(time(0)-start_time),info.workers_init,info.workers_ready,info.workers_busy,info.tasks_waiting,info.tasks_running,info.tasks_complete,speedup);
        last_display_time = current;
}
コード例 #3
0
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));
}