浏览代码

mic (perfmodels): Correction register_model with debug

Thibaud Lambert 11 年之前
父节点
当前提交
54efaa63eb
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 0 1
      src/core/perfmodel/perfmodel.c
  2. 10 2
      src/core/perfmodel/perfmodel_history.c

+ 0 - 1
src/core/perfmodel/perfmodel.c

@@ -146,7 +146,6 @@ void _starpu_load_perfmodel(struct starpu_perfmodel *model)
 		return;
 
 	int load_model = _starpu_register_model(model);
-
 	if (!load_model)
 		return;
 

+ 10 - 2
src/core/perfmodel/perfmodel_history.c

@@ -589,8 +589,6 @@ static void initialize_model(struct starpu_perfmodel *model)
 	struct _starpu_machine_config *conf = _starpu_get_machine_config();
 	model->per_arch = malloc(sizeof(*model->per_arch)*(STARPU_NARCH));
 
-	_STARPU_DEBUG("n onpecl:%u\n\n\n\n\n\n",conf->topology.nhwopenclgpus);
-
 	model->per_arch[STARPU_CPU_WORKER] = initialize_arch_model(1,&conf->topology.nhwcpus); 
 	model->per_arch[STARPU_CUDA_WORKER] = initialize_arch_model(conf->topology.nhwcudagpus,NULL); 
 	model->per_arch[STARPU_OPENCL_WORKER] = initialize_arch_model(conf->topology.nhwopenclgpus,NULL); 
@@ -732,6 +730,10 @@ static void get_model_debug_path(struct starpu_perfmodel *model, const char *arc
  */
 int _starpu_register_model(struct starpu_perfmodel *model)
 {
+	STARPU_ASSERT(model);
+	STARPU_ASSERT(model->symbol);
+	starpu_initialize_model(model);
+
 	/* If the model has already been loaded, there is nothing to do */
 	STARPU_PTHREAD_RWLOCK_RDLOCK(&registered_models_rwlock);
 	if (model->is_loaded)
@@ -765,19 +767,25 @@ int _starpu_register_model(struct starpu_perfmodel *model)
 
 	unsigned archtype, devid, ncore, nimpl;
 	struct starpu_perfmodel_arch arch;
+
+	_STARPU_DEBUG("\n\n ###\nHere\n ###\n\n");
 	
 	if(model->is_init)
 	{
+		_STARPU_DEBUG("Init\n");
 		for (archtype = 0; archtype < STARPU_NARCH; archtype++)
 		{
+			_STARPU_DEBUG("Archtype\n");
 			arch.type = archtype;
 			if(model->per_arch[archtype] != NULL)
 			{
 				for(devid=0; model->per_arch[archtype][devid] != NULL; devid++)
 				{
+					_STARPU_DEBUG("Devid\n");
 					arch.devid = devid;
 					for(ncore=0; model->per_arch[archtype][devid][ncore] != NULL; ncore++)
 					{
+						_STARPU_DEBUG("Ncore\n");
 						arch.ncore = ncore;
 						for (nimpl = 0; nimpl < STARPU_MAXIMPLEMENTATIONS; nimpl++)
 						{