Skip to content

Commit

Permalink
Got IOR shifting to work regardless of whether node/task mapping is r…
Browse files Browse the repository at this point in the history
…ound-robin or contiguous
  • Loading branch information
John Bent authored and John Bent committed Jul 27, 2019
1 parent d69957e commit 629ff81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ static void InitTests(IOR_test_t *tests, MPI_Comm com)
params->testComm = com;
params->nodes = params->numTasks / tasksPerNode;
params->tasksPerNode = tasksPerNode;
params->packedTasks = QueryNodeMapping(com);
if (params->numTasks == 0) {
params->numTasks = size;
}
Expand Down Expand Up @@ -1360,7 +1361,13 @@ static void TestIoSys(IOR_test_t *test)
}
if (params->reorderTasks) {
/* move two nodes away from writing node */
rankOffset = (2 * params->tasksPerNode) % params->numTasks;
int shift = 1;
if (params->packedTasks) {
shift = params->tasksPerNode;
} else {
shift = 1;
}
rankOffset = (2 * shift) % params->numTasks;
}

// update the check buffer
Expand Down Expand Up @@ -1395,9 +1402,14 @@ static void TestIoSys(IOR_test_t *test)
/* Get rankOffset [file offset] for this process to read, based on -C,-Z,-Q,-X options */
/* Constant process offset reading */
if (params->reorderTasks) {
/* move taskPerNodeOffset nodes[1==default] away from writing node */
rankOffset = (params->taskPerNodeOffset *
params->tasksPerNode) % params->numTasks;
/* move one node away from writing node */
int shift = 1;
if (params->packedTasks) {
shift=params->tasksPerNode;
} else {
shift=1;
}
rankOffset = (params->taskPerNodeOffset * shift) % params->numTasks;
}
/* random process offset reading */
if (params->reorderTasksRandom) {
Expand Down
1 change: 1 addition & 0 deletions src/ior.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ typedef struct
int numTasks; /* number of tasks for test */
int nodes; /* number of nodes for test */
int tasksPerNode; /* number of tasks per node */
int packedTasks; /* are the tasks round-robin across nodes or are they packed tightly*/
int repetitions; /* number of repetitions of test */
int repCounter; /* rep counter */
int multiFile; /* multiple files */
Expand Down

0 comments on commit 629ff81

Please sign in to comment.