mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -


i trying implement logical ring mpi; every process receives message process id 1 less of current process , forwards next process in cyclic fashion. aim traffic buffer such loses messages or maybe puts them in out of order.
cycle of communication finish when message dispatched root node comes again root.
here code have tried: including relevant parts of it.

if(procid!=root) {     sleep(100);     while(1)     {         tm = mpi_wtime();         mpi_irecv( &message, str_len, mpi_char,                 ((procid-1)>=0?(procid-1):(numproc-1)),return_data_tag,                 mpi_comm_world,&receiverequest);          mpi_wait(&receiverequest,&status);         printf("%d: received\n",procid);          if(!strncmp(message,"stop",4)&&(procid==(numproc-1)))             break;          mpi_ssend( message, str_len, mpi_char,                 (procid+1)%numproc, send_data_tag, mpi_comm_world);         if(!strncmp(message,"stop",4))             break;         printf("%d: sent\n",procid);     } } else {     for(iter=0;iter<benchmarksize;iter++)     {         //synthesize message         message[str_len-1] = '\0';         ierr = mpi_bsend( message, str_len, mpi_char,                 (root+1)%numproc, send_data_tag, mpi_comm_world);         if (ierr != mpi_success) {             char error_string[bufsiz];             int length_of_error_string;             mpi_error_string(ierr, error_string, &length_of_error_string);             fprintf(stderr, "%3d: %s\n", procid, error_string);         }          tm = mpi_wtime();         while(((mpi_wtime()-tm)*1000)<delay);         printf("root: sending\n");     }     for(iter=0;iter<benchmarksize;iter++)     {         mpi_recv(message,str_len,mpi_char,                 (numproc-1),return_data_tag,mpi_comm_world,&status);          //we should not wait messages received wait amount of time          //extract fields in message         if(((prevrcvdseqnum+1)!=atoi(seqnum))&&(prevrcvdseqnum!=0))             outofordermsgs++;         prevrcvdseqnum = atoi(seqnum);         printf("seq num: %d\n",atoi(seqnum));         rcvdmsgs++;         printf("root: receiving\n");     }     mpi_isend( "stop", 4, mpi_char,             (root+1)%numproc, send_data_tag, mpi_comm_world,&sendrequest);     mpi_wait(&sendrequest,&status);      /*this ask other processes terminate, when work done*/ } 

now, have these questions: 1) why when inject sleep in other processes(i mean other root) of ring; no receive taking place?
2) when buffer size one, how root node able dispatch messages through mpi_bsend without error? example case when needs send total 10 messages @ rate of 1000 per second , buffer size of 1. mpi_bsend able dispatch messages without error of "buffer full"; irrespective of presence of sleep() in other processes of ring! ton!


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -