Skip to content

Commit 970c5ef

Browse files
committedJan 20, 2021
Adjust complex tests for changed -z behavior.
1 parent 40c6d97 commit 970c5ef

8 files changed

+33
-39
lines changed
 

‎src/ior.c

+21-23
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static char *PrependDir(IOR_param_t *, char *);
5353
static char **ParseFileName(char *, int *);
5454
static void InitTests(IOR_test_t * , MPI_Comm);
5555
static void TestIoSys(IOR_test_t *);
56-
static void ValidateTests(IOR_param_t *);
56+
static void ValidateTests(IOR_param_t * params, MPI_Comm com);
5757
static IOR_offset_t WriteOrRead(IOR_param_t *test, IOR_results_t *results,
5858
aiori_fd_t *fd, const int access,
5959
IOR_io_buffers *ioBuffers);
@@ -107,12 +107,11 @@ IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE * world_out
107107
IOR_test_t *tptr;
108108
out_logfile = world_out;
109109
out_resultfile = world_out;
110-
mpi_comm_world = world_com;
111110

112-
MPI_CHECK(MPI_Comm_rank(mpi_comm_world, &rank), "cannot get rank");
111+
MPI_CHECK(MPI_Comm_rank(world_com, &rank), "cannot get rank");
113112

114113
/* setup tests, and validate parameters */
115-
tests_head = ParseCommandLine(argc, argv);
114+
tests_head = ParseCommandLine(argc, argv, world_com);
116115
InitTests(tests_head, world_com);
117116

118117
PrintHeader(argc, argv);
@@ -147,20 +146,19 @@ int ior_main(int argc, char **argv)
147146
/*
148147
* check -h option from commandline without starting MPI;
149148
*/
150-
tests_head = ParseCommandLine(argc, argv);
149+
tests_head = ParseCommandLine(argc, argv, MPI_COMM_WORLD);
151150

152151
/* start the MPI code */
153152
MPI_CHECK(MPI_Init(&argc, &argv), "cannot initialize MPI");
154153

155-
mpi_comm_world = MPI_COMM_WORLD;
156-
MPI_CHECK(MPI_Comm_rank(mpi_comm_world, &rank), "cannot get rank");
154+
MPI_CHECK(MPI_Comm_rank(MPI_COMM_WORLD, &rank), "cannot get rank");
157155

158156
/* set error-handling */
159157
/*MPI_CHECK(MPI_Errhandler_set(mpi_comm_world, MPI_ERRORS_RETURN),
160158
"cannot set errhandler"); */
161159

162160
/* setup tests, and validate parameters */
163-
InitTests(tests_head, mpi_comm_world);
161+
InitTests(tests_head, MPI_COMM_WORLD);
164162

165163
PrintHeader(argc, argv);
166164

@@ -201,7 +199,7 @@ int ior_main(int argc, char **argv)
201199
/*
202200
* Initialize an IOR_param_t structure to the defaults
203201
*/
204-
void init_IOR_Param_t(IOR_param_t * p)
202+
void init_IOR_Param_t(IOR_param_t * p, MPI_Comm com)
205203
{
206204
const char *default_aiori = aiori_default ();
207205
assert (NULL != default_aiori);
@@ -231,7 +229,8 @@ void init_IOR_Param_t(IOR_param_t * p)
231229
p->transferSize = 262144;
232230
p->randomSeed = -1;
233231
p->incompressibleSeed = 573;
234-
p->testComm = mpi_comm_world;
232+
p->testComm = com; // this com might change for smaller tests
233+
p->mpi_comm_world = com;
235234

236235
p->URI = NULL;
237236
}
@@ -567,7 +566,7 @@ static void DestroyTests(IOR_test_t *tests_head)
567566
/*
568567
* Distribute IOR_HINTs to all tasks' environments.
569568
*/
570-
void DistributeHints(void)
569+
static void DistributeHints(MPI_Comm com)
571570
{
572571
char hint[MAX_HINTS][MAX_STR], fullHint[MAX_STR], hintVariable[MAX_STR];
573572
int hintCount = 0, i;
@@ -589,9 +588,9 @@ void DistributeHints(void)
589588
}
590589
}
591590

592-
MPI_CHECK(MPI_Bcast(&hintCount, sizeof(hintCount), MPI_BYTE, 0, testComm), "cannot broadcast hints");
591+
MPI_CHECK(MPI_Bcast(&hintCount, sizeof(hintCount), MPI_BYTE, 0, com), "cannot broadcast hints");
593592
for (i = 0; i < hintCount; i++) {
594-
MPI_CHECK(MPI_Bcast(&hint[i], MAX_STR, MPI_BYTE, 0, testComm),
593+
MPI_CHECK(MPI_Bcast(&hint[i], MAX_STR, MPI_BYTE, 0, com),
595594
"cannot broadcast hints");
596595
strcpy(fullHint, hint[i]);
597596
strcpy(hintVariable, strtok(fullHint, "="));
@@ -973,7 +972,7 @@ static void InitTests(IOR_test_t *tests, MPI_Comm com)
973972
* task 0 has the environment settings for the hints, pass
974973
* the hint=value pair to everyone else in mpi_comm_world
975974
*/
976-
DistributeHints();
975+
DistributeHints(com);
977976

978977
/* check validity of tests and create test queue */
979978
while (tests != NULL) {
@@ -1002,7 +1001,7 @@ static void InitTests(IOR_test_t *tests, MPI_Comm com)
10021001
params->expectedAggFileSize =
10031002
params->blockSize * params->segmentCount * params->numTasks;
10041003

1005-
ValidateTests(&tests->params);
1004+
ValidateTests(&tests->params, com);
10061005
tests = tests->next;
10071006
}
10081007

@@ -1069,7 +1068,7 @@ static void file_hits_histogram(IOR_param_t *params)
10691068
}
10701069

10711070
MPI_CHECK(MPI_Gather(&rankOffset, 1, MPI_INT, rankoffs,
1072-
1, MPI_INT, 0, mpi_comm_world),
1071+
1, MPI_INT, 0, params->testComm),
10731072
"MPI_Gather error");
10741073

10751074
if (rank != 0)
@@ -1225,21 +1224,21 @@ static void TestIoSys(IOR_test_t *test)
12251224
IOR_io_buffers ioBuffers;
12261225

12271226
/* set up communicator for test */
1228-
MPI_CHECK(MPI_Comm_group(mpi_comm_world, &orig_group),
1227+
MPI_CHECK(MPI_Comm_group(params->mpi_comm_world, &orig_group),
12291228
"MPI_Comm_group() error");
12301229
range[0] = 0; /* first rank */
12311230
range[1] = params->numTasks - 1; /* last rank */
12321231
range[2] = 1; /* stride */
12331232
MPI_CHECK(MPI_Group_range_incl(orig_group, 1, &range, &new_group),
12341233
"MPI_Group_range_incl() error");
1235-
MPI_CHECK(MPI_Comm_create(mpi_comm_world, new_group, &testComm),
1234+
MPI_CHECK(MPI_Comm_create(params->mpi_comm_world, new_group, &testComm),
12361235
"MPI_Comm_create() error");
12371236
MPI_CHECK(MPI_Group_free(&orig_group), "MPI_Group_Free() error");
12381237
MPI_CHECK(MPI_Group_free(&new_group), "MPI_Group_Free() error");
12391238
params->testComm = testComm;
12401239
if (testComm == MPI_COMM_NULL) {
12411240
/* tasks not in the group do not participate in this test */
1242-
MPI_CHECK(MPI_Barrier(mpi_comm_world), "barrier error");
1241+
MPI_CHECK(MPI_Barrier(params->mpi_comm_world), "barrier error");
12431242
return;
12441243
}
12451244
if (rank == 0 && verbose >= VERBOSE_1) {
@@ -1536,17 +1535,16 @@ static void TestIoSys(IOR_test_t *test)
15361535
free(hog_buf);
15371536

15381537
/* Sync with the tasks that did not participate in this test */
1539-
MPI_CHECK(MPI_Barrier(mpi_comm_world), "barrier error");
1540-
1538+
MPI_CHECK(MPI_Barrier(params->mpi_comm_world), "barrier error");
15411539
}
15421540

15431541
/*
15441542
* Determine if valid tests from parameters.
15451543
*/
1546-
static void ValidateTests(IOR_param_t * test)
1544+
static void ValidateTests(IOR_param_t * test, MPI_Comm com)
15471545
{
15481546
IOR_param_t defaults;
1549-
init_IOR_Param_t(&defaults);
1547+
init_IOR_Param_t(&defaults, com);
15501548

15511549
if (test->repetitions <= 0)
15521550
WARN_RESET("too few test repetitions",

‎src/ior.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ typedef struct
9898
char * options; /* options string */
9999
// intermediate options
100100
int collective; /* collective I/O */
101-
MPI_Comm testComm; /* MPI communicator */
101+
MPI_Comm testComm; /* Current MPI communicator */
102+
MPI_Comm mpi_comm_world; /* The global MPI communicator */
102103
int dryRun; /* do not perform any I/Os just run evtl. inputs print dummy output */
103104
int dualMount; /* dual mount points */
104105
int numTasks; /* number of tasks for test */
@@ -205,7 +206,7 @@ IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num);
205206
void AllocResults(IOR_test_t *test);
206207

207208
char * GetPlatformName(void);
208-
void init_IOR_Param_t(IOR_param_t *p);
209+
void init_IOR_Param_t(IOR_param_t *p, MPI_Comm global_com);
209210

210211
/*
211212
* This function runs IOR given by command line, useful for testing

‎src/mdtest.c

-1
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,6 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *
19441944
testComm = world_com;
19451945
out_logfile = world_out;
19461946
out_resultfile = world_out;
1947-
mpi_comm_world = world_com;
19481947

19491948
init_clock(world_com);
19501949

‎src/parse_options.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "option.h"
3333
#include "aiori.h"
3434

35-
IOR_param_t initialTestParams;
35+
static IOR_param_t initialTestParams;
3636

3737
option_help * createGlobalOptions(IOR_param_t * params);
3838

@@ -451,9 +451,9 @@ option_help * createGlobalOptions(IOR_param_t * params){
451451
/*
452452
* Parse Commandline.
453453
*/
454-
IOR_test_t *ParseCommandLine(int argc, char **argv)
454+
IOR_test_t *ParseCommandLine(int argc, char **argv, MPI_Comm com)
455455
{
456-
init_IOR_Param_t(& initialTestParams);
456+
init_IOR_Param_t(& initialTestParams, com);
457457

458458
IOR_test_t *tests = NULL;
459459

‎src/parse_options.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include "ior.h"
1515

16-
extern IOR_param_t initialTestParams;
17-
18-
IOR_test_t *ParseCommandLine(int argc, char **argv);
16+
IOR_test_t *ParseCommandLine(int argc, char **argv, MPI_Comm com);
1917

2018
#endif /* !_PARSE_OPTIONS_H */

‎src/utilities.c

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ int rank = 0;
6565
int rankOffset = 0;
6666
int verbose = VERBOSE_0; /* verbose output */
6767
MPI_Comm testComm;
68-
MPI_Comm mpi_comm_world;
6968
FILE * out_logfile = NULL;
7069
FILE * out_resultfile = NULL;
7170
enum OutputFormat_t outputFormat;

‎src/utilities.h

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ extern int rank;
2222
extern int rankOffset;
2323
extern int verbose;
2424
extern MPI_Comm testComm;
25-
extern MPI_Comm mpi_comm_world;
2625
extern FILE * out_resultfile;
2726
extern enum OutputFormat_t outputFormat; /* format of the output */
2827

‎testing/complex-tests.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ MDTEST 2 -I 20 -a DUMMY -x stonewall-md.log -T -v
1919
MDTEST 2 -I 20 -a DUMMY -x stonewall-md.log -D -v
2020

2121
#shared tests
22-
IOR 2 -a POSIX -w -z -Y -e -i1 -m -t 100k -b 100k
23-
IOR 2 -a POSIX -w -k -e -i1 -m -t 100k -b 100k
24-
IOR 2 -a POSIX -r -z-k -e -i1 -m -t 100k -b 100k
22+
IOR 2 -a POSIX -w -z -Y -e -i1 -m -t 100k -b 200k
23+
IOR 2 -a POSIX -w -k -e -i1 -m -t 100k -b 200k
24+
IOR 2 -a POSIX -r -z-k -e -i1 -m -t 100k -b 200k
2525

2626
#test mutually exclusive options
27-
IOR 2 -a POSIX -w -z -k -e -i1 -m -t 100k -b 100k
28-
IOR 2 -a POSIX -w -z -k -e -i1 -m -t 100k -b 100k
27+
IOR 2 -a POSIX -w -z -k -e -i1 -m -t 100k -b 200k
28+
IOR 2 -a POSIX -w -z -k -e -i1 -m -t 100k -b 200k
2929
IOR 2 -a POSIX -w -Z -i1 -m -t 100k -b 100k -d 0.1
3030

3131
# Now set the num tasks per node to 1:

0 commit comments

Comments
 (0)
Please sign in to comment.