Skip to content

Commit efdb534

Browse files
committed
Fix some typos and trailing spaces
Signed-off-by: Keluaa <34173752+Keluaa@users.noreply.github.com>
1 parent 35ef2b2 commit efdb534

File tree

1 file changed

+29
-34
lines changed

1 file changed

+29
-34
lines changed

ompi/mca/part/persist/part_persist.h

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct ompi_part_persist_t {
7474
unused in part_comm. */
7575
ompi_request_t *part_comm_sreq;
7676
int32_t part_comm_sready;
77-
int32_t init_comms;
77+
int32_t init_comms;
7878
int32_t init_world;
7979
int32_t my_world_rank; /* Because the back end communicators use a world rank, we need to communicate ours
8080
to set up the requests. */
@@ -138,12 +138,12 @@ __opal_attribute_always_inline__ static inline void
138138
mca_part_persist_complete(struct mca_part_persist_request_t* request)
139139
{
140140
if(MCA_PART_PERSIST_REQUEST_PRECV == request->req_type) {
141-
request->req_ompi.req_status.MPI_SOURCE = request->req_peer;
141+
request->req_ompi.req_status.MPI_SOURCE = request->req_peer;
142142
} else {
143143
request->req_ompi.req_status.MPI_SOURCE = request->req_comm->c_my_rank;
144144
}
145145
request->req_ompi.req_complete_cb = NULL;
146-
request->req_ompi.req_status.MPI_TAG = request->req_tag;
146+
request->req_ompi.req_status.MPI_TAG = request->req_tag;
147147
request->req_ompi.req_status._ucount = request->req_bytes;
148148
request->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
149149
request->req_part_complete = true;
@@ -189,7 +189,6 @@ mca_part_persist_progress(void)
189189
if(OMPI_SUCCESS != err) goto end_part_progress;
190190
ompi_part_persist.part_comm_sready = 0;
191191
ompi_part_persist.init_world = 1;
192-
193192
completed++;
194193
goto end_part_progress;
195194
}
@@ -214,16 +213,16 @@ mca_part_persist_progress(void)
214213
OPAL_LIST_FOREACH(current, ompi_part_persist.progress_list, mca_part_persist_list_t) {
215214
mca_part_persist_request_t *req = (mca_part_persist_request_t *) current->item;
216215

217-
/* Check to see if request is initilaized */
216+
/* Check to see if request is initialized */
218217
if(false == req->initialized) {
219-
int done = 0;
220-
218+
int done = 0;
219+
221220
if(true == req->flag_post_setup_recv) {
222221
err = MCA_PML_CALL(irecv(&(req->setup_info[1]), sizeof(struct ompi_mca_persist_setup_t), MPI_BYTE, OMPI_ANY_SOURCE, req->my_recv_tag, ompi_part_persist.part_comm_setup, &req->setup_req[1]));
223222
if(OMPI_SUCCESS != err) goto end_part_progress;
224223
req->flag_post_setup_recv = false;
225-
}
226-
224+
}
225+
227226
err = ompi_request_test(&(req->setup_req[1]), &done, MPI_STATUS_IGNORE);
228227
if(OMPI_SUCCESS != err) goto end_part_progress;
229228

@@ -233,7 +232,7 @@ mca_part_persist_progress(void)
233232

234233
if(MCA_PART_PERSIST_REQUEST_PSEND == req->req_type) {
235234
/* parse message */
236-
req->world_peer = req->setup_info[1].world_rank;
235+
req->world_peer = req->setup_info[1].world_rank;
237236

238237
err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_);
239238
if(OMPI_SUCCESS != err) goto end_part_progress;
@@ -246,24 +245,22 @@ mca_part_persist_progress(void)
246245
void *buf = ((void*) (((char*)req->req_addr) + (bytes * i)));
247246
err = MCA_PML_CALL(isend_init(buf, req->real_count, req->req_datatype, req->world_peer, req->my_send_tag+i, MCA_PML_BASE_SEND_STANDARD, ompi_part_persist.part_comm, &(req->persist_reqs[i])));
248247
if(OMPI_SUCCESS != err) goto end_part_progress;
249-
}
248+
}
250249
} else {
251250
/* parse message */
252-
req->world_peer = req->setup_info[1].world_rank;
251+
req->world_peer = req->setup_info[1].world_rank;
253252
req->my_send_tag = req->setup_info[1].start_tag;
254253
req->my_recv_tag = req->setup_info[1].setup_tag;
255254
req->real_parts = req->setup_info[1].num_parts;
256255
req->real_count = req->setup_info[1].count;
257256
req->real_dt_size = req->setup_info[1].dt_size;
258257

259-
260258
err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_);
261259
if(OMPI_SUCCESS != err) goto end_part_progress;
262260
dt_size = (dt_size_ > (size_t) UINT_MAX) ? MPI_UNDEFINED : (uint32_t) dt_size_;
263261
uint32_t bytes = req->real_count * dt_size;
264262

265-
266-
/* Set up persistent sends */
263+
/* Set up persistent receives */
267264
req->persist_reqs = (ompi_request_t**) malloc(sizeof(ompi_request_t*)*(req->real_parts));
268265
req->flags = (int*) calloc(req->real_parts,sizeof(int));
269266
if(req->real_dt_size == dt_size) {
@@ -293,10 +290,9 @@ mca_part_persist_progress(void)
293290
}
294291
} else {
295292
if(false == req->req_part_complete && REQUEST_COMPLETED != req->req_ompi.req_complete && OMPI_REQUEST_ACTIVE == req->req_ompi.req_state) {
296-
for(i = 0; i < req->real_parts; i++) {
297-
298-
/* Check to see if partition is queued for being started. Only applicable to sends. */
299-
if(-2 == req->flags[i]) {
293+
for(i = 0; i < req->real_parts; i++) {
294+
/* Check to see if partition is queued for being started. Only applicable to sends. */
295+
if(-2 == req->flags[i]) {
300296
err = req->persist_reqs[i]->req_start(1, (&(req->persist_reqs[i])));
301297
if(OMPI_SUCCESS != err) goto end_part_progress;
302298
req->flags[i] = 0;
@@ -343,7 +339,7 @@ mca_part_persist_progress(void)
343339

344340
__opal_attribute_always_inline__ static inline int
345341
mca_part_persist_precv_init(void *buf,
346-
size_t parts,
342+
size_t parts,
347343
size_t count,
348344
ompi_datatype_t * datatype,
349345
int src,
@@ -374,9 +370,9 @@ mca_part_persist_precv_init(void *buf,
374370

375371
mca_part_persist_request_t *req = (mca_part_persist_request_t *) recvreq;
376372

377-
/* Set lazy initializion flags */
373+
/* Set lazy initialization flags */
378374
req->initialized = false;
379-
req->first_send = true;
375+
req->first_send = true;
380376
req->flag_post_setup_recv = false;
381377
req->flags = NULL;
382378
/* Non-blocking receive on setup info */
@@ -398,7 +394,7 @@ mca_part_persist_precv_init(void *buf,
398394
/* Add element to progress engine */
399395
new_progress_elem = OBJ_NEW(mca_part_persist_list_t);
400396
new_progress_elem->item = req;
401-
req->progress_elem = new_progress_elem;
397+
req->progress_elem = new_progress_elem;
402398
OPAL_THREAD_LOCK(&ompi_part_persist.lock);
403399
opal_list_append(ompi_part_persist.progress_list, (opal_list_item_t*)new_progress_elem);
404400
OPAL_THREAD_UNLOCK(&ompi_part_persist.lock);
@@ -441,7 +437,6 @@ mca_part_persist_psend_init(const void* buf,
441437
/* Set lazy initialization variables */
442438
req->initialized = false;
443439
req->first_send = true;
444-
445440

446441
/* Determine total bytes to send. */
447442
err = opal_datatype_type_size(&(req->req_datatype->super), &dt_size_);
@@ -451,7 +446,7 @@ mca_part_persist_psend_init(const void* buf,
451446

452447
/* non-blocking send set-up data */
453448
req->setup_info[0].world_rank = ompi_comm_rank(&ompi_mpi_comm_world.comm);
454-
req->setup_info[0].start_tag = ompi_part_persist.next_send_tag; ompi_part_persist.next_send_tag += parts;
449+
req->setup_info[0].start_tag = ompi_part_persist.next_send_tag; ompi_part_persist.next_send_tag += parts;
455450
req->my_send_tag = req->setup_info[0].start_tag;
456451
req->setup_info[0].setup_tag = ompi_part_persist.next_recv_tag; ompi_part_persist.next_recv_tag++;
457452
req->my_recv_tag = req->setup_info[0].setup_tag;
@@ -475,7 +470,7 @@ mca_part_persist_psend_init(const void* buf,
475470
req->flag_post_setup_recv = true;
476471
}
477472

478-
/* Initilaize completion variables */
473+
/* Initialize completion variables */
479474
sendreq->req_base.req_ompi.req_persistent = true;
480475
req->req_part_complete = true;
481476
req->req_ompi.req_complete = REQUEST_COMPLETED;
@@ -522,15 +517,15 @@ mca_part_persist_start(size_t count, ompi_request_t** requests)
522517
}
523518
} else {
524519
req->done_count = 0;
525-
}
526-
}
527-
req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
520+
}
521+
}
522+
req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
528523
req->req_ompi.req_status.MPI_TAG = MPI_ANY_TAG;
529524
req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
530525
req->req_ompi.req_status._cancelled = 0;
531526
req->req_part_complete = false;
532527
req->req_ompi.req_complete = false;
533-
OPAL_ATOMIC_SWAP_PTR(&req->req_ompi.req_complete, REQUEST_PENDING);
528+
OPAL_ATOMIC_SWAP_PTR(&req->req_ompi.req_complete, REQUEST_PENDING);
534529
}
535530

536531
return err;
@@ -564,7 +559,7 @@ mca_part_persist_pready(size_t min_part,
564559
__opal_attribute_always_inline__ static inline int
565560
mca_part_persist_parrived(size_t min_part,
566561
size_t max_part,
567-
int* flag,
562+
int* flag,
568563
ompi_request_t* request)
569564
{
570565
int err = OMPI_SUCCESS;
@@ -576,7 +571,7 @@ mca_part_persist_parrived(size_t min_part,
576571
_flag = 1;
577572
if(req->req_parts == req->real_parts) {
578573
for(i = min_part; i <= max_part; i++) {
579-
_flag = _flag && req->flags[i];
574+
_flag = _flag && req->flags[i];
580575
}
581576
} else {
582577
float convert = ((float)req->real_parts) / ((float)req->req_parts);
@@ -590,7 +585,7 @@ mca_part_persist_parrived(size_t min_part,
590585

591586
if(!_flag) {
592587
opal_progress();
593-
}
588+
}
594589
*flag = _flag;
595590
return err;
596591
}
@@ -614,4 +609,4 @@ mca_part_persist_free(ompi_request_t** request)
614609

615610
END_C_DECLS
616611

617-
#endif /* PART_PERSIST_H_HAS_BEEN_INCLUDED */
612+
#endif /* PART_PERSIST_H */

0 commit comments

Comments
 (0)