Hi!

I am implementing bmi method. Can anyone explain how works immediate completion 
with post_recv?
Here is excerpt from bmi-design.pdf (can be found in 
path_to_pvfs2_src/doc/design):

We therefore allow immediate completion from any post function. Immediate 
completion is indicated from post functions
by a return value of one. BMI library users should always check this return 
value so that they are aware of
opportunities to skip the test phase of communication.

but if we look sources (bmi.c from line 668):

 /** Submits receive operations for subsequent service.
 *
 * \return 0 on success, -errno on failure.
 */ 
int BMI_post_recv(bmi_op_id_t *id, ...)
{
     <...>
   *id = 0;
    <...>
    ret = tmp_ref->interface->post_recv(id, ...);
    return (ret);
}

and in test /tests/io/bmi/pingpong.c(in do_client() from line 491):

 /* post a recv for the ack */ 
  ret = BMI_post_recv(&(op_id[RECV]), ...);
 if (ret < 0) {
 fprintf(stderr, "BMI_post_recv_failure.\n");
 return (-1);
 } else if (ret == 0) {
 do {
 ret = BMI_test(op_id[RECV], &outcount, &error_code,
 &actual_size, NULL, 10, *context);
 } while (ret == 0 && outcount == 0);

 if (ret < 0 || error_code != 0) {
 fprintf(stderr, "data recv failed.\n");
 return (-1);
 }
 if (actual_size != msg_len) {
 fprintf(stderr, "Expected %d but received %llu\n",
 msg_len, llu(actual_size));
 return (-1);
 }
 }
work with received data here. no checking for received data. 

Is that means BMI_post_recv can't complete immediate? 

Thanks,
Mikhail Gilmendinov
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to