I have written an algorithm that solves a problem in MPI and been doing some testing with varying number of processes. Interestingly NP 2 performs better than NP 4 or NP 1 which probably has to do with my implementation. What I would like to do is have a measurement of communication costs in the simplest form, perhaps a counter that is incremented++?
My question would be at which place in the code would I place the counter? Whenever the program calls MPI_SEND?
PS: I am aware of mpiP but I believe it would be overkill for this small project.