Fix some compiler warnings introduced in r11619. I checked with
George: ompi_ddt_type_size() returns a signed int only because of the MPI spec; it will never return a negative value. So casting the return value out of it to a (uint32_t) is safe, and makes the comparisons be between two unsigned values. This commit was SVN r11639. The following SVN revision numbers were found above: r11619 --> open-mpi/ompi@8667648a1b
Этот коммит содержится в:
родитель
0fd414b8e3
Коммит
a8e9fa09da
@ -85,8 +85,12 @@ ompi_coll_tuned_bcast_intra_chain ( void *buff, int count,
|
|||||||
segcount = count;
|
segcount = count;
|
||||||
num_segments = 1;
|
num_segments = 1;
|
||||||
} else {
|
} else {
|
||||||
/* segment the message */
|
/* segment the message (ompi_ddt_type_size() will never return
|
||||||
if (segsize < typelng) segsize = typelng; /* push segsize up to hold one type */
|
a negative value in typelng; it returns an int [vs. an
|
||||||
|
unsigned type] because of the MPI spec) */
|
||||||
|
if (segsize < ((uint32_t) typelng)) {
|
||||||
|
segsize = typelng; /* push segsize up to hold one type */
|
||||||
|
}
|
||||||
segcount = segsize / typelng;
|
segcount = segsize / typelng;
|
||||||
if (segcount > count) { /* we have a single underfilled segment */
|
if (segcount > count) { /* we have a single underfilled segment */
|
||||||
segcount = count;
|
segcount = count;
|
||||||
@ -276,14 +280,17 @@ ompi_coll_tuned_bcast_intra_split_bintree ( void* buffer,
|
|||||||
|
|
||||||
err = ompi_ddt_type_size( datatype, &type_size );
|
err = ompi_ddt_type_size( datatype, &type_size );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Determine number of segments and number of elements per segment */
|
/* Determine number of segments and number of elements per segment */
|
||||||
counts[0] = count/2;
|
counts[0] = count/2;
|
||||||
if (count % 2 != 0) counts[0]++;
|
if (count % 2 != 0) counts[0]++;
|
||||||
counts[1] = count - counts[0];
|
counts[1] = count - counts[0];
|
||||||
if ( segsize > 0 ) {
|
if ( segsize > 0 ) {
|
||||||
if (segsize < type_size) segsize = type_size; /* push segsize up to hold one type */
|
/* Note that ompi_ddt_type_size() will never return a negative
|
||||||
|
value in typelng; it returns an int [vs. an unsigned type]
|
||||||
|
because of the MPI spec. */
|
||||||
|
if (segsize < ((uint32_t) type_size)) {
|
||||||
|
segsize = type_size; /* push segsize up to hold one type */
|
||||||
|
}
|
||||||
segcount[0] = segcount[1] = segsize / type_size;
|
segcount[0] = segcount[1] = segsize / type_size;
|
||||||
num_segments[0] = counts[0]/segcount[0];
|
num_segments[0] = counts[0]/segcount[0];
|
||||||
if ((counts[0] % segcount[0]) != 0) num_segments[0]++;
|
if ((counts[0] % segcount[0]) != 0) num_segments[0]++;
|
||||||
@ -531,7 +538,6 @@ ompi_coll_tuned_bcast_intra_bintree ( void* buffer,
|
|||||||
comm->c_coll_selected_data->cached_bintree_root = root;
|
comm->c_coll_selected_data->cached_bintree_root = root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
err = ompi_ddt_type_size( datatype, &type_size );
|
err = ompi_ddt_type_size( datatype, &type_size );
|
||||||
|
|
||||||
/* Determine number of segments and number of elements sent per operation */
|
/* Determine number of segments and number of elements sent per operation */
|
||||||
@ -540,8 +546,12 @@ ompi_coll_tuned_bcast_intra_bintree ( void* buffer,
|
|||||||
segcount = count;
|
segcount = count;
|
||||||
num_segments = 1;
|
num_segments = 1;
|
||||||
} else {
|
} else {
|
||||||
/* segment the message */
|
/* segment the message. Note that ompi_ddt_type_size() will
|
||||||
if (segsize < type_size) segsize = type_size; /* push segsize up to hold one type */
|
never return a negative value in typelng; it returns an int
|
||||||
|
[vs. an unsigned type] because of the MPI spec. */
|
||||||
|
if (segsize < ((uint32_t) type_size)) {
|
||||||
|
segsize = type_size; /* push segsize up to hold one type */
|
||||||
|
}
|
||||||
segcount = segsize / type_size;
|
segcount = segsize / type_size;
|
||||||
if (segcount > count) { /* we have a single underfilled segment */
|
if (segcount > count) { /* we have a single underfilled segment */
|
||||||
segcount = count;
|
segcount = count;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user