瀏覽代碼

Fix a bunch of NULL checks.

Cyril Roelandt 12 年之前
父節點
當前提交
14de0858b0

+ 4 - 4
sched_ctx_hypervisor/src/hypervisor_policies/policy_tools.c

@@ -37,7 +37,7 @@ static int _compute_priority(unsigned sched_ctx)
 		total_priority += config->priority[worker];
 		total_priority += config->priority[worker];
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 	return total_priority;
 	return total_priority;
 }
 }
@@ -169,7 +169,7 @@ int* _get_first_workers(unsigned sched_ctx, int *nworkers, enum starpu_archtype
 		}
 		}
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	return curr_workers;
 	return curr_workers;
@@ -195,7 +195,7 @@ unsigned _get_potential_nworkers(struct starpu_sched_ctx_hypervisor_policy_confi
 				potential_workers++;
 				potential_workers++;
 		}
 		}
 	}
 	}
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	return potential_workers;
 	return potential_workers;
@@ -321,7 +321,7 @@ static double _get_elapsed_flops(struct starpu_sched_ctx_hypervisor_wrapper* sc_
                 }
                 }
         }
         }
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	return ret_val;
 	return ret_val;

+ 3 - 3
sched_ctx_hypervisor/src/hypervisor_policies/simple_policy.c

@@ -35,7 +35,7 @@ static int _compute_priority(unsigned sched_ctx)
 		total_priority += config->priority[worker];
 		total_priority += config->priority[worker];
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 	return total_priority;
 	return total_priority;
 }
 }
@@ -142,7 +142,7 @@ int* _get_first_workers(unsigned sched_ctx, unsigned *nworkers, enum starpu_arch
 		}
 		}
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	return curr_workers;
 	return curr_workers;
@@ -167,7 +167,7 @@ static unsigned _get_potential_nworkers(struct starpu_sched_ctx_hypervisor_polic
 				potential_workers++;
 				potential_workers++;
 		}
 		}
 	}
 	}
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	return potential_workers;
 	return potential_workers;

+ 4 - 4
src/core/sched_ctx.c

@@ -179,7 +179,7 @@ static void _starpu_remove_workers_from_sched_ctx(struct _starpu_sched_ctx *sche
 				rem_workers[nrem_workers++] = worker;
 				rem_workers[nrem_workers++] = worker;
 		}
 		}
 
 
-		if(workers->init_cursor)
+		if (workers->deinit_cursor)
 			workers->deinit_cursor(workers);
 			workers->deinit_cursor(workers);
 
 
 		if(nrem_workers > 0)
 		if(nrem_workers > 0)
@@ -843,7 +843,7 @@ int starpu_get_workers_of_sched_ctx(unsigned sched_ctx_id, int *pus, enum starpu
 			pus[npus++] = worker;
 			pus[npus++] = worker;
 	}
 	}
 	
 	
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 	return npus;
 	return npus;
 }
 }
@@ -891,10 +891,10 @@ unsigned starpu_get_nshared_workers(unsigned sched_ctx_id, unsigned sched_ctx_id
                 }
                 }
         }
         }
 
 
-        if(workers->init_cursor)
+        if (workers->deinit_cursor)
                 workers->deinit_cursor(workers);
                 workers->deinit_cursor(workers);
 
 
-        if(workers2->init_cursor)
+        if (workers2->deinit_cursor)
                 workers2->deinit_cursor(workers2);
                 workers2->deinit_cursor(workers2);
 
 
 	return shared_workers;
 	return shared_workers;

+ 1 - 1
src/core/sched_policy.c

@@ -300,7 +300,7 @@ static int _starpu_nworkers_able_to_execute_task(struct starpu_task *task, struc
 			nworkers++;
 			nworkers++;
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 	return nworkers;
 	return nworkers;
 }
 }

+ 1 - 1
src/core/workers.c

@@ -1279,7 +1279,7 @@ int starpu_worker_get_nids_ctx_free_by_type(enum starpu_archtype type, int *work
 						}
 						}
 					}
 					}
 					
 					
-					if(workers->init_cursor)
+					if (workers->deinit_cursor)
 						workers->deinit_cursor(workers);
 						workers->deinit_cursor(workers);
 					if(found) break;
 					if(found) break;
 				}
 				}

+ 2 - 2
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -431,7 +431,7 @@ static int _dm_push_task(struct starpu_task *task, unsigned prio, unsigned sched
 	
 	
 	//_STARPU_DEBUG("Scheduler dm: kernel (%u)\n", best_impl);
 	//_STARPU_DEBUG("Scheduler dm: kernel (%u)\n", best_impl);
 	
 	
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 	
 	
 	_starpu_get_job_associated_to_task(task)->nimpl = best_impl;
 	_starpu_get_job_associated_to_task(task)->nimpl = best_impl;
@@ -672,7 +672,7 @@ static int _dmda_push_task(struct starpu_task *task, unsigned prio, unsigned sch
 	
 	
 	if (task->bundle)
 	if (task->bundle)
 		starpu_task_bundle_remove(task->bundle, task);
 		starpu_task_bundle_remove(task->bundle, task);
-        if(workers->init_cursor)
+        if (workers->deinit_cursor)
                 workers->deinit_cursor(workers);
                 workers->deinit_cursor(workers);
 
 
 	//_STARPU_DEBUG("Scheduler dmda: kernel (%u)\n", best_impl);
 	//_STARPU_DEBUG("Scheduler dmda: kernel (%u)\n", best_impl);

+ 1 - 1
src/sched_policies/heft.c

@@ -554,7 +554,7 @@ static int _heft_push_task(struct starpu_task *task, unsigned prio, unsigned sch
 		transfer_model_best = local_data_penalty[best_in_ctx][selected_impl];
 		transfer_model_best = local_data_penalty[best_in_ctx][selected_impl];
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
 		workers->deinit_cursor(workers);
 		workers->deinit_cursor(workers);
 
 
 	_starpu_get_job_associated_to_task(task)->nimpl = selected_impl;
 	_starpu_get_job_associated_to_task(task)->nimpl = selected_impl;

+ 2 - 1
src/sched_policies/parallel_heft.c

@@ -421,7 +421,8 @@ static int _parallel_heft_push_task(struct starpu_task *task, unsigned prio, uns
 		}
 		}
 	}
 	}
 
 
-        if(workers->init_cursor)                                                                                                                                                                                                    workers->deinit_cursor(workers);
+        if (workers->deinit_cursor)
+		workers->deinit_cursor(workers);
 
 
 	STARPU_ASSERT(forced_best != -1 || best != -1);
 	STARPU_ASSERT(forced_best != -1 || best != -1);
 
 

+ 1 - 1
src/sched_policies/random_policy.c

@@ -71,7 +71,7 @@ static int _random_push_task(struct starpu_task *task, unsigned prio)
 		AYU_event(AYU_ADDTASKTOQUEUE, _starpu_get_job_associated_to_task(task)->job_id, &id);
 		AYU_event(AYU_ADDTASKTOQUEUE, _starpu_get_job_associated_to_task(task)->job_id, &id);
 	}
 	}
 #endif
 #endif
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
                 workers->deinit_cursor(workers);
                 workers->deinit_cursor(workers);
 
 
 	/* we should now have the best worker in variable "selected" */
 	/* we should now have the best worker in variable "selected" */

+ 2 - 2
src/sched_policies/work_stealing_policy.c

@@ -164,7 +164,7 @@ static unsigned select_victim_overload(unsigned sched_ctx_id)
 		}
 		}
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
                 workers->deinit_cursor(workers);
                 workers->deinit_cursor(workers);
 
 
 	return best_worker;
 	return best_worker;
@@ -207,7 +207,7 @@ static unsigned select_worker_overload(unsigned sched_ctx_id)
 		}
 		}
 	}
 	}
 
 
-	if(workers->init_cursor)
+	if (workers->deinit_cursor)
                 workers->deinit_cursor(workers);
                 workers->deinit_cursor(workers);
 
 
 	return best_worker;
 	return best_worker;