Fix use of uninitialized variable - localhost.
parent
c0c1f38a51
commit
b33ff9d65c
14
src/ior.c
14
src/ior.c
|
@ -471,13 +471,6 @@ static int CountTasksPerNode(int numTasks, MPI_Comm comm)
|
|||
unsigned flag;
|
||||
int rc;
|
||||
|
||||
if (verbose >= VERBOSE_2 && firstPass) {
|
||||
char tmp[MAX_STR];
|
||||
sprintf(tmp, "task %d on %s", rank, localhost);
|
||||
OutputToRoot(numTasks, comm, tmp);
|
||||
firstPass = FALSE;
|
||||
}
|
||||
|
||||
rc = gethostname(localhost, MAX_STR);
|
||||
if (rc == -1) {
|
||||
/* This node won't match task 0's hostname...expect in the
|
||||
|
@ -489,6 +482,13 @@ static int CountTasksPerNode(int numTasks, MPI_Comm comm)
|
|||
perror("gethostname() failed");
|
||||
}
|
||||
|
||||
if (verbose >= VERBOSE_2 && firstPass) {
|
||||
char tmp[MAX_STR];
|
||||
sprintf(tmp, "task %d on %s", rank, localhost);
|
||||
OutputToRoot(numTasks, comm, tmp);
|
||||
firstPass = FALSE;
|
||||
}
|
||||
|
||||
/* send task 0's hostname to all tasks */
|
||||
if (rank == 0)
|
||||
strcpy(hostname0, localhost);
|
||||
|
|
Loading…
Reference in New Issue