From 0ffec67d2b35f60cd99cfb8307a2f342414c3bcc Mon Sep 17 00:00:00 2001 From: John Bent Date: Sun, 28 Jul 2019 10:25:42 -0600 Subject: [PATCH] Following Julian's suggestion about better naming --- src/ior.c | 18 +++++++----------- src/ior.h | 2 +- src/mdtest.c | 6 ++++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/ior.c b/src/ior.c index bb2b4c2..64530fd 100755 --- a/src/ior.c +++ b/src/ior.c @@ -939,7 +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); + params->tasksBlockMapping = QueryNodeMapping(com); if (params->numTasks == 0) { params->numTasks = size; } @@ -1361,11 +1361,9 @@ static void TestIoSys(IOR_test_t *test) } if (params->reorderTasks) { /* move two nodes away from writing node */ - int shift = 1; - if (params->packedTasks) { - shift = params->tasksPerNode; - } else { - shift = 1; + int shift = 1; /* assume a by-node (round-robin) mapping of tasks to nodes */ + if (params->tasksBlockMapping) { + shift = params->tasksPerNode; /* switch to by-slot (contiguous block) mapping */ } rankOffset = (2 * shift) % params->numTasks; } @@ -1403,11 +1401,9 @@ static void TestIoSys(IOR_test_t *test) /* Constant process offset reading */ if (params->reorderTasks) { /* move one node away from writing node */ - int shift = 1; - if (params->packedTasks) { - shift=params->tasksPerNode; - } else { - shift=1; + int shift = 1; /* assume a by-node (round-robin) mapping of tasks to nodes */ + if (params->tasksBlockMapping) { + shift=params->tasksPerNode; /* switch to a by-slot (contiguous block) mapping */ } rankOffset = (params->taskPerNodeOffset * shift) % params->numTasks; } diff --git a/src/ior.h b/src/ior.h index 2ea6c05..e245b08 100755 --- a/src/ior.h +++ b/src/ior.h @@ -100,7 +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 tasksBlockMapping; /* are the tasks in contiguous blocks across nodes or round-robin */ int repetitions; /* number of repetitions of test */ int repCounter; /* rep counter */ int multiFile; /* multiple files */ diff --git a/src/mdtest.c b/src/mdtest.c index e35a20e..0005c0a 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -2067,11 +2067,13 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * VERBOSE(3,-1,"main (before display_freespace): testdirpath is '%s'", testdirpath ); if (rank == 0) display_freespace(testdirpath); - int packedByNode = QueryNodeMapping(testComm); + int tasksBlockMapping = QueryNodeMapping(testComm); /* set the shift to mimic IOR and shift by procs per node */ if (nstride > 0) { - if ( nodeCount > 1 && packedByNode ) { + if ( nodeCount > 1 && tasksBlockMapping ) { + /* the user set the stride presumably to get the consumer tasks on a different node than the producer tasks + however, if the mpirun scheduler placed the tasks by-slot (in a contiguous block) then we need to adjust the shift by ppn */ nstride *= tasksPerNode; } VERBOSE(0,5,"Shifting ranks by %d for each phase.", nstride);