Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ior-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
void PrintHeader(int argc, char **argv);
void ShowTestStart(IOR_param_t *params);
void ShowTestEnd(IOR_test_t *tptr);
void ShowTaskToProcessor(IOR_param_t *params);
void ShowSetup(IOR_param_t *params);
void PrintRepeatEnd();
void PrintRepeatStart();
Expand Down
48 changes: 48 additions & 0 deletions src/ior-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,54 @@ void ShowTestEnd(IOR_test_t *tptr){
PrintEndSection();
}

/*
* Show the processor assigned to each task in rank order.
*/
void ShowTaskToProcessor(IOR_param_t *params)
{
char processor[MAX_STR];
int processorLen = MAX_STR;
char task[MAX_STR];

MPI_CHECK(MPI_Get_processor_name(processor, &processorLen),
"cannot get processor name");

if (rank > 0) {
/* wait for the previous rank to signal us */
MPI_CHECK(MPI_Recv(NULL, 0, MPI_BYTE, rank - 1, 0,
params->testComm, MPI_STATUS_IGNORE), "recv error");

/* send our processor assignment to rank 0 */
MPI_CHECK(MPI_Send(processor, processorLen, MPI_CHAR, 0, 1,
params->testComm), "send error");
}

if (rank < params->numTasks - 1) {
/* signal the next rank */
MPI_CHECK(MPI_Send(NULL, 0, MPI_BYTE, rank + 1, 0,
params->testComm), "send error");
}

if (rank == 0) {
PrintNamedSectionStart("TaskToProcessor");

/* print our own processor assignment */
PrintKeyVal("0", processor);

/* receive all the processor assignments from the other ranks and print them out */
for(int i = 1; i < params->numTasks; ++i)
{
MPI_CHECK(MPI_Recv(processor, MAX_STR, MPI_CHAR, i, 1,
params->testComm, MPI_STATUS_IGNORE), "recv error");
sprintf(task, "%d", i);
PrintKeyVal(task, processor);
}
PrintEndSection();
}

MPI_CHECK(MPI_Barrier(params->testComm), "barrier error");
}

/*
* Show simple test output with max results for iterations.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ static void TestIoSys(IOR_test_t *test)
void *hog_buf;
IOR_io_buffers ioBuffers;

/* show the processor assigned to each task in rank order */
if (verbose >= VERBOSE_2)
ShowTaskToProcessor(params);

/* show test setup */
if (rank == 0 && verbose >= VERBOSE_0)
ShowSetup(params);
Expand Down