소스 검색

mpi/src/starpu_mpi_task_insert.c: fix condition when reallocation is needed (thanks again to Jerome Robert for the BR #18376)

Nathalie Furmento 10 년 전
부모
커밋
274de18452
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      mpi/src/starpu_mpi_task_insert.c

+ 2 - 2
mpi/src/starpu_mpi_task_insert.c

@@ -272,7 +272,7 @@ int _starpu_mpi_task_decode_v(struct starpu_codelet *codelet, int me, int nb_nod
 					return ret;
 				}
 			}
-			if (nb_data > nb_allocated_data)
+			if (nb_data >= nb_allocated_data)
 			{
 				nb_allocated_data *= 2;
 				descrs = (struct starpu_data_descr *)realloc(descrs, nb_allocated_data * sizeof(struct starpu_data_descr));
@@ -298,7 +298,7 @@ int _starpu_mpi_task_decode_v(struct starpu_codelet *codelet, int me, int nb_nod
 						return ret;
 					}
 				}
-				if (nb_data > nb_allocated_data)
+				if (nb_data >= nb_allocated_data)
 				{
 					nb_allocated_data *= 2;
 					descrs = (struct starpu_data_descr *)realloc(descrs, nb_allocated_data * sizeof(struct starpu_data_descr));