Skip to content

Commit dd2d7d2

Browse files
authored
Merge pull request #7189 from michaellass/fix-dims_create
dims_create: fix calculation of factors for odd squares
2 parents c471f1c + 6749011 commit dd2d7d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ompi/mpi/c/dims_create.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ getfactors(int num, int *nfactors, int **factors) {
240240
}
241241
/* determine all occurences of uneven prime numbers up to sqrt(num) */
242242
d = 3;
243-
for(d = 3; (num > 1) && (d < sqrtnum); d += 2) {
243+
for(d = 3; (num > 1) && (d <= sqrtnum); d += 2) {
244244
while((num % d) == 0) {
245245
num /= d;
246246
(*factors)[i++] = d;

0 commit comments

Comments
 (0)