Ejemplos MPI

Ejemplos MPI Ejemplos MPI

grid.uis.edu.co
from grid.uis.edu.co More from this publisher
28.10.2014 Views

• /**************************** worker task ************************************/ • if (taskid > MASTER) • { • mtype = FROM_MASTER; • MPI_Recv(&offset, 1, MPI_INT, MASTER, mtype, MPI_COMM_WORLD, &status); • MPI_Recv(&rows, 1, MPI_INT, MASTER, mtype, MPI_COMM_WORLD, &status); • MPI_Recv(&a, rows*NCA, MPI_DOUBLE, MASTER, mtype, MPI_COMM_WORLD, &status); • MPI_Recv(&b, NCA*NCB, MPI_DOUBLE, MASTER, mtype, MPI_COMM_WORLD, &status); • for (k=0; k

• /**************************** worker task ************************************/<br />

• if (taskid > MASTER)<br />

• {<br />

• mtype = FROM_MASTER;<br />

• <strong>MPI</strong>_Recv(&offset, 1, <strong>MPI</strong>_INT, MASTER, mtype, <strong>MPI</strong>_COMM_WORLD, &status);<br />

• <strong>MPI</strong>_Recv(&rows, 1, <strong>MPI</strong>_INT, MASTER, mtype, <strong>MPI</strong>_COMM_WORLD, &status);<br />

• <strong>MPI</strong>_Recv(&a, rows*NCA, <strong>MPI</strong>_DOUBLE, MASTER, mtype, <strong>MPI</strong>_COMM_WORLD, &status);<br />

• <strong>MPI</strong>_Recv(&b, NCA*NCB, <strong>MPI</strong>_DOUBLE, MASTER, mtype, <strong>MPI</strong>_COMM_WORLD, &status);<br />

• for (k=0; k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!