Skip to content

Commit e420edf

Browse files
committed
mpi: remove references to MPI_LB and MPI_UB (removed in MPI 3.0)
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 7c8f011 commit e420edf

File tree

15 files changed

+36
-180
lines changed

15 files changed

+36
-180
lines changed

ompi/datatype/ompi_datatype_create_subarray.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ int32_t ompi_datatype_create_subarray(int ndims,
4040
int32_t i, step, end_loop;
4141
MPI_Aint size, displ, extent;
4242

43-
/**
44-
* If the oldtype contains the original MPI_LB and MPI_UB markers then we
45-
* are forced to follow the MPI standard suggestion and reset these 2
46-
* markers (MPI 3.0 page 96 line 37). Otherwise we can simply resize the
47-
* datatype.
48-
*/
4943
ompi_datatype_type_extent( oldtype, &extent );
5044

5145
/* If the ndims is zero then return the NULL datatype */

ompi/datatype/ompi_datatype_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@
9292
#define OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX 0x2B
9393
#define OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX 0x2C
9494

95-
#define OMPI_DATATYPE_MPI_LB 0x2D
96-
#define OMPI_DATATYPE_MPI_UB 0x2E
97-
9895
/*
9996
* Datatypes from the MPI 3.0 standard
10097
*/

ompi/datatype/ompi_datatype_module.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ ompi_predefined_datatype_t ompi_mpi_datatype_null =
6868

6969
ompi_predefined_datatype_t ompi_mpi_unavailable = OMPI_DATATYPE_INIT_PREDEFINED (UNAVAILABLE, 0);
7070

71-
ompi_predefined_datatype_t ompi_mpi_lb = OMPI_DATATYPE_INIT_PREDEFINED (LB, 0);
72-
ompi_predefined_datatype_t ompi_mpi_ub = OMPI_DATATYPE_INIT_PREDEFINED (UB, 0);
7371
ompi_predefined_datatype_t ompi_mpi_char = OMPI_DATATYPE_INIT_PREDEFINED (CHAR, OMPI_DATATYPE_FLAG_DATA_C);
7472
ompi_predefined_datatype_t ompi_mpi_signed_char = OMPI_DATATYPE_INIT_PREDEFINED (SIGNED_CHAR, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_INT );
7573
ompi_predefined_datatype_t ompi_mpi_unsigned_char = OMPI_DATATYPE_INIT_PREDEFINED (UNSIGNED_CHAR, OMPI_DATATYPE_FLAG_DATA_C | OMPI_DATATYPE_FLAG_DATA_INT );
@@ -363,9 +361,6 @@ const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX_PREDEF
363361
[OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX] = &ompi_mpi_c_double_complex.dt,
364362
[OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX] = &ompi_mpi_c_long_double_complex.dt,
365363

366-
[OMPI_DATATYPE_MPI_LB] = &ompi_mpi_lb.dt,
367-
[OMPI_DATATYPE_MPI_UB] = &ompi_mpi_ub.dt,
368-
369364
/* MPI 3.0 types */
370365
[OMPI_DATATYPE_MPI_COUNT] = &ompi_mpi_count.dt,
371366

@@ -557,8 +552,6 @@ int32_t ompi_datatype_init( void )
557552
MOOG(datatype_null, 0);
558553
MOOG(byte, 1);
559554
MOOG(packed, 2);
560-
MOOG(ub, 3);
561-
MOOG(lb, 4);
562555
MOOG(character, 5);
563556
MOOG(logical, 6);
564557
MOOG(integer, 7);

ompi/include/mpif-values.pl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ sub write_file {
122122

123123
$handles->{MPI_BYTE} = 1;
124124
$handles->{MPI_PACKED} = 2;
125-
$handles->{MPI_UB} = 3;
126-
$handles->{MPI_LB} = 4;
127125
$handles->{MPI_CHARACTER} = 5;
128126
$handles->{MPI_LOGICAL} = 6;
129127
$handles->{MPI_INTEGER} = 7;

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ ptl_datatype_t ompi_coll_portals4_atomic_datatype [OMPI_DATATYPE_MPI_MAX_PREDEFI
111111
[OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX] = COLL_PORTALS4_NO_DTYPE,
112112
[OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX] = COLL_PORTALS4_NO_DTYPE,
113113

114-
[OMPI_DATATYPE_MPI_LB] = COLL_PORTALS4_NO_DTYPE,
115-
[OMPI_DATATYPE_MPI_UB] = COLL_PORTALS4_NO_DTYPE,
116-
117114
/* MPI 3.0 types */
118115
[OMPI_DATATYPE_MPI_COUNT] = COLL_PORTALS4_NO_DTYPE,
119116

ompi/mca/io/romio321/romio/adio/ad_pvfs2/ad_pvfs2_io_dtype.c

Lines changed: 2 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -416,38 +416,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
416416
MPI_Aint mpi_lb = -1, mpi_extent = -1;
417417
PVFS_offset pvfs_lb = -1;
418418
PVFS_size pvfs_extent = -1;
419-
int has_lb_ub = 0;
420-
421-
/* When converting into a PVFS_Request_struct, we no longer
422-
* can use MPI_LB and MPI_UB. Therfore, we have to do the
423-
* following.
424-
* We simply ignore all the MPI_LB and MPI_UB types and
425-
* get the lb and extent and pass it on through a
426-
* PVFS resized_req */
427-
428-
arr_count = 0;
429-
for (i = 0; i < arr_int[0]; i++)
430-
{
431-
if (arr_dtype[i] != MPI_LB &&
432-
arr_dtype[i] != MPI_UB)
433-
{
434-
arr_count++;
435-
}
436-
}
437-
438-
if (arr_int[0] != arr_count)
439-
{
440-
MPI_Type_get_extent(*mpi_dtype, &mpi_lb, &mpi_extent);
441-
pvfs_lb = mpi_lb;
442-
pvfs_extent = mpi_extent;
443-
if ((pvfs_arr_len = ADIOI_Malloc(arr_count*sizeof(int)))
444-
== NULL)
445-
{
446-
fprintf(stderr, "convert_mpi_pvfs2_dtype: "
447-
"Failed to allocate pvfs_arr_len\n");
448-
}
449-
has_lb_ub = 1;
450-
}
419+
arr_count = arr_int[0];
451420

452421
if ((old_pvfs_dtype_arr
453422
= ADIOI_Malloc(arr_count*sizeof(PVFS_Request))) == NULL)
@@ -464,70 +433,15 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
464433
arr_count = 0;
465434
for (i = 0; i < arr_int[0]; i++)
466435
{
467-
if (arr_dtype[i] != MPI_LB &&
468-
arr_dtype[i] != MPI_UB)
469-
{
470436
leaf = convert_mpi_pvfs2_dtype(
471437
&arr_dtype[i], &old_pvfs_dtype_arr[arr_count]);
472438
if (leaf != 1)
473439
MPI_Type_free(&arr_dtype[i]);
474440
pvfs_arr_disp[arr_count] =
475441
(PVFS_size) arr_addr[i];
476-
if (has_lb_ub)
477-
{
478-
pvfs_arr_len[arr_count] =
479-
arr_int[i+1];
480-
}
481442
arr_count++;
482-
}
483443
}
484444

485-
/* If a MPI_UB or MPI_LB did exist, we have to
486-
* resize the datatype */
487-
if (has_lb_ub)
488-
{
489-
PVFS_Request *tmp_pvfs_dtype = NULL;
490-
if ((tmp_pvfs_dtype = ADIOI_Malloc(sizeof(PVFS_Request))) == NULL)
491-
fprintf(stderr, "convert_mpi_pvfs2_dtype: "
492-
"Failed to allocate PVFS_Request\n");
493-
494-
ret = PVFS_Request_struct(arr_count, pvfs_arr_len,
495-
pvfs_arr_disp,
496-
old_pvfs_dtype_arr, tmp_pvfs_dtype);
497-
if (ret != 0)
498-
fprintf(stderr, "Error in PVFS_Request_struct\n");
499-
500-
arr_count = 0;
501-
for (i = 0; i < arr_int[0]; i++)
502-
{
503-
if (arr_dtype[i] != MPI_LB &&
504-
arr_dtype[i] != MPI_UB)
505-
{
506-
PVFS_Request_free(&old_pvfs_dtype_arr[arr_count]);
507-
arr_count++;
508-
}
509-
}
510-
511-
#ifdef DEBUG_DTYPE
512-
fprintf(stderr, "STRUCT(WITHOUT %d LB or UB)(%d,[",
513-
arr_int[0] - arr_count, arr_count);
514-
for (i = 0; i < arr_count; i++)
515-
fprintf(stderr, "(%d,%Ld) ",
516-
pvfs_arr_len[i],
517-
pvfs_arr_disp[i]);
518-
fprintf(stderr, "]\n");
519-
fprintf(stderr, "RESIZED(LB = %Ld, EXTENT = %Ld)\n",
520-
pvfs_lb, pvfs_extent);
521-
#endif
522-
ret = PVFS_Request_resized(*tmp_pvfs_dtype,
523-
pvfs_lb, pvfs_extent, pvfs_dtype);
524-
if (ret != 0)
525-
fprintf(stderr, "Error in PVFS_Request_resize\n");
526-
527-
PVFS_Request_free(tmp_pvfs_dtype);
528-
ADIOI_Free(tmp_pvfs_dtype);
529-
}
530-
else /* No MPI_LB or MPI_UB datatypes */
531445
{
532446
ret = PVFS_Request_struct(arr_int[0], &arr_int[1],
533447
pvfs_arr_disp,
@@ -537,9 +451,7 @@ int convert_mpi_pvfs2_dtype(MPI_Datatype *mpi_dtype,
537451

538452
for (i = 0; i < arr_int[0]; i++)
539453
{
540-
if (arr_dtype[i] != MPI_LB &&
541-
arr_dtype[i] != MPI_UB)
542-
PVFS_Request_free(&old_pvfs_dtype_arr[i]);
454+
PVFS_Request_free(&old_pvfs_dtype_arr[i]);
543455
}
544456

545457
#ifdef DEBUG_DTYPE

ompi/mca/io/romio321/romio/test-internal/io_bounds_test.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@ int print_test_params (test_param_t *test)
191191
if (test->type_oldtypes[i] == MPI_BYTE) {
192192
printf ( "%s)\n", "MPI_BYTE");
193193
}
194-
else if (test->type_oldtypes[i] == MPI_UB) {
195-
printf ( "%s)\n", "MPI_UB");
196-
}
197-
else if (test->type_oldtypes[i] == MPI_LB) {
198-
printf ( "%s)\n", "MPI_LB");
199-
}
200194
}
201195
printf (
202196
"Expected Start offset: %lld\n"

ompi/mca/io/romio321/romio/test/i_noncontig.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
int main(int argc, char **argv)
1818
{
19-
int *buf, i, mynod, nprocs, len, b[3];
19+
int *buf, i, mynod, nprocs, len, b;
2020
int errs=0, toterrs;
21-
MPI_Aint d[3];
21+
MPI_Aint d;
2222
MPI_File fh;
2323
MPI_Status status;
2424
char *filename;
25-
MPI_Datatype typevec, newtype, t[3];
25+
MPI_Datatype typevec, typevec2, newtype;
2626
MPIO_Request req;
2727

2828
MPI_Init(&argc,&argv);
@@ -63,15 +63,8 @@ int main(int argc, char **argv)
6363

6464
MPI_Type_vector(SIZE/2, 1, 2, MPI_INT, &typevec);
6565

66-
b[0] = b[1] = b[2] = 1;
67-
d[0] = 0;
68-
d[1] = mynod*sizeof(int);
69-
d[2] = SIZE*sizeof(int);
70-
t[0] = MPI_LB;
71-
t[1] = typevec;
72-
t[2] = MPI_UB;
73-
74-
MPI_Type_create_struct(3, b, d, t, &newtype);
66+
MPI_Type_create_struct(1, &b, &d, &typevec, &typevec2);
67+
MPI_Type_create_resized(typevec2, 0, SIZE*sizeof(int), &newtype);
7568
MPI_Type_commit(&newtype);
7669
MPI_Type_free(&typevec);
7770

ompi/mca/io/romio321/romio/test/noncontig.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define VERBOSE 0
1616
int main(int argc, char **argv)
1717
{
18-
int *buf, i, mynod, nprocs, len, b[3];
18+
int *buf, i, mynod, nprocs, len, b;
1919
int errs=0, toterrs;
20-
MPI_Aint d[3];
20+
MPI_Aint d;
2121
MPI_File fh;
2222
MPI_Status status;
2323
char *filename;
24-
MPI_Datatype typevec, newtype, t[3];
24+
MPI_Datatype typevec, typevec2, newtype;
2525
MPI_Info info;
2626

2727
MPI_Init(&argc,&argv);
@@ -66,16 +66,12 @@ int main(int argc, char **argv)
6666
* of typevec are such that the types for the two processes won't
6767
* overlap.
6868
*/
69-
b[0] = b[1] = b[2] = 1;
70-
d[0] = 0;
71-
d[1] = mynod*sizeof(int);
72-
d[2] = SIZE*sizeof(int);
73-
t[0] = MPI_LB;
74-
t[1] = typevec;
75-
t[2] = MPI_UB;
69+
b = 1;
70+
d = mynod*sizeof(int);
7671

7772
/* keep the struct, ditch the vector */
78-
MPI_Type_create_struct(3, b, d, t, &newtype);
73+
MPI_Type_create_struct(1, &b, &d, typevec, &typevec2);
74+
MPI_Type_create_resized(typevec2, 0, SIZE*sizeof(int), &newtype);
7975
MPI_Type_commit(&newtype);
8076
MPI_Type_free(&typevec);
8177

ompi/mca/io/romio321/romio/test/noncontig_coll.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define VERBOSE 0
1616
int main(int argc, char **argv)
1717
{
18-
int *buf, i, mynod, nprocs, len, b[3];
18+
int *buf, i, mynod, nprocs, len, b;
1919
int errs=0, toterrs;
20-
MPI_Aint d[3];
20+
MPI_Aint d;
2121
MPI_File fh;
2222
MPI_Status status;
2323
char *filename;
24-
MPI_Datatype typevec, newtype, t[3];
24+
MPI_Datatype typevec, typevec2, newtype;
2525

2626
MPI_Init(&argc,&argv);
2727
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
@@ -61,15 +61,11 @@ int main(int argc, char **argv)
6161

6262
MPI_Type_vector(SIZE/2, 1, 2, MPI_INT, &typevec);
6363

64-
b[0] = b[1] = b[2] = 1;
65-
d[0] = 0;
66-
d[1] = mynod*sizeof(int);
67-
d[2] = SIZE*sizeof(int);
68-
t[0] = MPI_LB;
69-
t[1] = typevec;
70-
t[2] = MPI_UB;
64+
b = 1;
65+
d = mynod*sizeof(int);
7166

72-
MPI_Type_create_struct(3, b, d, t, &newtype);
67+
MPI_Type_create_struct(1, &b, &d, &typevec, &typevec2);
68+
MPI_Type_create_resized(typevec2, 0, SIZE*sizeof(int), &newtype);
7369
MPI_Type_commit(&newtype);
7470
MPI_Type_free(&typevec);
7571

0 commit comments

Comments
 (0)