for (k = 0; k < n; k++) {
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
- if ((d[i*n+k] > -1) && (d[k*n+j] > -1)) {
- if ((d[i*n+j] < 0) || (d[i*n+j] > d[i*n+k] + d[k*n+j])) {
- d[i*n+j] = d[i*n+k] + d[k*n+j];
- p[i*n+j] = p[k*n+j];
- }
+ if (d[i * n + k] > -1 && d[k * n + j] > -1 &&
+ (d[i * n + j] < 0 || d[i * n + j] > d[i * n + k] + d[k * n + j])) {
+ d[i * n + j] = d[i * n + k] + d[k * n + j];
+ p[i * n + j] = p[k * n + j];
}
}
}
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
printf("%d ", rb[i]);
printf("]\n");
- if (rank == 0) {
- if (status != MPI_SUCCESS) {
- printf("allgather returned %d\n", status);
- fflush(stdout);
- }
+ if (rank == 0 && status != MPI_SUCCESS) {
+ printf("allgather returned %d\n", status);
+ fflush(stdout);
}
xbt_free(sb);
xbt_free(rb);
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
printf("%d ", rb[i]);
printf("]\n");
- if (rank == 0) {
- if (status != MPI_SUCCESS) {
- printf("allgatherv returned %d\n", status);
- fflush(stdout);
- }
+ if (rank == 0 && status != MPI_SUCCESS) {
+ printf("allgatherv returned %d\n", status);
+ fflush(stdout);
}
xbt_free(sb);
xbt_free(rb);
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
printf("%d ", rb[i]);
printf("]\n");
- if (rank == 0) {
- if (status != MPI_SUCCESS) {
- printf("all_to_all returned %d\n", status);
- fflush(stdout);
- }
+ if (rank == 0 && status != MPI_SUCCESS) {
+ printf("all_to_all returned %d\n", status);
+ fflush(stdout);
}
xbt_free(sb);
xbt_free(rb);
-/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
printf("%d ", rb[i]);
printf("]\n");
- if (rank == 0) {
- if (status != MPI_SUCCESS) {
- printf("all_to_all returned %d\n", status);
- fflush(stdout);
- }
+ if (rank == 0 && status != MPI_SUCCESS) {
+ printf("all_to_all returned %d\n", status);
+ fflush(stdout);
}
xbt_free(sb);
xbt_free(rb);
-/* Copyright (c) 2009, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2009, 2013-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
if (values[i]==17) good++;
printf("[%d] number of values equals to 17: %d\n", rank, good);
- if (rank == 0) {
- if (status != MPI_SUCCESS) {
- printf("bcast returned %d\n", status);
- fflush(stdout);
- }
+ if (rank == 0 && status != MPI_SUCCESS) {
+ printf("bcast returned %d\n", status);
+ fflush(stdout);
}
xbt_free(values);
MPI_Finalize();