X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/558e19f535bb0c65b610bc758c8133ded549ca3c..3d65d2eaad96faf1c97960216cf8afe08308f9e5:/teshsuite/smpi/mpich3-test/util/dtypes.c diff --git a/teshsuite/smpi/mpich3-test/util/dtypes.c b/teshsuite/smpi/mpich3-test/util/dtypes.c index 8e60c201b6..b93fc9b713 100644 --- a/teshsuite/smpi/mpich3-test/util/dtypes.c +++ b/teshsuite/smpi/mpich3-test/util/dtypes.c @@ -56,6 +56,8 @@ static int basic_only = 0; has been received. */ +#define STR_SIZE 200 + /* Add a predefined MPI type to the tests. _count instances of the type will be sent. @@ -84,9 +86,9 @@ static int basic_only = 0; outbufs[cnt] = (void *)malloc(sizeof(_ctype) * (_count)); \ a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i] = i; \ a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i] = 0; \ - myname = (char *)malloc(100);\ + myname = (char *)malloc(STR_SIZE);\ MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \ - snprintf(myname, 100, "Contig type %s", _basename); \ + snprintf(myname, STR_SIZE, "Contig type %s", _basename); \ MPI_Type_set_name(types[cnt], myname); \ free(myname); \ counts[cnt] = 1; bytesize[cnt] = sizeof(_ctype) * (_count); cnt++; } @@ -105,9 +107,9 @@ static int basic_only = 0; outbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1); \ a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = i; \ a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = 0; \ - myname = (char *)malloc(100);\ + myname = (char *)malloc(STR_SIZE);\ MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \ - snprintf(myname, 100, "Vector type %s", _basename); \ + snprintf(myname, STR_SIZE, "Vector type %s", _basename); \ MPI_Type_set_name(types[cnt], myname); \ free(myname); \ counts[cnt] = 1; bytesize[cnt] = sizeof(_ctype) * (_count) * (_stride) ;\ @@ -130,9 +132,9 @@ static int basic_only = 0; outbufs[cnt] = (void *)malloc(sizeof(_ctype) * (_count)); \ a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i] = i; \ a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i] = 0; \ - myname = (char *)malloc(100);\ + myname = (char *)malloc(STR_SIZE);\ MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \ - snprintf(myname, 100, "Index type %s", _basename); \ + snprintf(myname, STR_SIZE, "Index type %s", _basename); \ MPI_Type_set_name(types[cnt], myname); \ free(myname); \ counts[cnt] = 1; bytesize[cnt] = sizeof(_ctype) * (_count); cnt++; } @@ -159,8 +161,8 @@ static int basic_only = 0; a[i].a2 = i; } \ a = (struct name *)outbufs[cnt]; for (i=0; i<(_count); i++) { a[i].a1 = 0; \ a[i].a2 = 0; } \ - myname = (char *)malloc(100); \ - snprintf(myname, 100, "Struct type %s", _tname); \ + myname = (char *)malloc(STR_SIZE); \ + snprintf(myname, STR_SIZE, "Struct type %s", _tname); \ MPI_Type_set_name(types[cnt], myname); \ free(myname); \ counts[cnt] = (_count); bytesize[cnt] = sizeof(struct name) * (_count);cnt++; } @@ -180,9 +182,9 @@ static int basic_only = 0; outbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1);\ a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = i; \ a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = 0; \ - myname = (char *)malloc(100); \ + myname = (char *)malloc(STR_SIZE); \ MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \ - snprintf(myname, 100, "Struct (MPI_UB) type %s", _basename); \ + snprintf(myname, STR_SIZE, "Struct (MPI_UB) type %s", _basename); \ MPI_Type_set_name(types[cnt], myname); \ free(myname); \ counts[cnt] = (_count); \