A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some more doc bugs
[simgrid.git]
/
examples
/
smpi
/
ampi_test
/
ampi_test.cpp
diff --git
a/examples/smpi/ampi_test/ampi_test.cpp
b/examples/smpi/ampi_test/ampi_test.cpp
index 05b2efa216db995e5a405b9086a98eddcd3c2e48..53308b1b67a99b8f16805ba5a2a57239ece59c3b 100644
(file)
--- a/
examples/smpi/ampi_test/ampi_test.cpp
+++ b/
examples/smpi/ampi_test/ampi_test.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-20
19
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-20
23
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-10,12
+10,18
@@
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
int main(int argc, char* argv[])
{
MPI_Init(&argc, &argv);
+ // useless alocations for testing and coverage
void* pointer = malloc(100 * sizeof(int));
void* pointer = malloc(100 * sizeof(int));
+ void* ptmp;
+ if ((ptmp = realloc(pointer, 50 * sizeof(int))) != nullptr)
+ pointer = ptmp;
+ if ((ptmp = realloc(pointer, 200 * sizeof(int))) != nullptr)
+ pointer = ptmp;
free(pointer);
free(pointer);
- pointer =
malloc(100 *
sizeof(int));
+ pointer =
calloc(100,
sizeof(int));
int rank;
int rank;
-
int err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
/* Get id of this process */
- if (err != MPI_SUCCESS) {
+ /* Get id of this process */
+ if (
int err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
err != MPI_SUCCESS) {
fprintf(stderr, "MPI_Comm_rank failed: %d", err);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
exit(EXIT_FAILURE);
fprintf(stderr, "MPI_Comm_rank failed: %d", err);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
exit(EXIT_FAILURE);