Suppose I have two process A and B. A is sending some numbers to B. But B doesn't know how many. B is using MPI_Probe to probe about the number of items and then allocates a buffer to receive those numbers.
I am intercepting the send and receive calls in using PMPI interface. My goal is to reduce the network traffic. So I decide to compress the buffer A wanted to send by intercepting MPI_Send call. After compression, instead of sending the n bytes that A originally wanted to send, I am sending rn bytes. Where r is the compression ratio and r<1.
Since B is using MPI_Probe, B is seeing that the receive call was getting rn bytes and allocates buffer for rn bytes. But what I want to do is intercept the MPI_Recv and decompress rn bytes in n bytes and fill the buffer where B wanted those data.
Now my question is, how can I tell B that although I am sending rn bytes, I want it to allocate memory for n bytes? I don't have access to A or B's codes. All I can do is using the PMPI interface.