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
Various doc improvements
[simgrid.git]
/
teshsuite
/
smpi
/
pt2pt-pingpong
/
pt2pt-pingpong.c
diff --git
a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
index c395917d9f518633d3ec85103e8a174a48fa709e..c55917b4364525dc47e58061f5f73e1b353ab743 100644
(file)
--- a/
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
+++ b/
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
@@
-1,6
+1,6
@@
/* A simple example ping-pong program to test MPI_Send and MPI_Recv */
/* A simple example ping-pong program to test MPI_Send and MPI_Recv */
-/* Copyright (c) 2009-20
19
. The SimGrid Team.
+/* Copyright (c) 2009-20
23
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-8,13
+8,12
@@
#include <stdio.h>
#include <mpi.h>
#include <stdio.h>
#include <mpi.h>
-#include <stdlib.h>
-static void test_opts(int* argc, char **argv[]){
+static void test_opts(int argc, char* const argv[])
+{
int found = 0;
int ret;
int found = 0;
int ret;
- while ((ret = getopt(*argc, *argv, "s")) >= 0)
- {
+ while ((ret = getopt(argc, argv, "s")) >= 0) {
if (ret == 's')
found = 1;
}
if (ret == 's')
found = 1;
}
@@
-31,12
+30,10
@@
int main(int argc, char *argv[])
int rank;
int msg = 99;
MPI_Status status;
int rank;
int msg = 99;
MPI_Status status;
- int* test = (int*)malloc(8);
-
int err = MPI_Init(&argc, &argv); /* Initialize MPI */
/* test getopt function */
int err = MPI_Init(&argc, &argv); /* Initialize MPI */
/* test getopt function */
- test_opts(
&argc, &
argv);
+ test_opts(
argc,
argv);
if (err != MPI_SUCCESS) {
printf("MPI initialization failed!\n");
if (err != MPI_SUCCESS) {
printf("MPI initialization failed!\n");
@@
-75,7
+72,6
@@
int main(int argc, char *argv[])
MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD);
}
}
MPI_Send(&msg, 1, MPI_INT, src, tag2, MPI_COMM_WORLD);
}
}
- free(test);
MPI_Finalize();
return 0;
}
MPI_Finalize();
return 0;
}