Esqueleto Algorítmico - ulpgc
Esqueleto Algorítmico - ulpgc
Esqueleto Algorítmico - ulpgc
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Implementación Secuencial y Paralela de Técnicas Algorítmicas:<br />
Aplicación a Problemas de Optimización Combinatoria<br />
Seminario Invitado: Dpto Métodos Cuantitativos en Economía y Gestión<br />
Introducción<br />
Interfaz de Usuario<br />
Patrones<br />
Secuenciales<br />
Patrones<br />
Paralelos<br />
Experimentos<br />
Computacionales<br />
Conclusiones<br />
Patrón B&B Paralelo<br />
Centralizado<br />
Patrón B&B Paralelo<br />
Distribuido<br />
Patrón B&B Memoria<br />
Compartida<br />
Patrón D&C Paralelo<br />
Mª Isabel Dorta González<br />
Marzo, 2007<br />
Código MPI Distribuido de MaLLBa:BnB: Esclavo<br />
1 while (1) {<br />
2 recv(source, flag);<br />
3 while (flag) {<br />
4 if (END_TAG){ // receive the finishing message<br />
5 ip.recv(MASTER, END); return;<br />
6 }<br />
7 if (PBM_TAG){ // receive the problem to be branched<br />
8 ip.recv(source, // receive from a slave or the Master:<br />
9 auxSp, // the initial subproblem<br />
10 bestSol, // the best solution value<br />
11 sol); // the current solution<br />
12 auxSol = sol;<br />
13 bqueue.insert(auxSp); // insert it in the local queue<br />
14 while(!bqueue.empty()) {<br />
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .<br />
37 }<br />
38 op.send(MASTER, IDLE_TAG); // send the signal Idle<br />
39 }<br />
40 recv(source, flag);<br />
41 } // while (flag)<br />
42 } // while(1)