Ejemplos MPI
Ejemplos MPI Ejemplos MPI
• /**************************** 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
- Page 1 and 2: Ejemplo MPI Ivar Fernando Gómez Pe
- Page 3 and 4: • la multiplicación de A por B,
- Page 5 and 6: Procedimiento secuencial Un solo pr
- Page 7 and 8: Proceso en el MAESTRO • Conocer l
- Page 9 and 10: Fase de envío: MPI_send Fase recep
- Page 11 and 12: Código en MPI • Se colocan las l
- Page 13 and 14: MPI_Init(&argc,&argv); MPI_Comm_ran
- Page 15 and 16: • /* Send matrix data to the work
- Page 17: • /* Print results */ • printf(
• /**************************** 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