Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
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
10 changes: 6 additions & 4 deletions ompi/group/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (c) 2012-2013 Inria. All rights reserved.
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -453,9 +453,11 @@ int ompi_group_intersection(ompi_group_t* group1,ompi_group_t* group2,

k = 0;
/* allocate the max required memory */
ranks_included = (int *)malloc(group1_pointer->grp_proc_count*(sizeof(int)));
if (NULL == ranks_included) {
return MPI_ERR_NO_MEM;
if (0 < group1_pointer->grp_proc_count) {
ranks_included = (int *)malloc(group1_pointer->grp_proc_count*(sizeof(int)));
if (NULL == ranks_included) {
return MPI_ERR_NO_MEM;
}
}
/* determine the list of included processes for the incl-method */
k = 0;
Expand Down