Quellcode durchsuchen

profiling: display the number of GFlops/worker when STARPU_WORKER_STATS is enabled

Samuel Pitoiset vor 9 Jahren
Ursprung
Commit
053f1ec15a

+ 2 - 0
include/starpu_profiling.h

@@ -71,6 +71,8 @@ struct starpu_profiling_worker_info
 	uint64_t used_cycles;
 	uint64_t stall_cycles;
 	double power_consumed;
+
+	double flops;
 };
 
 struct starpu_profiling_bus_info

+ 3 - 2
src/drivers/driver_common/driver_common.c

@@ -204,7 +204,8 @@ void _starpu_driver_update_job_feedback(struct _starpu_job *j, struct _starpu_wo
 			_starpu_worker_update_profiling_info_executing(workerid, &measured_ts, 1,
 								       profiling_info->used_cycles,
 								       profiling_info->stall_cycles,
-								       profiling_info->power_consumed);
+								       profiling_info->power_consumed,
+								       j->task->flops);
 			updated =  1;
 		}
 
@@ -246,7 +247,7 @@ void _starpu_driver_update_job_feedback(struct _starpu_job *j, struct _starpu_wo
 	}
 
 	if (!updated)
-		_starpu_worker_update_profiling_info_executing(workerid, NULL, 1, 0, 0, 0);
+		_starpu_worker_update_profiling_info_executing(workerid, NULL, 1, 0, 0, 0, 0);
 
 	if (profiling_info && profiling_info->power_consumed && cl->power_model && cl->power_model->benchmarking)
 	{

+ 3 - 1
src/profiling/profiling.c

@@ -171,6 +171,7 @@ static void _starpu_worker_reset_profiling_info_with_lock(int workerid)
 	worker_info[workerid].used_cycles = 0;
 	worker_info[workerid].stall_cycles = 0;
 	worker_info[workerid].power_consumed = 0;
+	worker_info[workerid].flops = 0;
 
 	/* We detect if the worker is already sleeping or doing some
 	 * computation */
@@ -265,7 +266,7 @@ void _starpu_worker_register_executing_start_date(int workerid, struct timespec
 }
 
 
-void _starpu_worker_update_profiling_info_executing(int workerid, struct timespec *executing_time, int executed_tasks, uint64_t used_cycles, uint64_t stall_cycles, double power_consumed)
+void _starpu_worker_update_profiling_info_executing(int workerid, struct timespec *executing_time, int executed_tasks, uint64_t used_cycles, uint64_t stall_cycles, double power_consumed, double flops)
 {
 	if (starpu_profiling_status_get())
 	{
@@ -278,6 +279,7 @@ void _starpu_worker_update_profiling_info_executing(int workerid, struct timespe
 		worker_info[workerid].stall_cycles += stall_cycles;
 		worker_info[workerid].power_consumed += power_consumed;
 		worker_info[workerid].executed_tasks += executed_tasks;
+		worker_info[workerid].flops += flops;
 
 		STARPU_PTHREAD_MUTEX_UNLOCK(&worker_info_mutex[workerid]);
 	}

+ 1 - 1
src/profiling/profiling.h

@@ -32,7 +32,7 @@ void _starpu_worker_reset_profiling_info(int workerid);
 
 /* Update the per-worker profiling info after a task (or more) was executed.
  * This tells StarPU how much time was spent doing computation. */
-void _starpu_worker_update_profiling_info_executing(int workerid, struct timespec *executing_time, int executed_tasks, uint64_t used_cycles, uint64_t stall_cycles, double consumed_power);
+void _starpu_worker_update_profiling_info_executing(int workerid, struct timespec *executing_time, int executed_tasks, uint64_t used_cycles, uint64_t stall_cycles, double consumed_power, double flops);
 
 /* Record the date when the worker started to sleep. This permits to measure
  * how much time was spent sleeping. */

+ 2 - 0
src/profiling/profiling_helpers.c

@@ -91,6 +91,8 @@ void starpu_profiling_worker_helper_display_summary(void)
 				fprintf(stderr, "\t%lu Mcy %lu Mcy stall\n", info.used_cycles/1000000, info.stall_cycles/1000000);
 			if (info.power_consumed)
 				fprintf(stderr, "\t%f J consumed\n", info.power_consumed);
+			if (info.flops)
+				fprintf(stderr, "\t%f GFlop/s\n\n", info.flops / total_time / 1000000);
 		}
 
 		sum_consumed += info.power_consumed;