I'm new to open mpi and I'm currently studying the code and writing my own simple parallel test programs. I wrote a simple program to send and receive a character buffer using
MPI::COMM_WORLD.Send, MPI::COMM_WORLD.Recv function calls. After playing with some stupid parameters I could observe the following:
When I passed a buffer of length say 10, and set the receiving count to say 100, I could see that even the sending buffer (around 30 - 40) exceeds the receiving buffer, the characters were successfully copied. And at some points, after increasing these values, the receiving buffer started to show some garbage characters due to usage of unassigned memory. I took a look at the implementation and saw that opal_memchecker_base_isaddressable is used to check if the buffer is addressible and OMPI_WANT_MEMCHECKER is used as a flag too. But unfortunately I couldnt find the impl of opal_memchecker_base_isaddressable.
So my questions is, Do we have to set OMPI_WANT_MEMCHECKER in order to verify the recieving buffer internally? if it is, then shouldn't it be always done ?
I know its a stupid thing to burden these functions to do this since its up to the programmer to make the sanity checks or make sure not to feed up with wrong parameters, yet since it leaves to dangerous memory allocation/usage, doesn't it serve as a security threat ?
Pardon me if I misunderstood things since I'm still learning and testing with these codes...