I am trying to find a proper way to collect values returned from slaves to the master in parallel programming. I had asked similar question earlier on how to divide work to calculate pixel of mandelbrot. I got the answer to how to send the work but am still struggling on how to gather the data and plot it as pixel.
node 0: (master)
node 1:(slave)
v[0] = {2,3,4,5,67,86,56,5} // core 0 holds value of 8 threads of this core
v[1] = {12,21,4,3,54,65,6,5,4} // core 1 holds value of 9 threads of this core
v[2] = {1,3,4,54,6,5,65,7,4} //core 2 holds value of 9 threads of this core
node 2:(slave)
v[0] = {2,3,4,5,67,86,56,5} // core 0
v[1] = {12,21,4,3,54,65,6,5,4} // core 1
v[2] = {1,3,4,54,6,5,65,7,4} //core 2
node 3:(slave)
v[0] = {2,3,4,5,67,86,56,5} // core 0
v[1] = {12,21,4,3,54,65,6,5,4} // core 1
v[2] = {1,3,4,54,6,5,65,7,4} //core 2
so when master want those value should the slave append the vector and send or is there any other better way to pass values to the master?