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
Initialize variable.
[simgrid.git]
/
teshsuite
/
smpi
/
type-struct
/
type-struct.c
diff --git
a/teshsuite/smpi/type-struct/type-struct.c
b/teshsuite/smpi/type-struct/type-struct.c
index 6e244841108e4eba863883099fae2c4a4629d5ed..2a4b38dba7b3c2d73c6dc3a12d507d19422406ed 100644
(file)
--- a/
teshsuite/smpi/type-struct/type-struct.c
+++ b/
teshsuite/smpi/type-struct/type-struct.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2012-20
14
. The SimGrid Team.
+/* Copyright (c) 2012-20
20
. 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
@@
-10,7
+10,12
@@
int main(int argc, char **argv)
{
int rank;
int main(int argc, char **argv)
{
int rank;
- struct { int a;int c; double b;int tab[2][3];} value;
+ struct {
+ int a;
+ int c;
+ double b;
+ int tab[2][3];
+ } value = {0};
MPI_Datatype mystruct;
int blocklens[3];
MPI_Aint indices[3];
MPI_Datatype mystruct;
int blocklens[3];
MPI_Aint indices[3];
@@
-21,7
+26,7
@@
int main(int argc, char **argv)
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
- int tab[2][3]={{1*rank,2*rank,3*rank},{7*rank,8*rank,9*rank}};
+ int tab[2][3]={{1*rank,2*rank,3*rank},{7*rank,8*rank,9*rank}};
MPI_Type_contiguous(3, MPI_INT, &type2);
MPI_Type_commit(&type2);
MPI_Type_contiguous(3, MPI_INT, &type2);
MPI_Type_commit(&type2);
@@
-50,7
+55,7
@@
int main(int argc, char **argv)
value.b=8.0;
}else{
value.a=10000;
value.b=8.0;
}else{
value.a=10000;
- value.b=5.0;
+ value.b=5.0;
}
MPI_Bcast( &value, 1, mystruct, 0, MPI_COMM_WORLD );
}
MPI_Bcast( &value, 1, mystruct, 0, MPI_COMM_WORLD );