X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3a6ab425e9bac068b1f95bf690400f63f5290093..44bb35da9c0093feb66a11b040790fc7054427c4:/examples/smpi/scatter.c diff --git a/examples/smpi/scatter.c b/examples/smpi/scatter.c index 9647aee838..e4a63037e5 100644 --- a/examples/smpi/scatter.c +++ b/examples/smpi/scatter.c @@ -24,56 +24,80 @@ #include #include -int ibm_test(int rank, int size) { +static int ibm_test(int rank, int size) +{ #define MAXLEN 10000 - int success = 1; - int root,i,j,k; - int out[MAXLEN*64]; - int in[MAXLEN]; + int success = 1; + int root = 0; + int i, j, k; + int *out; + int *in; + + out = malloc(MAXLEN * 64 * sizeof(int)); + in = malloc(MAXLEN * sizeof(int)); - for(j=1,root=0;j<=MAXLEN;j*=10,root=(root+1)%size) { - if(rank == root) - for(i=0;i