There was a problem with different processes accepting different number of samples. This was due to the uni random number u was different for each process. Now I distribute u to every process.