Merge pull request #169 from ax3l/fix-singleRankHeapBufferOverflow

Fix: Heap Buffer Overflow
master
Julian Kunkel 2019-08-03 09:20:15 +01:00 committed by GitHub
commit da5f091afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -257,7 +257,9 @@ int QueryNodeMapping(MPI_Comm comm, int print_nodemap) {
}
fprintf( out_logfile, "\n" );
}
int ret = node_map[1] == 1;
int ret = 1;
if(num_ranks>1)
ret = node_map[1] == 1;
MPI_Bcast(&ret, 1, MPI_INT, 0, comm);
free(node_map);
return ret;