|
@@ -70,7 +70,8 @@ void checkpoint_template_lib_init(void) {
|
|
|
}
|
|
|
|
|
|
void checkpoint_template_lib_quit(void) {
|
|
|
- for (int i=0 ; i<MAX_CP_TEMPLATE_NUMBER ; i++)
|
|
|
+ int i;
|
|
|
+ for (i=0 ; i<MAX_CP_TEMPLATE_NUMBER ; i++)
|
|
|
{
|
|
|
if (cp_template_array[i] == NULL)
|
|
|
{
|
|
@@ -108,6 +109,7 @@ int _starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t c
|
|
|
int data_rank;
|
|
|
starpu_mpi_tag_t tag;
|
|
|
backup_of_fn _backup_of;
|
|
|
+ int i;
|
|
|
|
|
|
arg_type = arg_type & ~STARPU_COMMUTE;
|
|
|
|
|
@@ -139,7 +141,7 @@ int _starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t c
|
|
|
_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++)
|
|
|
+ for (i=0 ; i<_my_rank ; i++)
|
|
|
{
|
|
|
if (_backup_of(i) == _my_rank)
|
|
|
{
|
|
@@ -147,7 +149,7 @@ int _starpu_mpi_checkpoint_template_add_entry(starpu_mpi_checkpoint_template_t c
|
|
|
_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 (i=_my_rank+1 ; i<comm_size ; i++)
|
|
|
{
|
|
|
if (_backup_of(i) == _my_rank)
|
|
|
{
|
|
@@ -232,8 +234,9 @@ int _starpu_mpi_checkpoint_post_cp_discard_send(starpu_mpi_checkpoint_template_t
|
|
|
|
|
|
starpu_mpi_checkpoint_template_t _starpu_mpi_get_checkpoint_template_by_id(int checkpoint_id)
|
|
|
{
|
|
|
+ int i;
|
|
|
starpu_pthread_mutex_lock(&cp_template_mutex);
|
|
|
- for (int i=0 ; i < cp_template_array_size ; i++)
|
|
|
+ for (i=0 ; i < cp_template_array_size ; i++)
|
|
|
{
|
|
|
// starpu_pthread_mutex_lock(&cp_template_array[i]->mutex);
|
|
|
if (cp_template_array[i]->cp_id == checkpoint_id)
|
|
@@ -352,6 +355,7 @@ starpu_mpi_checkpoint_template_t _starpu_mpi_get_checkpoint_template_by_id(int c
|
|
|
int _starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t cp_template)
|
|
|
{
|
|
|
// char str[256];
|
|
|
+ int i;
|
|
|
starpu_pthread_mutex_lock(&cp_template->mutex);
|
|
|
_STARPU_MPI_DEBUG(2, "Start freezing checkpoint id:%d\n", cp_template->cp_id);
|
|
|
cp_template->frozen = 1;
|
|
@@ -385,7 +389,7 @@ int _starpu_mpi_checkpoint_template_freeze(starpu_mpi_checkpoint_template_t cp_t
|
|
|
starpu_pthread_mutex_unlock(&cp_template->mutex);
|
|
|
|
|
|
starpu_pthread_mutex_lock(&cp_template_mutex);
|
|
|
- for (int i=0 ; i < cp_template_array_size ; i++)
|
|
|
+ for (i=0 ; i < cp_template_array_size ; i++)
|
|
|
{
|
|
|
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);
|
|
|
}
|