Skip to content

Commit b56a21e

Browse files
committed
Update mpi_test_suite to MPI-3
Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 617b5ed commit b56a21e

File tree

6 files changed

+31
-61
lines changed

6 files changed

+31
-61
lines changed

io/tst_file_io_with_arrange.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ int tst_file_io_with_arrange_init (struct tst_env * env)
2929
#ifdef HAVE_MPI2_IO
3030
MPI_Comm comm;
3131
int comm_size, comm_rank, global_size;
32-
int i;
3332
MPI_Offset off_view, off_position;
3433
MPI_Datatype filetype_check, datatype_check;
3534
MPI_File file;
@@ -61,22 +60,8 @@ int tst_file_io_with_arrange_init (struct tst_env * env)
6160
exit(1);
6261
}
6362
MPI_CHECK(MPI_File_get_type_extent(file , type, &extent));
64-
{
65-
int block_mix[3];
66-
MPI_Aint disp_array[3]={
67-
0,
68-
0,
69-
comm_size*extent
70-
};
71-
MPI_Datatype mix_type[3] = {
72-
MPI_LB,
73-
type,
74-
MPI_UB
75-
};
76-
for(i=0 ; i < 3; i++) block_mix[i]=1;
77-
MPI_CHECK(MPI_Type_struct(3, block_mix, disp_array, mix_type, &filetype));
78-
MPI_CHECK(MPI_Type_commit(&filetype));
79-
}
63+
MPI_CHECK(MPI_Type_create_resized (type, 0, comm_size * extent, &filetype));
64+
MPI_CHECK(MPI_Type_commit(&filetype));
8065
MPI_CHECK(MPI_File_set_view(file,comm_rank*extent,type, filetype, "native", MPI_INFO_NULL));
8166
tst_type_setstandardarray (env->type, env->values_num,
8267
write_buffer, comm_rank);

io/tst_file_io_with_hole.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ int tst_file_io_with_hole_init (struct tst_env * env)
2828
#ifdef HAVE_MPI2_IO
2929
MPI_Comm comm;
3030
int comm_size, comm_rank;
31-
int i;
3231
MPI_File file;
3332
MPI_Datatype type;
3433
MPI_Aint extent;
@@ -77,22 +76,8 @@ int tst_file_io_with_hole_init (struct tst_env * env)
7776
exit(1);
7877
}
7978
MPI_CHECK (MPI_File_get_type_extent(file , type, &extent));
80-
{
81-
int block_mix[3];
82-
MPI_Aint disp_array[3]={
83-
0,
84-
0,
85-
2*extent
86-
};
87-
MPI_Datatype mix_type[3] = {
88-
MPI_LB,
89-
type,
90-
MPI_UB
91-
};
92-
for(i=0 ; i < 3; i++) block_mix[i]=1;
93-
MPI_CHECK (MPI_Type_struct(3, block_mix, disp_array, mix_type, &filetype));
94-
MPI_CHECK (MPI_Type_commit(&filetype));
95-
}
79+
MPI_CHECK (MPI_Type_create_resized(type, 0, 2 * extent, &filetype));
80+
MPI_CHECK (MPI_Type_commit(&filetype));
9681
MPI_CHECK (MPI_File_get_type_extent(file , filetype, &filetype_extent));
9782

9883
MPI_CHECK ( MPI_File_set_view(file,comm_rank*filetype_extent*env->values_num,type, filetype, "native", MPI_INFO_NULL));

p2p/tst_p2p_alltoall_xisend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int tst_p2p_alltoall_xisend_init (struct tst_env * env)
5151
*/
5252

5353
type = tst_type_getdatatype (env->type);
54-
MPI_Type_hvector (env->values_num, 1, 0, type, &env->extra_type_send);
54+
MPI_Type_create_hvector (env->values_num, 1, 0, type, &env->extra_type_send);
5555
MPI_Type_commit (&env->extra_type_send);
5656

5757
if ((env->req_buffer = malloc (2 * sizeof (MPI_Request) * comm_size)) == NULL)

p2p/tst_p2p_simple_ring_bottom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ int tst_p2p_simple_ring_bottom_init (struct tst_env * env)
3030
env->recv_buffer = tst_type_allocvalues (env->type, env->values_num);
3131

3232
dtype[0] = tst_type_getdatatype (env->type);
33-
MPI_Address(env->send_buffer, &(disp[0]));
34-
MPI_Type_struct(1, block, disp, dtype, &env->extra_type_send);
33+
MPI_Get_address(env->send_buffer, &(disp[0]));
34+
MPI_Type_create_struct(1, block, disp, dtype, &env->extra_type_send);
3535
MPI_Type_commit(&env->extra_type_send);
3636
/*
3737
* Now, initialize the send_buffer

p2p/tst_p2p_simple_ring_xsend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int tst_p2p_simple_ring_xsend_init (struct tst_env * env)
4040
* Create the derived datatype to send multiple entries of this type
4141
*/
4242
type = tst_type_getdatatype (env->type);
43-
MPI_Type_hvector (env->values_num, 1, 0, type, &env->extra_type_send);
43+
MPI_Type_create_hvector (env->values_num, 1, 0, type, &env->extra_type_send);
4444
MPI_Type_commit (&env->extra_type_send);
4545
return 0;
4646
}

tst_types.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ int tst_type_init (int * num_types)
219219
/*
220220
* MPI_HVECTOR_INT
221221
*/
222-
MPI_Type_hvector (TYPES_NUM_REPEAT, 1, sizeof(int), MPI_INT, &(types[num].mpi_datatype));
222+
MPI_Type_create_hvector (TYPES_NUM_REPEAT, 1, sizeof(int), MPI_INT, &(types[num].mpi_datatype));
223223
MPI_Type_commit (&(types[num].mpi_datatype));
224224
types[num].type_num = TYPES_NUM_REPEAT;
225225
for(i=0; i < TYPES_NUM_REPEAT; i++)
@@ -259,7 +259,7 @@ int tst_type_init (int * num_types)
259259
block[i] = 1;
260260
dis[i] = i*sizeof(int);
261261
}
262-
MPI_Type_hindexed (TYPES_NUM_REPEAT, block, dis, MPI_INT, &(types[num].mpi_datatype));
262+
MPI_Type_create_hindexed (TYPES_NUM_REPEAT, block, dis, MPI_INT, &(types[num].mpi_datatype));
263263
MPI_Type_commit (&(types[num].mpi_datatype));
264264
types[num].type_num = TYPES_NUM_REPEAT;
265265
for(i=0 ; i < TYPES_NUM_REPEAT; i++)
@@ -285,7 +285,7 @@ int tst_type_init (int * num_types)
285285
dis_struct[0] = 0;
286286
dtype[0] = MPI_INT;
287287

288-
MPI_Type_struct (1, block_struct, dis_struct, dtype, &(types[num].mpi_datatype));
288+
MPI_Type_create_struct (1, block_struct, dis_struct, dtype, &(types[num].mpi_datatype));
289289
MPI_Type_commit (&(types[num].mpi_datatype));
290290

291291
types[num].type_num = TYPES_NUM_REPEAT;
@@ -307,21 +307,21 @@ int tst_type_init (int * num_types)
307307
MPI_Aint mix_base;
308308
struct tst_mpi_type_mix type_tmp;
309309

310-
MPI_Address (&(type_tmp.a), disp_mix);
311-
MPI_Address (&(type_tmp.b), disp_mix+1);
312-
MPI_Address (&(type_tmp.c), disp_mix+2);
313-
MPI_Address (&(type_tmp.d), disp_mix+3);
314-
MPI_Address (&(type_tmp.e), disp_mix+4);
315-
MPI_Address (&(type_tmp.f), disp_mix+5);
316-
MPI_Address (&(type_tmp.g), disp_mix+6);
317-
MPI_Address (&(type_tmp.h), disp_mix+7);
318-
MPI_Address (&(type_tmp.i), disp_mix+8);
319-
MPI_Address (&(type_tmp.j), disp_mix+9);
320-
MPI_Address (&(type_tmp.k), disp_mix+10);
310+
MPI_Get_address (&(type_tmp.a), disp_mix);
311+
MPI_Get_address (&(type_tmp.b), disp_mix+1);
312+
MPI_Get_address (&(type_tmp.c), disp_mix+2);
313+
MPI_Get_address (&(type_tmp.d), disp_mix+3);
314+
MPI_Get_address (&(type_tmp.e), disp_mix+4);
315+
MPI_Get_address (&(type_tmp.f), disp_mix+5);
316+
MPI_Get_address (&(type_tmp.g), disp_mix+6);
317+
MPI_Get_address (&(type_tmp.h), disp_mix+7);
318+
MPI_Get_address (&(type_tmp.i), disp_mix+8);
319+
MPI_Get_address (&(type_tmp.j), disp_mix+9);
320+
MPI_Get_address (&(type_tmp.k), disp_mix+10);
321321
mix_base = disp_mix[0];
322322
for(i=0; i < 11; i++) disp_mix[i] -= mix_base;
323323
for(i=0; i < 11; i++) block_mix[i] = 1;
324-
MPI_Type_struct (11, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
324+
MPI_Type_create_struct (11, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
325325
MPI_Type_commit (&(types[num].mpi_datatype));
326326
types[num].type_num = 11;
327327
types[num].type_mapping[0] = TST_MPI_CHAR;
@@ -368,17 +368,17 @@ int tst_type_init (int * num_types)
368368
MPI_Type_commit (&(mix_type[4]));
369369
MPI_Type_commit (&(mix_type[5]));
370370
*/
371-
MPI_Address(&(type_tmp_array.a[0]), disp_mix);
372-
MPI_Address(&(type_tmp_array.b[0]), disp_mix+1);
373-
MPI_Address(&(type_tmp_array.c[0]), disp_mix+2);
374-
MPI_Address(&(type_tmp_array.d[0]), disp_mix+3);
375-
MPI_Address(&(type_tmp_array.e[0]), disp_mix+4);
376-
MPI_Address(&(type_tmp_array.f[0]), disp_mix+5);
371+
MPI_Get_address(&(type_tmp_array.a[0]), disp_mix);
372+
MPI_Get_address(&(type_tmp_array.b[0]), disp_mix+1);
373+
MPI_Get_address(&(type_tmp_array.c[0]), disp_mix+2);
374+
MPI_Get_address(&(type_tmp_array.d[0]), disp_mix+3);
375+
MPI_Get_address(&(type_tmp_array.e[0]), disp_mix+4);
376+
MPI_Get_address(&(type_tmp_array.f[0]), disp_mix+5);
377377

378378
mix_base = disp_mix[0];
379379
for(i=0; i < 6; i++) disp_mix[i] -= mix_base;
380380
for(i=0; i < 6; i++) block_mix[i] = 1;
381-
MPI_Type_struct (6, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
381+
MPI_Type_create_struct (6, block_mix, disp_mix, mix_type, &(types[num].mpi_datatype));
382382

383383
MPI_Type_free (&(mix_type[0]));
384384
MPI_Type_free (&(mix_type[1]));
@@ -429,7 +429,7 @@ int tst_type_init (int * num_types)
429429
MPI_DOUBLE,
430430
MPI_UB };
431431
for(i=0 ; i < 8; i++) block_mix[i]=1;
432-
MPI_Type_struct(8, block_mix, disp_array, mix_type, &(types[num].mpi_datatype));
432+
MPI_Type_create_struct(8, block_mix, disp_array, mix_type, &(types[num].mpi_datatype));
433433
MPI_Type_commit(&(types[num].mpi_datatype));
434434
types[num].type_num = 6;
435435
types[num].type_mapping[0] = TST_MPI_CHAR;

0 commit comments

Comments
 (0)