Ver código fonte

member name refactor

Romain LION 5 anos atrás
pai
commit
90ad6611dc

+ 4 - 4
mpi/src/mpi_failure_tolerance/starpu_mpi_checkpoint.c

@@ -118,7 +118,7 @@ int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_te
 	int current_instance;
 
 	current_instance = increment_current_instance();
-	_starpu_mpi_checkpoint_template_create_instance_tracker(cp_template, cp_template->cp_template_id, current_instance);
+	_starpu_mpi_checkpoint_template_create_instance_tracker(cp_template, cp_template->cp_id, current_instance);
 	_starpu_mpi_checkpoint_post_cp_discard_recv(cp_template);
 
 	item = _starpu_mpi_checkpoint_template_get_first_data(cp_template);
@@ -132,7 +132,7 @@ int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_te
 				arg->tag = item->tag;
 				arg->type = STARPU_VALUE;
 				arg->count = item->count;
-				arg->msg.checkpoint_id = cp_template->cp_template_id;
+				arg->msg.checkpoint_id = cp_template->cp_id;
 				arg->msg.checkpoint_instance = current_instance;
 				if (item->backupped_by != -1)
 				{
@@ -167,7 +167,7 @@ int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_te
 					arg->tag = starpu_mpi_data_get_tag(*handle);
 					arg->type = STARPU_R;
 					arg->count = item->count;
-					arg->msg.checkpoint_id = cp_template->cp_template_id;
+					arg->msg.checkpoint_id = cp_template->cp_id;
 					arg->msg.checkpoint_instance = current_instance;
 					_starpu_mpi_isend_cache_aware(*handle, item->backupped_by, starpu_mpi_data_get_tag(*handle), MPI_COMM_WORLD, 1, 0, 0,
 					                              &_starpu_mpi_push_cp_ack_recv_cb, (void*)arg, &_starpu_mpi_cached_push_cp_ack_recv_cb, (void*)arg, 1);
@@ -183,7 +183,7 @@ int starpu_mpi_submit_checkpoint_template(starpu_mpi_checkpoint_template_t cp_te
 					arg->tag = starpu_mpi_data_get_tag(*handle);
 					arg->type = STARPU_R;
 					arg->count = item->count;
-					arg->msg.checkpoint_id = cp_template->cp_template_id;
+					arg->msg.checkpoint_id = cp_template->cp_id;
 					arg->msg.checkpoint_instance = current_instance;
 					_starpu_mpi_irecv_cache_aware(*handle, starpu_mpi_data_get_rank(*handle), starpu_mpi_data_get_tag(*handle), MPI_COMM_WORLD, 1, 0,
 					                              NULL, NULL, &_starpu_data_release_cb, (void*)arg->handle, 1, 0, 1);

+ 6 - 6
mpi/src/mpi_failure_tolerance/starpu_mpi_checkpoint_template.c

@@ -94,7 +94,7 @@ int _starpu_mpi_checkpoint_template_add_data(starpu_mpi_checkpoint_template_t cp
 	item = _starpu_mpi_checkpoint_template_item_create(type, ptr, count, backupped_by, backup_of, tag);
 	_starpu_mpi_checkpoint_template_item_list_push_back(&cp_template->list, item);
 	_checkpoint_template_add_to_backup_arrays(cp_template, backupped_by, backup_of);
-	_STARPU_MPI_DEBUG(5, "New checkpoint data entry %p has been added to cp_template with id:%d. (%s)\n", item, cp_template->cp_template_id, backupped_by==-1?"BACKUP_OF":"BACKUPPED_BY");
+	_STARPU_MPI_DEBUG(5, "New checkpoint data entry %p has been added to cp_template with id:%d. (%s)\n", item, cp_template->cp_id, backupped_by == -1 ? "BACKUP_OF" : "BACKUPPED_BY");
 	starpu_pthread_mutex_unlock(&cp_template->mutex);
 	return 0;
 }
@@ -254,7 +254,7 @@ int _starpu_mpi_checkpoint_post_cp_discard_send(starpu_mpi_checkpoint_template_t
 //	{
 //		return -1;
 //	}
-//	else if (last_valid_checkpoint.checkpoint_id!=cp_template->cp_template_id)
+//	else if (last_valid_checkpoint.checkpoint_id!=cp_template->cp_id)
 //	{
 //		old_template = _starpu_mpi_get_checkpoint_template_by_id(last_valid_checkpoint.checkpoint_id);
 //		for (i=0 ; i<old_template->backup_of_array_used_size ; i++)
@@ -304,7 +304,7 @@ int _starpu_mpi_checkpoint_post_cp_discard_send(starpu_mpi_checkpoint_template_t
 //	{
 //		return -1;
 //	}
-//	else if (last_valid_checkpoint.checkpoint_id!=cp_template->cp_template_id)
+//	else if (last_valid_checkpoint.checkpoint_id!=cp_template->cp_id)
 //	{
 //		old_template = _starpu_mpi_get_checkpoint_template_by_id(last_valid_checkpoint.checkpoint_id);
 //		for (i=0 ; i<old_template->backupped_by_array_used_size ; i++)
@@ -336,7 +336,7 @@ int _starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t cp_t
 {
 	char str[256];
 	starpu_pthread_mutex_lock(&cp_template->mutex);
-	_STARPU_MPI_DEBUG(2, "Start freezing checkpoint id:%d\n", cp_template->cp_template_id);
+	_STARPU_MPI_DEBUG(2, "Start freezing checkpoint id:%d\n", cp_template->cp_id);
 	cp_template->frozen                 = 1;
 	cp_template->message_to_send_number = 0;
 	cp_template->size                   = _starpu_mpi_checkpoint_template_item_list_size(&cp_template->list);
@@ -370,13 +370,13 @@ int _starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t cp_t
 	starpu_pthread_mutex_lock(&cp_template_mutex);
 	for (int i=0 ; i < cp_template_array_size ; i++)
 	{
-		STARPU_ASSERT_MSG(cp_template_array[i]->cp_template_id != cp_template->cp_template_id, "A checkpoint with id %d has already been registered.\n", cp_template->cp_template_id);
+		STARPU_ASSERT_MSG(cp_template_array[i]->cp_id != cp_template->cp_id, "A checkpoint with id %d has already been registered.\n", cp_template->cp_id);
 	}
 	cp_template_array[cp_template_array_size] = cp_template;
 	cp_template_array_size++;
 	starpu_pthread_mutex_unlock(&cp_template_mutex);
 
-	_STARPU_MPI_DEBUG(2, "Checkpoint id:%d is frozen and registered.\n", cp_template->cp_template_id);
+	_STARPU_MPI_DEBUG(2, "Checkpoint id:%d is frozen and registered.\n", cp_template->cp_id);
 	return cp_template->size;
 }
 

+ 6 - 5
mpi/src/mpi_failure_tolerance/starpu_mpi_checkpoint_template.h

@@ -55,6 +55,7 @@ int _starpu_mpi_checkpoint_template_register(starpu_mpi_checkpoint_template_t *c
 LIST_TYPE(_starpu_mpi_checkpoint_template_tracking_inst,
 	int cp_id;
 	int                              cp_inst;
+	int                              cp_domain;
 	starpu_mpi_checkpoint_template_t cp_template;
 	int                              ack_msg_count;
 	int                              valid:1;
@@ -73,8 +74,8 @@ struct _starpu_mpi_checkpoint_template
 {
 	struct _starpu_mpi_checkpoint_template_item_list list;
 	int                                              size;
-	int                                              cp_template_id;
-	int                                              cp_template_current_instance;
+	int                                              cp_id;
+	int                                              checkpoint_domain;
 	int                                              message_to_send_number;
 	int                                              frozen;
 	starpu_pthread_mutex_t                           mutex;
@@ -215,7 +216,7 @@ static starpu_mpi_checkpoint_template_t _starpu_mpi_get_checkpoint_template_by_i
 	for (int i=0 ; i < cp_template_array_size ; i++)
 	{
 //		starpu_pthread_mutex_lock(&cp_template_array[i]->mutex);
-		if (cp_template_array[i]->cp_template_id == checkpoint_id)
+		if (cp_template_array[i]->cp_id == checkpoint_id)
 		{
 //			starpu_pthread_mutex_unlock(&cp_template_array[i]->mutex);
 			starpu_pthread_mutex_unlock(&cp_template_mutex);
@@ -287,8 +288,8 @@ static inline starpu_mpi_checkpoint_template_t _starpu_mpi_checkpoint_template_n
 {
 	starpu_mpi_checkpoint_template_t _cp_template;
 	_STARPU_MPI_CALLOC(_cp_template, 1, sizeof(struct _starpu_mpi_checkpoint_template));
-	_cp_template->cp_template_id               = cp_id;
-	_cp_template->backup_of_array_max_size     = _CHECKPOINT_TEMPLATE_BACKUPED_RANK_ARRAY_DEFAULT_SIZE;
+	_cp_template->cp_id                    = cp_id;
+	_cp_template->backup_of_array_max_size = _CHECKPOINT_TEMPLATE_BACKUPED_RANK_ARRAY_DEFAULT_SIZE;
 	starpu_malloc((void**)&_cp_template->backup_of_array, _CHECKPOINT_TEMPLATE_BACKUPED_RANK_ARRAY_DEFAULT_SIZE);
 	_cp_template->backup_of_array[0] = -1;
 	_cp_template->backup_of_array_used_size = 0;