ryta1203

Passing streams between Kernels in Brook+

Discussion created by ryta1203 on Jan 8, 2009
Latest reply on Jan 8, 2009 by ryta1203
The way I understood it, or the way it was explained to me was that you have to ping pong due to the stream model.

What is wrong with this?:

streamRead(Fs1to4_1, F1to4);
streamRead(Fs5to8_1, F5to8);
streamRead(Fs9_1, F9);
mcollid_s(Fs1to4_1, Fs5to8_1, Fs9_1, fs1to4_1, fs5to8_1, fs9_1, GEOs, ss, G, Fs9_2, Fs5to8_2, Fs1to4_2);
advection1_s(Fs1to4_2, Fs5to8_2, Fs9_2, GEOs, es, gx, gy, mx, my, rs, Fs9_1, Fs5to8_1, Fs1to4_1);
streamWrite(Fs9_1, F9);
streamWrite(Fs1to4_1, F1to4);
streamWrite(Fs5to8_1, F5to8);


advection1_s does nothing at the moment. I get garbage for a result. However, if I do this:


streamRead(Fs1to4_1, F1to4);
streamRead(Fs5to8_1, F5to8);
streamRead(Fs9_1, F9);
mcollid_s(Fs1to4_1, Fs5to8_1, Fs9_1, fs1to4_1, fs5to8_1, fs9_1, GEOs, ss, G, Fs9_2, Fs5to8_2, Fs1to4_2);
streamWrite(Fs9_2, F9);
streamWrite(Fs1to4_2, F1to4);
streamWrite(Fs5to8_2, F5to8);

Then I get the proper results. How do you "ping pong" in Brook+? I need to be able to send streams from one kernel to the next (output to input) without going back to the CPU (as this would be terribly slow and would make a GPU solution irrelevant).

Thanks in advance.

Outcomes