Skip to content

Commit 087761c

Browse files
committed
Fix a warning and other small cleanups.
1 parent 0333313 commit 087761c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

ompi/request/req_wait.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,13 @@ int ompi_request_default_wait_any(size_t count,
9090
ompi_wait_sync_t sync;
9191

9292
WAIT_SYNC_INIT(&sync, 1);
93-
93+
9494
num_requests_null_inactive = 0;
9595
for (i = 0; i < count; i++) {
9696
request = requests[i];
9797

98-
/*
99-
* Check for null or completed persistent request.
100-
* For MPI_REQUEST_NULL, the req_state is always OMPI_REQUEST_INACTIVE.
98+
/* Check for null or completed persistent request. For
99+
* MPI_REQUEST_NULL, the req_state is always OMPI_REQUEST_INACTIVE.
101100
*/
102101
if( request->req_state == OMPI_REQUEST_INACTIVE ) {
103102
num_requests_null_inactive++;
@@ -125,32 +124,33 @@ int ompi_request_default_wait_any(size_t count,
125124
SYNC_WAIT(&sync);
126125

127126
after_sync_wait:
128-
/* recheck the complete status and clean up the sync primitives. Do it backward to
129-
* return the earliest complete request to the user. */
127+
/* recheck the complete status and clean up the sync primitives.
128+
* Do it backward to return the earliest complete request to the
129+
* user.
130+
*/
130131
for(i = completed-1; (i+1) > 0; i--) {
131132
request = requests[i];
132133

133134
if( request->req_state == OMPI_REQUEST_INACTIVE ) {
134135
continue;
135136
}
136-
/* Atomically mark the request as pending. If this succeed then the
137-
* request was not completed, and it is now marked as pending. Otherwise,
138-
* the request has been completed meanwhile, and it has been atomically
139-
* marked as REQUEST_COMPLETE.
137+
/* Atomically mark the request as pending. If this succeed then
138+
* the request was not completed, and it is now marked as pending.
139+
* Otherwise, the request has been completed meanwhile, and it
140+
* has been atomically marked as REQUEST_COMPLETE.
140141
*/
141142
if( !OPAL_ATOMIC_CMPSET_PTR(&request->req_complete, &sync, REQUEST_PENDING) ) {
142143
*index = i;
143144
}
144145
}
145-
146-
if( *index == completed ){
147-
/* Only one request has triggered. There was no
148-
* in-flight completions.
149-
* Drop the signalled flag so we won't block
146+
147+
if( *index == (int)completed ) {
148+
/* Only one request has triggered. There was no in-flight
149+
* completions. Drop the signalled flag so we won't block
150150
* in WAIT_SYNC_RELEASE
151151
*/
152152
WAIT_SYNC_SIGNALLED(&sync);
153-
}
153+
}
154154

155155
request = requests[*index];
156156
assert( REQUEST_COMPLETE(request) );

0 commit comments

Comments
 (0)