|
@@ -127,6 +127,7 @@ void *_starpu_cpu_worker(void *arg)
|
|
struct starpu_worker_s *cpu_arg = arg;
|
|
struct starpu_worker_s *cpu_arg = arg;
|
|
struct starpu_jobq_s *jobq = cpu_arg->jobq;
|
|
struct starpu_jobq_s *jobq = cpu_arg->jobq;
|
|
unsigned memnode = cpu_arg->memory_node;
|
|
unsigned memnode = cpu_arg->memory_node;
|
|
|
|
+ int workerid = cpu_arg->workerid;
|
|
|
|
|
|
#ifdef STARPU_USE_FXT
|
|
#ifdef STARPU_USE_FXT
|
|
_starpu_fxt_register_thread(cpu_arg->bindid);
|
|
_starpu_fxt_register_thread(cpu_arg->bindid);
|
|
@@ -163,9 +164,6 @@ void *_starpu_cpu_worker(void *arg)
|
|
struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
|
|
struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
|
|
struct starpu_jobq_s *queue = policy->starpu_get_local_queue(policy);
|
|
struct starpu_jobq_s *queue = policy->starpu_get_local_queue(policy);
|
|
|
|
|
|
- int profiling;
|
|
|
|
- int64_t start_time, end_time;
|
|
|
|
-
|
|
|
|
while (_starpu_machine_is_running())
|
|
while (_starpu_machine_is_running())
|
|
{
|
|
{
|
|
STARPU_TRACE_START_PROGRESS(memnode);
|
|
STARPU_TRACE_START_PROGRESS(memnode);
|
|
@@ -183,24 +181,16 @@ void *_starpu_cpu_worker(void *arg)
|
|
if (!j)
|
|
if (!j)
|
|
j = _starpu_pop_task();
|
|
j = _starpu_pop_task();
|
|
|
|
|
|
- profiling = starpu_profiling_status_get();
|
|
|
|
-
|
|
|
|
if (j == NULL)
|
|
if (j == NULL)
|
|
- {
|
|
|
|
- if (_starpu_worker_can_block(memnode)) {
|
|
|
|
-
|
|
|
|
- start_time = (int64_t)_starpu_timing_now();
|
|
|
|
- PTHREAD_COND_WAIT(&queue->activity_cond, &queue->activity_mutex);
|
|
|
|
- end_time = (int64_t)_starpu_timing_now();
|
|
|
|
-
|
|
|
|
- if(profiling){
|
|
|
|
- _starpu_worker_update_profiling_info(cpu_arg->workerid, 0, end_time - start_time, 0);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- _starpu_jobq_unlock(queue);
|
|
|
|
- continue;
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
|
|
+ {
|
|
|
|
+ if (_starpu_worker_can_block(memnode))
|
|
|
|
+ _starpu_block_worker(workerid, &queue->activity_cond, &queue->activity_mutex);
|
|
|
|
+
|
|
|
|
+ _starpu_jobq_unlock(queue);
|
|
|
|
+
|
|
|
|
+ continue;
|
|
|
|
+ };
|
|
|
|
+
|
|
_starpu_jobq_unlock(queue);
|
|
_starpu_jobq_unlock(queue);
|
|
|
|
|
|
/* can a cpu perform that task ? */
|
|
/* can a cpu perform that task ? */
|