|
@@ -32,7 +32,6 @@ starpu_pthread_mutex_t cp_template_mutex;
|
|
|
starpu_pthread_mutex_t current_instance_mutex;
|
|
|
starpu_mpi_checkpoint_template_t cp_template_array[MAX_CP_TEMPLATE_NUMBER];
|
|
|
int cp_template_array_size = 0;
|
|
|
-int my_rank;
|
|
|
int comm_size;
|
|
|
int current_instance;
|
|
|
|
|
@@ -62,7 +61,7 @@ int get_current_instance()
|
|
|
void checkpoint_template_lib_init(void) {
|
|
|
starpu_pthread_mutex_init(¤t_instance_mutex, NULL);
|
|
|
starpu_pthread_mutex_init(&cp_template_mutex, NULL);
|
|
|
- starpu_mpi_comm_rank(MPI_COMM_WORLD, &my_rank);
|
|
|
+ starpu_mpi_comm_rank(MPI_COMM_WORLD, &_my_rank);
|
|
|
starpu_mpi_comm_size(MPI_COMM_WORLD, &comm_size);
|
|
|
current_instance = 0;
|
|
|
#ifdef STARPU_MPI_VERBOSE
|
|
@@ -119,11 +118,11 @@ int _starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t c
|
|
|
count = 1;
|
|
|
backupped_by = va_arg(varg_list, int);
|
|
|
data_rank = starpu_mpi_data_get_rank((starpu_data_handle_t)ptr);
|
|
|
- if (my_rank==data_rank)
|
|
|
+ if (_my_rank==data_rank)
|
|
|
{
|
|
|
return _starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, backupped_by, -1, -1);
|
|
|
}
|
|
|
- else if(my_rank == backupped_by)
|
|
|
+ else if(_my_rank == backupped_by)
|
|
|
{
|
|
|
return _starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, -1, data_rank, -1);
|
|
|
}
|
|
@@ -139,18 +138,18 @@ int _starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t c
|
|
|
tag = va_arg(varg_list, starpu_mpi_tag_t);
|
|
|
_backup_of = va_arg(varg_list, backup_of_fn);
|
|
|
/* I register the backup that will save this data */
|
|
|
- _starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, _backup_of(my_rank), -1, tag);
|
|
|
- for (int i=0 ; i<my_rank ; i++)
|
|
|
+ _starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, _backup_of(_my_rank), -1, tag);
|
|
|
+ for (int i=0 ; i<_my_rank ; i++)
|
|
|
{
|
|
|
- if (_backup_of(i) == my_rank)
|
|
|
+ if (_backup_of(i) == _my_rank)
|
|
|
{
|
|
|
/* I'm the back up of someone else for this data, I have to remember it */
|
|
|
_starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, -1, i, tag);
|
|
|
}
|
|
|
}
|
|
|
- for (int i=my_rank+1 ; i<comm_size ; i++)
|
|
|
+ for (int i=_my_rank+1 ; i<comm_size ; i++)
|
|
|
{
|
|
|
- if (_backup_of(i) == my_rank)
|
|
|
+ if (_backup_of(i) == _my_rank)
|
|
|
{
|
|
|
/* I'm the back up of someone else for this data, I have to remember it */
|
|
|
_starpu_mpi_checkpoint_template_add_data(cp_template, arg_type, ptr, count, -1, i, tag);
|