Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions ompi/mpi/c/win_shared_query.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* Copyright (c) 2015-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand Down Expand Up @@ -39,7 +39,7 @@ int MPI_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, int *disp_unit,

if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_WIN, FUNC_NAME);
} else if (ompi_win_peer_invalid(win, rank)) {
} else if (MPI_PROC_NULL != rank && ompi_win_peer_invalid(win, rank)) {
return OMPI_ERRHANDLER_INVOKE(win, MPI_ERR_RANK, FUNC_NAME);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ompi/win/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static inline int ompi_win_invalid(ompi_win_t *win) {
}

static inline int ompi_win_peer_invalid(ompi_win_t *win, int peer) {
if (win->w_group->grp_proc_count <= peer) return true;
if (win->w_group->grp_proc_count <= peer || peer < 0) return true;
return false;
}

Expand Down