INSTITUTO POLITÉCNICO NACIONAL CENTRO DE INVESTIGACIÓN EN COMPUTACIÓN SIMULACIÓN DE UN FLUJO SUPERSÓNICO CON METODOLOGÍA PARALELA ORIENTADA A OBJETOS T E S I S QUE PARA OBTENER EL GRADO DE MAESTRO EN CIENCIAS DE LA COMPUTACIÓN P R E S E N T A EL LIC. CARLOS COUDER CASTAÑEDA DIRECTOR DE TESIS: Dr. BÁRBARO JORGE FERRO CASTRO CODIRECTOR DE TESIS: Dr. AGUSTÍN F. GUTIÉRREZ TORNÉS MÉXICO, D.F., AGOSTO 2003
INSTITUTO POLITÉCNICO NACIONAL COORDINACIÓN GENERAL DE POSGRADO E INVESTIGACIÓN CARTA CESIÓN DE DERECHOS En la Ciudad de México, D.F. el día 24 del mes Noviembre del año 2003, el (la) que suscribe Lic. Carlos Couder Castañeda alumno (a) del Programa de Maestría en Ciencias de la Computación con número de registro B991214, adscrito a CIC-IPN, manifiesta que es autor (a) intelectual del presente trabajo de Tesis bajo la dirección de Dr. Bárbaro Jorge Ferro Castro y cede los derechos del trabajo intitulado SIMULACIÓN DE UN FLUJO SUPERSÓNICO CON METODOLOGÍA PARALELA ORIENTADA A OBJETOS, al Instituto Politécnico Nacional para su difusión, con fines académicos y de investigación. Los usuarios de la información no deben reproducir el contenido textual, gráfica o datos del trabajo sin el permiso expreso de autor y/o director de trabajo. Este puede ser obtenido escribiendo a la siguiente dirección ccouder@esfm.ipn.mx. Si el permiso se otorga, el usuario deberá dar el agradecimiento correspondiente y citar la fuente del mismo. Nombre y Firma
Al creador de la vida y dueño del conocimiento, por haberme dado salud y voluntad para llegar hasta aquí A mi hermano, Vito A mis hermanas, Karla y Karina A mamá Malena y papá Nacho A mis Tíos, Primos y Sobrinos que hacen de la familia un mejor concepto A mi madre, Celia A mi padre, Luciano
JAVA
JAVA
CONTENIDO
CONTENIDO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
LISTA DE FIGURAS 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 x 52 y 53 54 (ρ) 3 55 (T ) 56 (p) 3
LISTA DE FIGURAS 57 x 58 (M =3.0) 59 (M =4.0) 1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 x = 200.21 10 x = 388.65 1
INTRODUCCIÓN C++ Pascal Smalltalk
INTRODUCCIÓN JAVA JAVA JVM
INTRODUCCIÓN JPVM
INTRODUCCIÓN C PASCAL
INTRODUCCIÓN JAVA F x = J G y,
INTRODUCCIÓN JAVA U t + F x + F y = J, JPVM JPVM JPVM
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS 1 Proceso 1 Proceso 2 Proceso 3 Figura 1.1-F 1. Procesos disjuntos 2 Proceso 1 Proceso 2 Proceso 3 Figura 1.1-F 2. Procesos cooperativos
1.1. PROGRAMACIÓN PARALELA IPC 3 IPC IPC
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS un solo hilo un solo hilo múltiples hilos IPC Figura 1.1-F 3. Hilos de ejecución 4
1.1. PROGRAMACIÓN PARALELA Procesos Figura 1.1-F 4. Paralelismo temporal Tiempo 5 Procesos Figura 1.1-F 5. Paralelismo real Tiempo
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS FORTRAN PASCAL C ADA
1.2. SISTEMAS PARALELOS MPI x y MPI 6
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS P P P P Cache Cache Cache Cache BUS Memoria Global Figura 1.2-F 6. Memoria compartida 7 RED P P P P Cache Cache Cache Cache Memoria Memoria Memoria Memoria Figura 1.2-F 7. Memoria distribuida
1.2. SISTEMAS PARALELOS 2 1, 3 1 k k
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS
1.3. MÉTRICAS DEL DESEMPEÑO PARA PROGRAMAS PARALELOS Gr = t comp, t comm t comp t comm Gr = t comp t comm. S(n) S (n) = t s t p t s t p n S(n) S (n) = Número de pasos computacionales utilizando un procesador Número de pasos computacionales utilizando varios procesadores
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS S(n) n n S(n) = t s t sn = n 8 Tarea 1 Tarea 2 Tarea 3 La inclinación indica el tiempo que tarda el mensaje en llegar Tarea 4 Esperando para enviar un mensaje Mensaje Figura 1.3-F 8. Sobrecarga f t p n t p = ft s + (1 f) t s. n
1.3. MÉTRICAS DEL DESEMPEÑO PARA PROGRAMAS PARALELOS S (n) S(n) = = t s ft s + (1 f)t s n n 1+(n 1) f. 9 ( a) Un procesador f t s Sección serial t s 1 f t s Sección paralelizable ( b) Múltiples procesadores n procesadores 1 f t s / n t p Figura 1.3-F 9. Ley de Amdahl 10 S(n) f 1 f lim S(n) = 1 n f.
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS Sn ( 20 ) 18 16 14 f = 0.0 12 10 8 6 4 2 f = 0.05 f = 0.10 f = 0.20 0 0 2 4 6 8 10 12 14 16 18 20 Número de procesadores Figura 1.3-F 10. Speedup contra número de procesadores n E, E = t s t p n, E = S(n) n 100 %. E =50% Costo = tiempo ejecución número de procesadores
1.3. MÉTRICAS DEL DESEMPEÑO PARA PROGRAMAS PARALELOS t s t p n t p t p = t s S(n). Costo = t sn S(n) = t s E s q 1 s + q =1
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS S(n) = s + q s + q n 1 = s + 1 s n p 1, s + p =1, s + pn, n S(n) = s + pn s + p = s + np = n +(1 n)s. 5%, s =0.05 p =0.95. S (20) = 20 + (1 20) (0.05) = 19.05, S (20) = 20 1 + (20 1) (0.05) = 10.256
1.4. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS 11 Procesador 1 Procesador 2 Canal Objeto Mensaje Objeto Figura 1.4-F 11. Objetos y mensajes
1.4. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS
1.4. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS C++
CAPÍTULO 1. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS programa = estructura de datos + algoritmos TDA = encapsulamiento(estructuras de datos + algoritmos)
1.4. PROGRAMACIÓN PARALELA ORIENTADA A OBJETOS Objeto = TDA + Herencia Actor = Objeto + Proceso
5 10 8 200 10 11 7 1 10 4
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA 10 15 100 10 8 10 7 100 10 1.7 1.7 10 12 SMP
2.1. MULTICOMPUTADORA canal x tarea 12 Interconexión Figura 2.1-F 12. Multicomputadora
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA
2.2. PASO DE MENSAJES 13 MPI Red Memoria Proceso Figura 2.2-F 13. Modelo de paso de mensajes 14
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA Red Proceso Memoria compartida Figura 2.2-F 14. Modelo de clusters
2.3. LA MÁQUINA VIRTUAL PARALELA PVM PVM C FORTRAN PVM MPI PVM C FORTRAN
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA PVM PVM 15 PVM PVM daemon Aplicación PVM daemon PVM daemon Aplicación Aplicación Figura 2.3-F 15. Paso de mensajes entre computadoras usando la PVM PVM 16
2.3. LA MÁQUINA VIRTUAL PARALELA PVM daemon PVM daemon PVM daemon Figura 2.3-F 16. Múltiples procesos ejecutándose en cada computadora (Modelo de Clusters) JAVA JAVA PVM PVM UNIX NT
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA PVM JAVA JAVA JAVA API JAVA PVM PVM JAVA JAVA JPVM
2.3. LA MÁQUINA VIRTUAL PARALELA UNIX Macintosh Windows NT JPVM PVM JAVA PVM JPVM JAVA JPVM jpvmenviroment JPVM jpvmenviroment jpvmtaskid PVM JPVM jpvmenviorment jpvmenviroment pvm_mytid() JPVM pvm_exit() jpvmenviroment class jpvmenviroment{ public jpvmenviroment(); // Constructor
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA public void pvm_exit(); // Identificación public jpvmtaskid pvm_mytid(); public jpvmtaskid pvm_parent(); // Creación de Tareas public int pvm_spawn(string task_name, int num, jpvmtaskid tids[]); // Envío de mensajes public void pvm_send(jpvmbuffer buf, jpvmtaskid tid, int tag); public void pvm_mcast(jpvmbuffer buf, jpvmtaskid tids[], int ntids, int tag); // Recepción de mensajes public jpvmmessage pvm_recv(jpvmtaskid tid, int tag); public jpvmmessage pvm_recv(jpvmtaskid tid); public jpvmmessage pvm_recv(int tag); public jpvmmessage pvm_recv(); // Probar disponibilidad de mensajes public jpvmmessage pvm_probe(jpvmtaskid tid, int tag); public jpvmmessage pvm_probe(jpvmtaskid tid); public jpvmmessage pvm_probe(int tag); public jpvmmessage pvm_probe(); }; // Configuración y control del sistema public jpvmconfiguration pvm_config(); public jpvmtaskstatus pvm_tasks(jpvmconfiguration conf, int which); public void pvm_halt(); JPVM JPVM pvm_spawn() JAVA CLASSPATH
2.3. LA MÁQUINA VIRTUAL PARALELA jpvmtaskid pvm_spawn() JAVA JPVM JPVM pvm_send() pvm_recv() jpvmenviroment jpvmbuffer buffers PVM jpvmbuffer JPVM jpvmbuffer buffer buffer JAVA String Object class jpvmbuffer{ public void pack(int v[], int n, int stride); public void pack(int s); public void pack(float v[], int n, int stride); public void pack(float s); public void unpack(int v[], int n, int stride); public int upkint(); public void unapck(float v[], int n, int stride); public float upkfloat();... }; public void pack(string str); public void pack(object d[], int n, int stride); public void pack(object d); public String upkstr(); public unpack(object d[], int n, int stride); public Object upkobject();
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA buffers JPVM PVM JPVM PVM buffers pvm_pk*() pvm_upk*() buffer buffer buffer buffer JPVM buffers buffer jpvmbuffer JPVM pvm_send() jpvmenviroment buffer pvm_send() pvm_send() pvm_- recv() jpvmenvironment pvm_recv() pvm_recv() pvm_nrecv() jpvmmessage buffer class jpvmmessage{ public int messagetag;
2.3. LA MÁQUINA VIRTUAL PARALELA public jpvmtaskid sourcetid; public jpvmbuffer buffer; JPVM JAVA JAVA C C JAVA JAVA JAVA API PVM UNIX Windows JAVA PVM TCP daemons UDP JPVM sockets TCP jpvmenvironment socket jpvmtaskid x y x y y TCP
CAPÍTULO 2. ARQUITECTURA DE LA PLATAFORMA JPVM jpvmenviroment pvm_recv() Solicitud de conexión Hilo de Conexión Hilo de Usuario Hilo de Usuario Hilo de Recepción 1 Hilo de Recepción 2 Hilo de Recepción 3 Conexiones TCP Figura 2.3-F 17. Comunicación de la JPVM JPVM 17 pvm_recv() n m pvm_send() JPVM PVM TPVM
UNIX Power C FORTRAN
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN (ρ) x (u) y (v) (p) (T ) F x = J G y, F G J
3.1. LAS ECUACIONES QUE MODELAN EL FLUJO F = G = ρu ρu 2 + p ρuv ρu (e + V 2 ) + pu 2 ρuv ρuv ρv 2 + p ρu (e + V 2 ) + pv 2 J F F 1 = ρu F 2 = ρu 2 + p F 3 = ρuv F 4 = ρu (e + u2 + v 2 ) + pu 2 e p ρ γ e = c v T = RT γ 1 = 1 γ 1 F 4 p ρ, ( 1 p F 4 = ρu γ 1 ρ + u2 + v 2 ) + pu 2 1 = γ 1 pu + + v 2 ρuu2 + pu. 2
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN F 4 = γ γ 1 pu + + v 2 ρuu2 2 G G 1 = ρv G 2 = ρuv G 3 = ρv 2 + p ( ) G 4 = ρv e + V 2 2 + pv F 4 e G 4 G 4 = γ γ 1 pv + ρv u2 + v 2. 2 (ρ, u, v, p, T ), F, ρ = B + B 2 4AC, 2A A = F 3 2 F 4, 2F 1 B = γ γ 1 F 1F 2, C = γ +1 2(γ 1) F 3 1 ; u = F 1 ρ ; v = F 3 F 1 ; p = F 2 F 1 u;
3.1. LAS ECUACIONES QUE MODELAN EL FLUJO T = p ρr. G F G 1,G 2,G 3 G 4 ρ F 1,F 2,F 3 F 4, G 1 = ρv = ρ F 3 F 1 G 2 = ρuv = F 3 G 3 = ρv 2 + p ( ) 2 F3 = ρ + F 2 F 1 2 ρ F 1 G 4 = = γ γ 1 pv + ρv u2 + v 2 2 γ γ 1 ( F 2 F 2 1 ρ ) F3 + ρ F 3 F 1 2 F 1 [ (F1 ) 2 + ρ ( F3 F 1 ) 2 ] U t + F x + G y =0, F G U
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN U = F = G = ρ ρu ρv ( 1 p γ 1 ρ + u2 + v 2 ) ρ 2 ρu ρu 2 + p ρuv ( 1 p γ 1 ρ + u2 + v 2 ) ρu + pu 2 ρv ρuv ρv 2 + p ( 1 p γ 1 ρ + u2 + v 2 ) ρv + pv 2 U, F G U 1 = ρ U 2 = ρu U 3 = ρv ( 1 p U 4 = γ 1 ρ + u2 + v 2 ) ρ 2 = 1 γ 1 p + u2 + v 2 ρ 2 F 1 = ρu F 2 = ρu 2 + p F 3 = ρuv ( 1 p F 4 = γ 1 ρ + u2 + v 2 ) ρu + pu 2 = γ γ 1 pu + + v 2 ρuu2 2
3.1. LAS ECUACIONES QUE MODELAN EL FLUJO G 1 = ρ G 2 = ρuv G 3 = ρv 2 + p ( 1 p G 4 = γ 1 ρ + u2 + v 2 ) ρv + pv 2 = γ γ 1 pv + ρv u2 + v 2 2 (ρ, u, v, p, T ), U ρ = U 1 u = U 2 U 1 v = U 3 U 1 p = (γ 1) T = p ρr [ U 4 1 ( U 2 2U 2 + U 2 ) ] 3 1 F G U F 1 F 2 F 3 F 4 G 1 G 2 G 3 G 4 p U 1 U 2 U 3 U 4 F 1 = U 2 F 2 = U 2 2 + p U 1 F 3 = U 2U 3 U 1 F 4 = U 2 U 1 [U 4 + p]
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN G 1 = U 3 G 2 = U 2U 3 U 1 G 3 = U 3 2 + p U 1 G 4 = U 3 [U 4 + p] U 1
3.2. MALLA COMPUTACIONAL PARA LA FORMA DEL CONDUCTO (x, y, z, t), x, y, z, t y y ( x) y ( x) z s (x) y z 42in 26in 42in 10in 177.875in 299.125in y s (x) Figura 3.2-F 18. Plano físico del conducto 388.125in x 18 xy xy ξη 19 ξ = x η = y y s(x) y z (x) y s (x)
} CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN 1.0 i, j { 1 i, j i 1, j 0 Figura 3.2-F 19. Plano computacional ξ 0 L η 0 1.0 η =0 η =1.0 ξη ξη. ξ η x y, ξ(x, y), η(x, y) x = ξ y = ξ ( ) ξ x ( ) ξ y + η + η ( ) η x ( ) η y
3.2. MALLA COMPUTACIONAL PARA LA FORMA DEL CONDUCTO ξ x = x x = 1 ξ y η y = x y = 0 = = [ ] y ys (x) y z (x) y s (x) y 1 y z (x) y s (x) [ ] y ys (x) η x = y z (x) y s (x) x = [y z(x) y s (x)] [ y s(x)] [y y s (x)] [y z(x) y s(x)] [y z (x) y s (x)] 2 = y s (x)y z(x)+y s (x)y s(x) [y z (x)y y z (x)y s(x) y s (x)y+y s (x)y s(x)] [y z (x) y s (x)] 2 = y s(x)y z (x) y z(x)y + y z(x)y s (x)+y s(x)y [y z (x) y s (x)] 2 = y [y s(x) y z(x)] + y z(x)y s (x) y s(x)y z (x) [y z (x) y s (x)] 2 y = η [y z (x) y s (x)] + y s (x), η x = η [y s(x) y z(x)] [y z (x) y s (x)] y s(x)[y z (x) y s (x)] [y z (x) y s (x)] 2 = η [y s(x) y z(x)] y s(x) y z (x) y s (x) η x
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN y s (x) = y z (x) = 0 x 10 8 (x 10) 10 < x 177.875 167.875 8 177.875 < x 299.125 8 (x 299.125) + 8 x>299.125 89 42 x 10 8 (x 10) + 42 167.875 10 < x 177.875 34 177.875 < x 299.125 8 (x 299.125) + 34 89 x>299.125 y s (x) y z (x), y s(x) = y z(x) = 0 x 10 8 10 < x 177.875 167.875 0 177.875 < x 299.125 8 x>299.125 89 0 x 10 8 10 < x 177.875 167.875 0 177.875 < x 299.125 8 x>299.125 89 η x = 0.0 x 10 9.530900968 10 2 η 4.765450484 10 2 42.9530901+9.530900968 10 2 x 10 < x 177.875 0.0 177.875 < x 299.125.1797752809η+8.988764045 10 2 27.7752809 0.1797752809x x>299.125
3.2. MALLA COMPUTACIONAL PARA LA FORMA DEL CONDUCTO Continuidad : Momentoenx: Momentoeny : Energía : F 1 ξ = F 2 ξ = F 3 ξ = F 4 ξ = [( ) η F1 x η + 1 y z (x) y s (x) [( ) η F2 x η + 1 y z (x) y s (x) [( ) η F3 x η + 1 y z (x) y s (x) [( ) η F4 x η + 1 y z (x) y s (x) ] G 1 η ] G 2 η ] G 3 η ] G 4 η τ = t. xyt ξητ. τ = t x = ξ y t ( ) ξ x = ( ) ξ ξ y = ( ) ξ ξ t + η + η + η ( ) η x ( ) η y ( ) η t + τ + τ + τ ( ) τ x ( ) τ y ( τ t ( ) ( ) ( ) ( ) ( ) τ ξ τ ξ η,,,, 0 ( ) x ( ) y y t t ξ τ, 1 x t ),
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN x = ξ + ( ) η η x = ( ) η y η y = t τ [ U F τ + ξ + F η [ U F τ = ξ + F η ( ) ( η η y x ( ) η y ( ) η x ( )] [ η G + x η ( )] [ η G x η ( )] η =0, y ( )] η y ) = 1 y z (x) y s (x) = η [y s(x) y z(x)] y s(x). y z (x) y s (x) [ ( )] [ ( )] U Continuidad : 1 τ = F1 ξ + F 1 η η x G1 η η y Momentoenx: U 2 τ [ = F2 ξ + F 2 η ( )] [ η x G2 η ( )] η y Momentoeny : U 3 τ [ = F3 ξ + F 3 η ( )] [ η x G3 η ( )] η y Energía : U 4 τ [ = F4 ξ + F 4 η ( )] [ η x G4 η ( )] η y
3.3. ALGORITMO MACCORMACK ( ) F1 ξ ( ) F2 ξ ( ) F3 ξ ( ) F4 ξ i,j i,j i,j i,j = = = = ( ) η (F1 ) i,j (F 1 ) i,j+1 + x η ( ) η (F2 ) i,j (F 2 ) i,j+1 + x η ( ) η (F3 ) i,j (F 3 ) i,j+1 + x η ( ) η (F4 ) i,j (F 4 ) i,j+1 + x η F ( ) ( ) F1 F 1 = (F i+1,j 1 ) i,j + ξ ( ) ( ) F2 F 2 = (F i+1,j 2 ) i,j + ξ ( ) ( ) F3 F 3 = (F i+1,j 3 ) i,j + ξ ( ) ( ) F4 F 4 = (F i+1,j 4 ) i,j + ξ 1 (G 1 ) i,j (G 1 ) i,j+1 y z (x) y s (x) η 1 (G 2 ) i,j (G 2 ) i,j+1 y z (x) y s (x) η 1 (G 3 ) i,j (G 3 ) i,j+1 y z (x) y s (x) η 1 (G 4 ) i,j (G 4 ) i,j+1 y z (x) y s (x) η i,j i,j i,j i,j ξ ξ ξ ξ F i+1,j (ρ) i+1,j = B + B 2 4AC, 2A
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN ( ) 2 F 3 i+1,j A = 2 ( ( F 4 )i+1,j F 1 )i+1,j γ ( ) ( ) B = F 1 γ 1 i+1,j F 2 C = γ +1 ( ) 3 F 1 2(γ 1) i+1,j i+1,j ρ G ( ) ( ) F 3 G1 = ρ i+1,j i+1,j ( ) F 1 ( G2 = )i+1,j ( ) F 3 i+1,j i+1,j i+1,j ( ) ( F 3 G3 = ρ )i+1,j i+1,j + ( ( ) 2 F 1 F 2 )i+1,j F i+1,j 2 i+1,j ρ i+1,j ( ) γ G4 = ( ( ) 2 F ( ) 1 F i+1,j 2 γ 1 )i+1,j i+1,j F 3 F 1 = + ρ i+1,j 2 ( ) F 3 F 1 i+1,j ρ i+1,j [ (F ) 2 1 + ρ i+1,j ( F 3 i+1,j ) 2 F 1 i+1,j ] ( ) F1 ξ ) ( F2 ξ ( F3 ξ ( F4 ξ ) ) i+1,j i+1,j i+1,j i+1,j = = = = ( ) η (F 1) i+1,j 1 (F 1) i+1,j 1 (G 1) x η + i+1,j 1 (G 1) i+1,j y z (x) y s (x) η ( η x ( η x ( η x ) (F 2) i+1,j 1 (F 2) i+1,j 1 (G 2) η + i+1,j 1 (G 2) i+1,j y z (x) y s (x) η ) (F 3) i+1,j 1 (F 3) i+1,j 1 (G 3) η + i+1,j 1 (G 3) i+1,j y z (x) y s (x) η ) (F 4) i+1,j 1 (F 4) i+1,j 1 (G 4) η + i+1,j 1 (G 4) i+1,j y z (x) y s (x) η
3.3. ALGORITMO MACCORMACK ( ) [ F1 = 1 ( F1 ) ξ i,j 2 ξ ( ) [ F2 = 1 ( F2 ) ξ i,j 2 ξ ( ) [ F3 = 1 ( F3 ) ξ i,j 2 ξ ( ) [ F4 = 1 ( F4 ) ξ i,j 2 ξ i,j i,j i,j i,j ( ) F1 + ξ ( ) F2 + ξ ( ) F3 + ξ ( ) F4 + ξ i+1,j i+1,j i+1,j i+1,j ] ] ] ] F, i +1, ( ) F1 (F 1 ) i+1,j = (F 1 ) i,j + ξ ξ i,j ( ) F2 (F 2 ) i+1,j = (F 2 ) i,j + ξ ξ i,j ( ) F3 (F 2 ) i+1,j = (F 3 ) i,j + ξ ξ i,j ( ) F4 (F 2 ) i+1,j = (F 4 ) i,j + ξ i,j ξ (SF k ) i,j = Cy p i,j+1 2p i,j + p i,j 1 p i,j+1 + p i,j + p i,j 1 [(F k ) i,j+1 2(F k ) i,j +(F k ) i,j 1 ] k =1, 2, 3, 4. F 1, F 2, F 3 F 4 :
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN ( ) ( ) F k i+1,j =(F Fk k) i,j + ξ +(SF k ) i,j, k =1, 2, 3, 4. ξ i,j F 1, F 2, F 3 F 4 : (SF k ) i+1,j = Cy p i+1,j+1 2p i+1,j + p i+1,j 1 p i+1,j+1 + p i+1,j + p i+1,j 1 [ ] (F k ) i+1,j+1 2(F k ) i+1,j +(F k ) i+1,j 1, k =1, 2, 3, 4. (F k ) i+1,j = (F k ) i,j + ( ) Fk ξ +(SF k ) i+1,j, k =1, 2, 3, 4. ξ i x j y ( ) τ U1 τ i,j ( ) τ U2 τ i,j = (F 1) τ i,j (F 1) τ ( ) i+1,j η (F1 ) τ i,j + (F 1) τ i,j+1 ξ x η ( ) η (G1 ) τ i,j + (G 1) τ i,j+1 y η = (F 2) τ i,j (F 2) τ ( ) i+1,j η (F2 ) τ i,j + (F 2) τ i,j+1 ξ x η ( ) η (G2 ) τ i,j + (G 2) τ i,j+1 y η
3.3. ALGORITMO MACCORMACK ( ) τ U3 τ i,j ( ) τ U4 τ i,j = (F 3) τ i,j (F 3) τ ( ) i+1,j η (F3 ) τ i,j + (F 3) τ i,j+1 ξ x η ( ) η (G3 ) τ i,j + (G 3) τ i,j+1 y η = (F 4) τ i,j (F 4) τ ( ) i+1,j η (F4 ) τ i,j + (F 4) τ i,j+1 ξ x η ( ) η (G4 ) τ i,j + (G 4) τ i,j+1 y η U, ( ( ) τ+ τ U 1 = (U i,j 1 ) τ i,j + U1 τ ( ( ) τ+ τ U 2 = (U i,j 2 ) τ i,j + U2 τ ( ( ) τ+ τ U 3 = (U i,j 3 ) τ i,j + U3 τ ( ( ) τ+ τ U 4 = (U i,j 4 ) τ i,j + U4 τ ) τ i,j ) τ i,j ) τ i,j ) τ i,j τ τ τ τ U, (p) τ+ τ i,j =(γ 1) (U 4 ) τ+ τ i,j 1 2 ( U 1 ) τ+ τ i,j [ ( ) U 2 τ+ τ ( 2 + U 2 3 i,j ) τ+ τ i,j ] p, F G ( ) τ+ τ F 1 = ( ) τ+ τ U i,j 2 i,j
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN ( F 2 ) τ+ τ i,j = ( F 3 ) τ+ τ i,j = ( F 4 ) τ+ τ i,j = ( ) U 2 τ+ τ 2 i,j ( ) τ+ τ U 1 i,j ( ) τ+ τ U 2 i,j ( U 1 ) τ+ τ i,j ( U 2 ) τ+ τ i,j ( U 1 ) τ+ τ i,j +(p) τ+ τ i,j ( U 3 ) τ+ τ i,j [ (U 4 ) τ+ τ i,j ] +(p) τ+ τ i,j ( ) τ+ τ G1 = ( ) τ+ τ U i,j 3 i,j ( G2 ) τ+ τ i,j = ( G3 ) τ+ τ i,j = ( G4 ) τ+ τ i,j = ( ) τ+ τ i,j U 3 i,j ( ) τ+ τ U 1 i,j ( U 2 ) τ+ τ ( U 2 3 ) τ+ τ i,j ( U 1 ) τ+ τ i,j ( U 3 ) τ+ τ i,j ( U 1 ) τ+ τ i,j +(p) τ+ τ i,j [ (U 4 ) τ+ τ i,j ] +(p) τ+ τ i,j F G t + t ( ) τ+ τ U1 τ i,j = ( ) τ+ τ F1 i 1,j ( ) τ+ τ F 1 i,j ξ + + ( ) ( ) τ+ τ η G 1 i,j 1 ( ) τ+ τ G 1 i,j y η ( ) ( ) τ+ τ η F 1 i,j 1 ( ) τ+ τ F 1 i,j x η
3.3. ALGORITMO MACCORMACK ( ) τ+ τ U2 τ i,j = ( ) τ+ τ F2 i 1,j ( ) τ+ τ F 2 i,j ξ + + ( ) ( ) τ+ τ η G 2 i,j 1 ( ) τ+ τ G 2 i,j y η ( ) ( ) τ+ τ η F 2 i,j 1 ( ) τ+ τ F 2 i,j x η ( ) τ+ τ U3 τ i,j ( ) τ+ τ U4 τ i,j = = ( ) τ+ τ F3 i 1,j ( ) τ+ τ F 3 i,j ξ + + ( ) ( ) τ+ τ η G 3 i,j 1 ( ) τ+ τ G 3 i,j y η ( ) τ+ τ F4 i 1,j ( ) τ+ τ F 4 i,j ξ + + ( ) ( ) τ+ τ η G 4 i,j 1 ( ) τ+ τ G 4 i,j y η ( ) ( ) τ+ τ η F 3 i,j 1 ( ) τ+ τ F 3 i,j x η ( ) ( ) τ+ τ η F 4 i,j 1 ( ) τ+ τ F 4 i,j x η ( ) U1 = 1 τ i,j 2 ( ) U2 = 1 τ i,j 2 ( ) U3 = 1 τ i,j 2 ( ) U4 = 1 τ i,j 2 [ ( U1 τ [ ( U2 τ [ ( U3 τ [ ( U4 τ ) τ ) τ ) τ ) τ i,j i,j i,j i,j + + + + ( U1 τ ( U2 τ ( U3 τ ( U4 τ ) τ+ τ i,j ) τ+ τ i,j ) τ+ τ i,j ) τ+ τ i,j ] ] ] ]
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN U, τ + τ, ( ) (U 1 ) τ+ τ i,j = (U 1 ) τ i,j + U1 τ τ i,j ( ) (U 2 ) τ+ τ i,j = (U 2 ) τ i,j + U2 τ τ i,j ( ) (U 3 ) τ+ τ i,j = (U 3 ) τ i,j + U3 τ τ i,j ( ) (U 4 ) τ+ τ i,j = (U 4 ) τ i,j + U4 τ i,j τ S S τ i,j = S τ+ τ i,j = p C τ x i+1,j 2p τ i,j + pt i 1,j p τ i+1,j +2pτ i,j + pτ i 1,j p C τ y i,j+1 2p τ i,j + pτ i,j 1 + p τ i,,j+1 +2pτ i,j + pτ i,j 1 C x p τ+ τ i+1,j p τ+ τ i+1,j 2pτ+ τ i,j +2pτ+ τ i,j p τ+ τ C y i,j+1 2pτ+ τ i,j + p τ+ τ i,j+1 +2pτ+ τ i,j + p τ+ τ i 1,j + p τ+ τ i 1,j ( ) Ui+1,j τ 2U i,j τ + U i 1,j τ ( ) Ui,j+1 τ 2U i,j τ + U i,j 1 τ + p τ+ τ i,j 1 + p τ+ τ i,j 1 ( U τ+ τ i+1,j 2U τ+ τ i,j ( U τ+ τ i,j+1 τ+ τ 2Ui,j ) + U τ+ τ i 1,j ) + U τ+ τ i,j 1 (Ū) τ+ τ i,j (U) τ+ τ i,j ( ) τ =(U) τ i,j + U1 τ + S τ i,j; τ i,j =(U) τ i,j + ( U1 τ ) i,j τ + S τ+ τ i,j.
3.4. PARÁMETROS INICIALES Y CONDICIONES A LA FRONTERA M =.200 +01 u =.678 +03 v =.000 +03 ρ =.123 +01 3 p =.101 +06 2 T =.2861 +03 M 1 = 2 =1. 23 Kg 1 m3 p =1.01 10 1 T1 = 286. 1 K 5 N m2 x 0 x0 x Plano físico línea inicial de datos 0 0 Plano computacional Figura 3.4-F 20. Condiciones iniciales x x 0 y 20 y F x x 0 + x ξ
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN ξ ξ =min{min ξ 1 (i), min ξ 2 (i)}, ξ 1 (i) = y C, tan (θ i,j + µ i,j ) j =1,..., (n 1) ξ 1 (i) = y C, tan (θ i,j + µ i,j ) j =2,..., n, ( ) vi,j θ i,j = arctan u i,j ( ) 1 µ i,j = arc sen. M i,j C 1 C =0.5. i x j y 21
3.4. PARÁMETROS INICIALES Y CONDICIONES A LA FRONTERA V 1, y (V 1 ) cal 1 1 (V o 1) act 5.353 x frontera inferior 2 2 (V 2 ) cal (V 2 ) act Figura 3.4-F 21. Condiciones de Abbett V 1, 21 V 1 ( ) φ 1 =tan 1 v1, u 1 u 1 v 1 x y, (M 1 ) = (u1 ) 2 +(v 1 ) 2 (a 1 ),
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN a = γp ρ. V 1 V 1 φ 1. V 1, (V 1 ) (M 1 ), f f = f + φ 1, f (M 1 ). (M 1 ) f f = γ+1 γ 1 tan 1 γ 1 γ+1 ((M 1) 2 1) tan 1 (M 1 ) 2 1 (M 1 ) (M 1 ). p,t ρ p,t ρ
3.4. PARÁMETROS INICIALES Y CONDICIONES A LA FRONTERA M M [ ] (γ 1) 1+ p = p 2 [ ] (γ 1) 1+ 2 [ ] (γ 1) 1+ T = T 2 [ ] (γ 1) 1+ 2 M 2 M 2 M 2 M 2 γ γ 1 ρ = p RT p,t ρ p, T ρ 21 V 2 φ 2 f f = f + φ 2 21 φ 2 φ 2 = θ ψ, ψ =tan 1 v 2 u 2.
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN M = 2.22 p = 0.705 T = 255 K ρ = 0.963 3 v = 74.6 u = 707, (V 1 ) 1 74.6 ψ = tan 707 = (6.02). x, θ =(5.352) 0, φ 2 = θ ψ = (5.352) (6.02) = ( 0.668). (0.668) f = f + φ 2 M =2.22, f =(32.24),
3.4. PARÁMETROS INICIALES Y CONDICIONES A LA FRONTERA f = (32.24) (0.668) = (31.57). M =2.19. [ ] p = p 1+ γ 1 2 ] 1+ [ γ 1 2 M 2 M 2 γ γ 1 = ( 0.705 10 5) [ 1+0.2(2.22) 2 = 73889.09 2 1+0.2(2.19) 2 [ ] T = T 1+ γ 1 2 M 2 [ ] 1+ γ 1 2 M 2 [ [ 1+ 1.4 1 ] ] 2 (2.22) 2 = 255 1+ [ ] 1.4 1 2 (2.19) 2 = 258.44 ρ = 75076.65 (287.11) (258.44) = 1.01 3 ] 1.4 1.4 1 x, u = u = 707.
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN y, v v = u (tan θ) = 707 (tan (5.352) ) = 66.23. η η η =0.025. ξ ξ, t t ( u i,j t = C x + v ) 1 i,j y + a 1 i,j ( x) 2 + 1 ( y) 2, γ pi,j C =0.5 a i,j = ρ i,j τ ( u i,j τ i,j = C ξ + v ) 1 i,j η + a 1 i,j ( ξ i ) 2 + 1 ( η) 2. (i =1), (i = N), (j =1) (j = M), (M 2) (N 2) τ t, τ =mín( τ t 2,2, τ t 2,3,..., τ t i,j,..., τ t N 1,M 1).
3.4. PARÁMETROS INICIALES Y CONDICIONES A LA FRONTERA (i, j), τ =0. 22 ρ T p, i =1 U 1, i =1, U 2 U 3 i =1, U 2(i=1,j) = 2U 2(i=2,j) U 2(i=3,j) U 3(i=1,j) = 2U 3(i=2,j) U 3(i=3,j) U 4 i =1, u v U 2 U 3 i = n, U 1(i=n,j) =2U 1(i=n 1,j) U 1(i=n 2,j) U 2(i=n,j) =2U 2(i=n 1,j) U 2(i=n 2,j) U 3(i=n,j) =2U 3(i=n 1,j) U 3(i=n 2,j) U 4(i=n,j) =2U 4(i=n 1,j) U 4(i=n 2,j)
CAPÍTULO 3. EL MODELO MATEMÁTICO DE LA APLICACIÓN Frontera superior (fija) (IMIN, JMAX) (IMAX, JMAX) u i 1 y vi 1 extrapolados del interior u, v,, y T extrapolados del interior Flujo (fijos) i 1 T i 1 p i 1 y 45141 puntos discretos DOMINIO COMPUTACIONAL (IMIN, JMIN) x Frontera inferior (fija) (IMAX, JMIN) Figura 3.4-F 22. Condiciones a la frontera para el flujo no estacionario
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN 23
4.1. DISEÑO DE PROGRAMAS PARALELOS Problema particionamiento comunicación aglomeración mapeo Figura 4.1-F 23. Metodología PCAM
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN 24 unidimensional bidimensional tridimensional Figura 4.1-F 24. Posibles particionamientos sobre una malla 3D
4.1. DISEÑO DE PROGRAMAS PARALELOS
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN
4.2. TIEMPO DE EJECUCIÓN PARALELA t p t comp, t comm t p = t comp + t comm 3 +1 +3
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN t comm = t startup + n t data, t startup t data n q
4.2. TIEMPO DE EJECUCIÓN PARALELA n t comm = q (t startup + n t data ) t startup PVM t startup µ double t data=double double MPI t startup µ n n 2 n n 1 n 2 n 2 n 1 2
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN t comp = n 1 +1, 2 ( t comm = t startup + n ) 2 t data +(t startup + t data ) ( n ) = 2t startup + 2 +1 t data X (0) N X (T ) Xi t+1 = Xt i 1 +2Xt i + Xt i+1, 0 <i<n 1, 0 t<t, 4 X t +1, T X i t +1 X i 1,X i,x i+1 t. N X. i X (0) i X (1) i X (2) i..., X (T ) i. i, X (t) i i 1 i +1 X (t) i 1 X(t) i+1 X (t+1) i. N
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS X t +1 X t, X (t+1) i,j = 4X(t) i,j + X(t) i 1,j + X(t) i+1,j + X(t) i,j 1 + X(t) i,j+1 8 t X i,j t +1 X i,j X. X i,j, X (1) i,j,x(2) i,j,x(3) i,j,... X (0) i 1,j,X(1) i 1,j,X(2) i 1,j,... X (0) i+1,j,x(1) i+1,j,x(2) i+1,j,... X (0) i,j 1,X(1) i,j 1,X(2) i,j 1,... X (0) i,j+1,x(1) i,j+1,x(2) i,j+1,..., X i 1,j, X i+1,j,x i,j 1, X i,j+1 X i,j X i,j t =0 T 1 X (t) i,j X (t) i 1,j,X(t) i+1,j,x(t) i,j 1,X(t) i,j+1 X (t+1) i,j.
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN X i 1, j X i, j 1 X i, j X i, j 1 X i 1, j Figura 4.3-F 25. Estructura de tareas de granularidad fina sobre una malla bidimensional X i,j 25 X.
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS Tarea Conjunto de puntos a ser enviados Mensajes Figura 4.3-F 26. Estructura de tareas de granularidad gruesa 26 X
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN h xx + h yy = au t. 27 h i,j 0 i n 0 j n. h i,0,h 0,j, h n,j,h i,n, 0 i n 0 j n, h i,j, 1 i n 1 1 j n 1, (n 1) 2 h i,j = h i 1,j + h i+1,j + h i,j 1 + h i,j+1, 4 placa de metal Figura 4.3-F 27. Problema de distribución de calor
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS h[i][j] h[0][x] h[x][0] h[n][x] h[x][n] 0 x n C for(iteration=0; iteration<limit; iteration++){ for(i=1; i<n; i++) for(j=1; j<n; j++) g[i][j]=0.25*(h[i-1][j]+h[i+1][j]+h[i][j-1]+h[i][j+1]); for(i=1; i<n; i++) /*actualización de puntos*/ for(j=1; j<n; j++) h[i][j]=g[i][j]; } h i,j g[][] h[][] h[][] g[][] do{ for(i=1; i<n; i++){ for(j=1; j<n; j++) g[i][j]=0.25*(h[i-1][j]+h[i+1][j]+h[i][j-1]+h[i][j+1]); for(i=1; i<n; i++) /*actualización de puntos*/
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN for(j=1; j<n; j++) h[i][j]=g[i][j]; continue=false; /*indica si se debe continuar*/ for(i=1; i<n; i++) /*checar la convergencia de cada punto*/ for(j=1; j<n; j++) if(!converged(i,j)) { /*buscar puntos sin convergencia*/ continue=true; break; } } converged(i,j) TRUE g[i][j] FALSE continue TRUE P i,j, P i,j for(iteration=0; iteration<limit; iteration++){ g = 0.25*(w + x + y + z); send(&g, P i-1,j ); send(&g, P i+1,j ); send(&g, P i,j-1 ); send(&g, P i,j+1 ); recv(&w, P i-1,j ); recv(&x, P i+1,j ); recv(&y, P i,j-1 ); recv(&z, P i,j+1 ); } w x y z limit
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS send() recv() recv() send() iteration = 0; do { iteration++; g = 0.25*(w + x + y + z) send(&g, P i-1,j ); send(&g, P i+1,j ); send(&g, P i,j-1 ); send(&g, P i,j+1 ); recv(&w, P i-1,j ); recv(&x, P i+1,j ); recv(&y, P i,j-1 ); recv(&z, P i,j+1 ); } while((!converged(i,j)) && (iteration < limit)); send(&g, &i, &j, &iteration, P master ); 28
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN send(g,p i-1,j ); send(g,p i+1,j ); send(g,p i,j-1 ); send(g,p i,j+1 ); recv(w,p i-1,j ); recv(x,p i+1,j ); recv(y,p i,j-1 ); recv(z,p i,j+1 ); send(g,p i-1,j ); send(g,p i+1,j ); send(g,p i,j-1 ); send(g,p i,j+1 ); recv(w,p i-1,j ); recv(x,p i+1,j ); recv(y,p i,j-1 ); recv(z,p i,j+1 ); send(g,p i-1,j ); send(g,p i+1,j ); send(g,p i,j-1 ); send(g,p i,j+1 ); recv(w,p i-1,j ); recv(x,p i+1,j ); recv(y,p i,j-1 ); recv(z,p i,j+1 ); send(g,p i-1,j ); send(g,p i+1,j ); send(g,p i,j-1 ); send(g,p i,j+1 ); recv(w,p i-1,j ); recv(x,p i+1,j ); recv(y,p i,j-1 ); recv(z,p i,j+1 ); send(g,p i-1,j ); send(g,p i+1,j ); send(g,p i,j-1 ); send(g,p i,j+1 ); recv(w,p i-1,j ); recv(x,p i+1,j ); recv(y,p i,j-1 ); recv(z,p i,j+1 ); Figura 4.3-F 28. Paso de mensajes para el problema de la distribución de calor
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS if (primer_renglon) x = valor_superior; if (primer_columna) y = valor_izquierda; if (ultimo_renglon) w = valor_inferior; if (primer_renglon) x = valor_superior; if (primer_columna) y = valor_izquierda; if (ultima_columna) z = valor_derecho; iteration = 0; do { iteration++; g = 0.25*(w + x + y + z) if!(primer_renglon) send(&g, P i-1,j ); if!(ultimo_renglon) send(&g, P i+1,j ); if!(primer_columna) send(&g, P i,j-1 ); if!(ultima_columna) send(&g, P i,j+1 ); if!(ultimo_renglon) recv(&w, P i-1,j ); if!(primer_renglon) recv(&x, P i+1,j ); if!(primer_columna) recv(&y, P i,j-1 ); if!(ultima_columna) recv(&z, P i,j+1 ); } while((!converged(i,j)) && (iteration < limit)); send(&g, &i, &j, &iteration, P master ); 29
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN Figura 4.3-F 29. Partición para el problema de la distribución de calor t commsq =8 (t startup + p n ) t data, p t commsq
4.3. ALGORITMOS PARALELOS PARA DIFERENCIAS FINITAS t commcol =4(t startup + nt data ). t commsq t commcol t startup t startup = 10, 000 t data =50 n =32. t commcol =46, 400 t commsq =80, 000 + 12,800 p p, t startup = 100 t data =50 n =32, t commcol =6, 800 t commsq = 800 + 12,800 p, t commcol >t commsq, p>4 8 (t startup + p n ) t data > 4(t startup + nt data ), ( t startup >n 1 2 ) t data p
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN F 1 ξ = [( ) η F1 x η + 1 y z (x) y s (x) ] G 1, η η, m η k m k η, m =40 k =4, j 1,j 2,j 3,j 4 j 1 = 1,...,10 j 2 = 11,...,20 j 3 = 21,...,30 j 4 = 31,...,40 30
4.4. PARALELIZANDO EL ALGORITMO MACCORMACK j+1 j j-1 tarea punto discreto que debe ser enviado a su tarea vecina i i+1 Figura 4.4-F 30. Diseño de granularidad fina ( ) F1 = ξ i,j ( ) η (F1 ) i,j (F 1 ) i,j+1 + x η 1 y z (x) y s (x) (G 1 ) i,j (G 1 ) i,j+1, η (i, j), i =1...n j =1...m n ξ m η k ) ( F1 ξ i,j
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN ( ) F1 m j 1 = 1, 2,...,( ξ i,j 1 t ( ) F1 ( m ) ( m ) j 2 = +1, ξ i,j 2 k k ( ) F1 m ) j 3 = 2( ξ i,j 3 k ( ) F1 ( m ) j k = (k 1) ξ i,j k k ), 1 ( m ) +2,...,2, 2 k ( m ) ( m ) +1, 2 +2,...,3, 2 k k ( m ) +1,...,k = m k k ξ 300 6 = 1800 F 1 F 2,F 3,F 4 1800 4 = 7200 (7), (8), (9) (10). 31 30 )
4.4. PARALELIZANDO EL ALGORITMO MACCORMACK F 1 F 2 F 3 F 4 Tarea de granularidad gruesa, cada una trabajando en una variable de flujo F Figura 4.4-F 31. Diseño de granularidad gruesa para el flujo estacionario F 1 F 2 F 3 F 4 q (q =1, 2, 3, 4) F q i +1 F q F q.
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN F q i +1. ξ i, F q. F q (i, j) q (q =1, 2, 3, 4) F q n ξ 1, ξ 1 + ξ 2,..., ξ i i=1 32 q (q =1, 2, 3, 4) (i, j) U q τ 0 +1 τ 0 +2... τ 0 + k
4.5. ALGORITMO PARALELO PARA LA FORMA ESTACIONARIA 0 +k 0 +k U 1 U 2 0 +1 0 +1 0 0 0 +k 0 +k U 3 U 4 0 +1 0 +1 0 0 Figura 4.4-F 32. Diseño de granularidad gruesa para el flujo bidimensional no estacionario M F 1 F 2 F 3 F 4 G 1 G 2 G 3 G 4. M S 1 S 2 S 3 S 4. M S 1 S 2 S 3 S 4.
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN M S 1 S 2 S 3 S 4, S 1 S 2 S 3 S 4, M x =0.0, i =1 M F 1 G 1 i, S 1 F 2 G 2 F 3 G 3 F 4 G 4 i, S 2 S 3 S 4, M F k i,j j=1,...,41. S k,m G k i,j j=1,...,41. S k,k=1,..., 4. ξ i S 1 S 2 S 3 S 4 ( ) F1, ξ ( ) F2, ξ ( ) F3 ξ ( ) F4, ξ F 1 F 2 F 3 F 4 ξ M ξ S k k =1, 2, 3, 4. S 1 S 2 S 3 S 4 F 1 F 2 F 3 F 4, i ξ S 1 F 1 S 2 S 4, C F 1i,j j=1,...,41. S 1 S 2,S 1 F 1i,j j=1,...,41. S 4 S 2 F 1 B
4.5. ALGORITMO PARALELO PARA LA FORMA ESTACIONARIA S 3 F 3 S 4 S 3 F 3i,j j=1,...,41. S 4 S 4 F 1 F 3 A S 1 C F 1, M C i,j j=1,...,41. F 1i,j j=1,...,41. S 1 M, S 1 M S 2 B F 2, M B i,j j=1,...,41. F 2i,j j=1,...,41. S 2 M, S 2 M S 3 F 3 M. S 3 F 3i,j j=1,...,41. M S 4 A F 4, M A i,j j=1,...,41. F 4i,j j=1,...,41. S 4 M, S 2 M A B C F 1 F 2 F 3 F 4, γ P M γ F 3 P, S 1. M γ i,j j=1,...,41. S 1,M F 3 i,j j=1,...,41. S 1,M P i,j j=1,...,41. S 1 M F 3 P, S 2. ( ) M F 3 i,j j=1,...,41. S 2,M P i,j j=1,...,41. S 2
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN M γ F 2 F 1 P, S 3. M γ i,j j=1,...,41. S 3,M F 2 i,j j=1,...,41. ( ) M P i,j j=1,...,41. S 3 S 3,M F 1 i,j j=1,...,41. S 3 M γ F 3 F 2 F 1 P, S 4. M γ i,j j=1,...,41. S 4,M F 3 i,j j=1,...,41. S 4,M F 2 i,j j=1,...,41. S 4 M F 1 i,j j=1,...,41. S 4,M P i,j j=1,...,41. S 4 S 1 γ F 3 P, G 1. S 2 F 3 P, G 2. S 3 γ F 2 F 1 P, G 3. S 4 γ F 3 F 2 F 1 P, G 4. S 1 S 2 S 3 S 4 ( ) ( ) ( ) ( ) F1 F2 F3 F4,,, ξ ξ ξ ξ F 1 F 2 F 3 F 4 S 1 S 2 S 3 S 4 ( ) ( ) ( ) ( ) F1 F2 F3 F4 ξ ξ ξ ξ,, S 1 S 2 S 3 S 4 F 1 F 2 F 3 F 4, i +1.,
4.5. ALGORITMO PARALELO PARA LA FORMA ESTACIONARIA F 1 F 2 F 3 F 4 M, S 1 S 2 S 3 S 4. F 1i+1,j j=1,...,41. S 1 S 3 F 3i+1,j j=1,...,41. M,S 2 F 2i+1,j j=1,...,41. M, F 4i+1,j j=1,...,41. M, S 4 F 1 F 2 F 3 F 4, j =1 j =41 F 1 F 2 F 3 F 4, γ u v P T, G 1 G 2 G 3 G 4. x ξ (x = x + ξ), i (i = i +1) x M 33 34
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN Maestro : Master Esclavo 1 : Slave Esclavo 2 : Slave Esclavo 3 : Slave Esclavo 4 : Slave Constantes Constantes Constantes Constantes ID's ID's ID's ID's F 1, 1 G, P y x F 2, 2 G, P y x F 3, 3 G, P y x F 4, 4 G, P y x F 1 F 1 F 3 C y F 1 B y F 2 F3 B y F 4 Figura 4.5-F 33. Paso de mensajes para la forma estacionaria (paso predictor)
4.5. ALGORITMO PARALELO PARA LA FORMA ESTACIONARIA Definir parámetros iniciales <<usa>> Programa Maestro Calcular el comportamiento del flujo supersónico en el conducto Ecuaciones del flujo estacionario Crear tareas esclavas Figura 4.5-F 34. Casos de uso de la forma estacionaria t com_predictor η M 4 ( ) t startup +47 t M 4(t startup +20 t ) F G P x M 4 ( ) t startup + 124 t ξ M 4 ( ) t startup +1 t F 1 S 1 S 2 S 4 2 ( ) t startup +82 t ( ) F 3 S 3 S 4 tstartup +41 t ( ) C F 1 S 1 tstartup +82 t ( ) B F 2 S 2 tstartup +82 t ( ) F 3 S 3 tstartup +41 t ( ) A F 4 S 4 tstartup +82 t t com_predictor =15 t startup + 992 t
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN Maestro : Master Esclavo 1 : Slave Esclavo 2 : Slave Esclavo 3 : Slave Esclavo 4 : Slave, F 3 y P F 3 y P, F 2, F 1 y P, F 3, F 2, F 1 y P nuevo valor de F 1 nuevo valor de F 2 nuevo valor de F 3 nuevo valor de F 4 Continuación de la Figura 4.5-F 33. (paso corrector) t com_corrector, ( ) γ F 3 P S 1 M tstartup + 123 t ( ) F 3 P S 2 M tstartup +82 t ( ) γ F 2 F 1 P S 3 M tstartup + 164 t γ F 3 F 2 F 1 P S 4 M ( ) t startup + 205 t ( ) F 1 S 1 tstartup +41 t ( ) F 2 S 2 tstartup +41 t ( ) F 3 S 3 tstartup +41 t ( ) F 4 S 4 tstartup +41 t t com_corrector =8 t startup + 738 t.
4.6. ALGORITMO PARALELO PARA LA FORMA NO ESTACIONARIA n t com_total = (8 t startup + 268 t )+n (t ) com_predictor + t com_corrector = (8 t startup + 268 t ) + (23 t startup + 1730 t ), (8 t startup + 268 t ) M ρ u x v y p M S 1 S 2 S 3 S 4 M S 1 S 2 S 3 S 4 M S 1 S 2 S 3 S 4 S 1 S 2 S 3 S 4 M t =1 U 1 U 2 U 3 U 4 i, j i =1,..., 1001 j =1,..., 41. M U 1 U 2 U 3 p, S 1 S 2 S 3 U 1 U 2 U 3 U 4 p, S 4 M p i,j U i,j k k=1,2,3, i=1,...,1101 j=1,...,41. S k k=1,2,3. M p i,j U i,j 4 k=1,2,3, i=1,...,1101 j=1,...,41. S 4
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN M τ t F k G k S k, U k M, k =1, 2, 3, 4 S 1 S 2 S 3 S 4 ( ) U1, τ ( ) U2, τ ( ) U3 τ ( ) U4 τ U 1 U 2 U 3 U 4 F 1 F 2 F 3,F 4,G 1 G 2 G 3 G 4 M S 1 S 2 S 3 S 4, τ M τ S k, k =1, 2, 3, 4. S 1 S 2 S 3 S 4 U 1, U 2, U 3 U 4, t τ S 1 S 2 S 3 S 4 M U 1, U 2, U 3 U 4 U i,j k S k k=1,2,3,4, i=1,...,1101 j=1,...,41. M, k =1, 2, 3, 4. M U 1, U 2, U 3 U 4, p M U 2 U 3 p, S 1 M p i,j U i,j k k=2,3, i=1,...,1101 j=1,...,41. S 1 M U 1 U 3 p, S 2 M p i,j U i,j k k=1,3, i=1,...,1101, j=1,...,41. S 2
4.6. ALGORITMO PARALELO PARA LA FORMA NO ESTACIONARIA M U 1 U 2 p, S 3 M p i,j U i,j k k=1,2, i=1,...,1101, j=1,...,41. S 3 M U 1 U 2 U 3 p, S 4 M p i,j U i,j k k=1,2,3, i=1,...,1101, j=1,...,41. S 4 S 1 S 2 S 3 S 4 ( ) U1, τ ( ) U2, τ ( ) U3 τ ( ) U4 τ U 1, U 2, U 3 U 4 S 1 S 2 S 3 S 4 ( ) ( ) ( ) ( ) U1 U2 U3 U4 τ τ τ τ,, S 1 S 2 S 3 S 4 U 1 U 2 U 3 U 4 t +1 S 1 S 2 S 3 (1, 1) (1, 2) (1, 41) (1, 1) (2, 1) (1101, 1) (1, 41) (2, 41) (1101, 41) (1101, 1) (1101, 2) (1101, 41) U 1 U 2 U 3 S 1 S 2 S 3 S 4 U 1,U 2 U 3, U i,j k S k k=1,2,3, i=1,...,1101, j=1,...,41. S 4
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN S 4 U 4, U 1 U 2 U 3. S 1 S 2 S 3 S 4 U k, k =1, 2, 3, 4, t t +1 S 1 S 2 S 3 S 4 U 1 U 2 U 3 U 4, M U i,j k S k k=1,2,3, i=1,...,1101, j=1,...,41. M p t +1 U 1 U 2 U 3 U 4 M τ τ (τ = τ + τ) t (t = t +1) ρ u x v y U 1 U 2 U 3 U 4 35
4.6. ALGORITMO PARALELO PARA LA FORMA NO ESTACIONARIA Maestro : Master Constantes Esclavo 1 : Slave Constantes Esclavo 2 : Slave Constantes Esclavo 3 : Slave Constantes Esclavo 4 : Slave ID's ID's ID's ID's U 1, 2 3 U, U y p U 1, 2 3 U, U y p U 1, 2 3 U, U y p U1, U 2, U3, U 4 y p U 1 U 2 U 3 U 4 U 2, U 3 y p U 1, U 3 y p U 1, U 2 y p U 1, U 2, U 3 y p U 1 U 2 U 3 U 1 U 2 U 3 U 4 Figura 4.6-F 35. Paso de mensajes para la forma no estacionaria 36 35
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN Obtener parámetros iniciales de un archivo <<usa>> Programa Maestro Calcular el comportamiento del flujo supersónico en el conducto Ecuaciones del flujo no estacionario Crear tareas esclavas Figura 4.6-F 36. Casos de uso de la forma no estacionaria t com_predictor, M 4 ( ) t startup +49 t M 4 ( ) t startup +20 t U 1,U 2,U 3 p M S 1 3 ( ) t startup + 45141 t U 1,U 2,U 3 p M S 2 3 ( ) t startup + 45141 t U 1,U 2,U 3 p M S 2 3 ( ) t startup + 45141 t U 1,U 2,U 3 p M S 2 4 ( ) t startup + 45141 t U 1,U 2,U 3,U 4 p M S 4 4(t startup +1 t ) ( ) U 1, S 1 M tstartup + 45141 t ( ) U 2, S 2 M tstartup + 45141 t ( ) U 3, S 3 M tstartup + 45141 t ( ) U 4, S 4 M tstartup + 45141 t t com_predictor =21 t startup + 767401 t t com_corrector
4.6. ALGORITMO PARALELO PARA LA FORMA NO ESTACIONARIA U 2 U 3 p, M S 1 3 ( ) t startup + 45141 t U 1 U 3 p, M S 2 3 ( ) t startup + 45141 t U 1 U 2 p, M S 3 3 ( ) t startup + 45141 t U 1 U 2 U 3 p M S 4 4 ( ) t startup + 45141 t U 1, ( ) S 1 S 4 tstartup +[(2 1101) + (2 39)] t U 2, ( ) S 2 S 4 tstartup +[(2 1101) + (2 39)] t U 3, ( ) S 3 S 4 tstartup +[(2 1101) + (2 39)] t ( ) U 1, S 1 M tstartup + 45141 t ( ) U 2, S 2 M tstartup + 45141 t ( ) U 3, S 3 M tstartup + 45141 t ( ) U 4, S 4 M tstartup + 45141 t t com_corrector =20 t startup + 774237 t. n t com_total = (8 t startup + 276 t )+n (t ) com_predictor + t com_corrector = (8 t startup + 276 t )+n (41 t startup + 1541638 t data ) (8 t startup + 276 t )
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN 37 38 JPVM JAVA
4.7. DIAGRAMA DE CLASES FF (from Logical View) FF1() FF2() FF3() FF4() Newton (from Logical View) raiz() findm() dfindm() Metrica (from Logical View) yz_ys() yz() ys() dndx() Frontier (from Logical View) pact() tact() roact() Fluxterm (from Logical View) value[][] : double x : int y : int count : int Fluxterm() Fluxterm() setdim() loadfromdisk() toarray() getread() getname() getx() gety() Parcial (from Logical View) forward() forward() reward() fsf() fcal() fphi() min_wlast() min_wfirst() min() Primitives (from Logical View) FA() FB() FC() fro() fu() fv() fp() ft() fm() Planificador (from Logical View) Tasker Master (from Logical View) jpvmtaskid (from jpvm) lector mastertaskid +tids[] Timer (from Logical View) timer c Constantes (from Logical View) Lector (from Logical View) c Slave (from Space) F[] : double G[] : double P[] : double DFe[] : double SF[] : double DFe_[] : double SF_[] : double F_[] : double G_[] : double P_[] : double DFeav[] : double Fs[] : double ABC[] : double X : double Deltae : double Task : int n : int num_task : int = 4 Slave() start_pararelo() main() buffer jpvm jpvmbuffer (from jpvm) jpvmenvironment (from jpvm) message jpvmmessage (from jpvm) FG (from Logical View) M v ro T FluxVar (from Logical View) G[] values[] : double n : int count : int P FG1() FG2() FG3() FG4() FG1() FG2() FG3() FG4() FluxVar() FluxVar() put() get() get() getname() Figura 4.7-F 37. Diagrama de clases del programa bidimensional estacionario
CAPÍTULO 4. DISEÑO E IMPLEMENTACIÓN FU (from Logical View) FU1() FU2() FU3() FU4() FU1() FU2() FU3() FU4() U3D (from Logical View) FU1() FU1() FU2() FU3() FU4() F3D (from Logical View) FF1() FF2() FF3() FF4() FF1U() FF2U() FF3U() FF4U() G3D (from Logical View) FG1() FG2() FG3() FG4() FG1U() FG2U() FG3U() FG4U() FluxVar (from Logical View) values[] : double n : int count : int FluxVar() FluxVar() put() get() get() getname() Metrica3D (from Logical View) Primitives3D (from Logical View) Parcial3D (from Logical View) Constantes3D (from Logical View) Finddt() min() dndy() dndx() FP() FRO() FU() FV() FT() FM() Predictor() Corrector() FSF() c Cx : double x[] : double deltae[] : double t:int m : int Constantes3D() crearx() Loaddeltae() tostring() Constantes (from Logical View) Master3D (from Logical View) c Min (from Logical View) valor : double xpos : int ypos : int Min() tostring() DeltatPos num_task : int = 4 Deltat : double Master3D() start_paralelo() inicializar() send_data() send_deltat() recv_predichas() calcular_p_predicha() send_predichas() recv_nuevas() main() Slave3D (from Logical View) Task:int n:int num_task:int=4 Deltat : double Slave3D() start_pararelo() main() lector Lector (from F) Tasker Planificador SlaveTasker timer Timer timer (from Logical View) (from Logical View) Figura 4.7-F 38. Diagrama de clases del programa bidimensional no estacionario
JPVM JVM JPVM jpvmdaemon jpvmdaemon JPVM daemon CLASSPATH JPVM JPVM jpvm CLASSPATH Linux 39
CAPÍTULO 5. PRUEBAS Y RESULTADOS Figura 5.1-F 39. Variable CLASSPATH /home/ccouder/javapvm JPVM /home/ccouder/2d /home/ccouder/3d daemon java jpvm.jpvmdaemon 40 Figura 5.1-F 40. Daemon de la JPVM daemon jpvmdaemon daemon PVM daemon n JPVM daemon JPVM daemons
5.1. CONFIGURACIÓN DEL ENTORNO DE LA JPVM daemon daemons JPVM jpvmconsole add IP TCP JAVA daemon daemons add Windows Linux daemons daemons Linux Windows Linux daemons Linux java jpvm.jpvmdaemon daemon Windows 41 daemons daemon
CAPÍTULO 5. PRUEBAS Y RESULTADOS Figura 5.1-F 41. Daemons de la JPVM bajo Linux y Windows java jpvm.jpvm Console > ps ps daemon conf JPVM daemon JPVM 42 JPVM daemons 41 daemon Linux (dydy) daemon Linux (dydy) add Windows add andromeda 43 JPVM ps mat_mult java mat_mult 9 200
5.1. CONFIGURACIÓN DEL ENTORNO DE LA JPVM Figura 5.1-F 42. Consola de la JPVM Figura 5.1-F 43. Procesos en la JPVM
CAPÍTULO 5. PRUEBAS Y RESULTADOS JPVM daemon Linux dydy daemons andromeda (command line jpvm task) mat_mult mat_mult JPVM JAVA SUN Microsystems JAVA JVM MATLAB JAVA C++ JAVA C++ JAVA C++ JOVE Visual Age Windows gcj UNIX Windows JPVM gcj Linux
5.2. DESEMPEÑO DE LA JPVM Windows JPVM Linux Windows Linux posix Windows win32 JAVA JPVM gcj MinGW Windows JPVM JVM Windows NT 4.0 SP 6 1 Nativo jpvmdaemon.exe Usando la JVM java jpvmdaemon Memoria utilizada Física / Virtual / Hilos 3060K / 1352K / 3 6020K / 8920K / 9 Tiempo de creación de tareas creación de 1 tarea: 2234.0 msecs creación de 2 tareas: 4105.0 msecs. creación de 4 tareas: 7972.0 msecs. creación de 8 tareas: 16183.0 msec s. creación de 16 tareas: 33998.0 msecs. creación de 1 tarea: 2233.0 msecs. creación de 2 tareas: 3986.0 msecs. creación de 4 tareas: 7992.0 msecs. creación de 8 tareas: 16363.0 msecs. creación de 16 tareas: 34079.0 msecs. Tabla 5.2-T 1. Memoria requerida y tiempo de creación de tareas JVM JVM 2 pack comm unpk
CAPÍTULO 5. PRUEBAS Y RESULTADOS Nativo jpvmdaemon.exe Usando la JVM java jpvmdaemon Tiempo de Tiempo de comunicación comunicación 4 bytes 1024 bytes pack: 0.625 msecs. comm: 36.3125 msecs. unpk : 0.0 msecs. pack: 0.0 msecs. comm: 33.1875 msecs. unpk: 0.625 msecs. pack: 0.0390625 msecs. comm: 25.39453125 msecs. unpk: 0.625 msecs. pack: 0.0 msecs. comm: 25.88671875 msecs. unpk: 0.0390625 msecs. Tiempo de comunicación 10240 bytes pack: 0.00244140625 msecs. comm: 32.274658203125 msecs. unpk: 0.0390625 msecs. pack: 0.0 msecs. comm: 30.992919921875 msecs. unpk: 0.00244140625 msecs. Tiempo de comunicación 102400 bytes Tiempo de comunicación 1048576 bytes pack: pack: 8.750152587890625 41.859384536743164 msecs. msecs. comm: comm: 154.7671661376953 1255.672947883606 msecs. msecs. unpk: unpk: 1.25244140625 21.453277587890625 msecs. msecs. pack: 6.875 msecs. comm: 155.9370574951172 msecs. unpk: 3.750152587890625 msecs. pack: 44.1796875 msecs. comm: 1281.7460660934448 msecs. unpk: 21.484384536743164 msecs. Tabla 5.2-T 2. Tiempo de comunicación entre dos tareas en el mismo host JVM JPVM JAVA gcj gcj AWT Swing JOVE JAVA core package API
5.3. TIEMPOS DE EJECUCIÓN comm JPVM SMP WEB SMP IPC UNIX MOSIX SMP
CAPÍTULO 5. PRUEBAS Y RESULTADOS JAVA MPI 44 principiantes programadores expertos programación envisual Basic programación en C programación con MPI programación en C++ programación con hilos Figura 5.3-F 44. Complejidad de programación con hilos de ejecución JPVM SMP Windows SMP
5.3. TIEMPOS DE EJECUCIÓN UNIX Intel Pentium III SMP paraminit.dat x y u.dat v.dat ro.dat p.dat 41 1001 x y deltae.dat ξ ξ JPVM java Master x 45
CAPÍTULO 5. PRUEBAS Y RESULTADOS Figura 5.3-F 45. Proceso maestro 46 45 daemons Figura 5.3-F 46. Procesos esclavos
5.3. TIEMPOS DE EJECUCIÓN 2+(1 2)(0.2) = 1. 8 3+(1 3)(0.2) = 2. 6 4+(1 4)(0.2) = 3. 4 Intel 3 Máquina Tiempo Speedup Eficiencia Costo Precio del equipo (aproximado) Pentium IV a 2.4Ghz 25,360 ms 1.0 100% 1 1,000 USD Dual Pentium IV Xeon 2.4Ghz 2 x Pentium IV a 2.4 Ghz conectados por una red de 100Mbps 14,680 ms 1.73 86% 1.16 4,500 USD 17,243 ms 1.47 73% 1.36 2,000 USD 5.3-T 3. Tiempos de ejecución del programa para el flujo bidimensional estacionario sobre la plataforma Windows 4 Máquina Tiempo Speedup Eficiencia Costo CIC-16 1 Procesador 199,015 ms 1.0 100% 1 CIC-16 2 Procesadores 140,405 ms 1.42 71% 1.41 CIC-16 3 Procesadores 100,105 ms 1.99 66% 1.51 CIC-16 4 Procesadores 140,660 ms 1.41 35% 2.83 5.3-T 4. Tiempos de ejecución del programa para el flujo bidimensional estacionario sobre la CIC-16
CAPÍTULO 5. PRUEBAS Y RESULTADOS 5 SUN Sparc Solaris Máquina Tiempo Speedup Eficiencia Costo SUN Sparc 1 Procesador 163,502 ms 1.0 100% 1 Sun Enterprise 4 Procesadores 74,238 ms 2.20 55% 1.82 5.3-T 5. Tiempos de ejecución del programa para el flujo bidimensional estacionario sobre SUN java Master3D ρ u v p T M ron.dat un.dat vn.dat pn.dat Tn.dat Mn.dat
5.3. TIEMPOS DE EJECUCIÓN 2+(1 2)(0.1) = 1. 9 3+(1 3)(0.1) = 2. 8 4+(1 4)(0.1) = 3. 7 Intel 6 Máquina Tiempo Speedup Eficiencia Costo Pentium IV a 2.4Ghz Dual Pentium IV Xeon 2.4Ghz 2 x Pentium IV a 2.4 Ghz conectados por una red de 100Mbps 494,437 ms (8.24 min) 271,668 ms (4.53 min) 305,208 ms (5.10 min) 1.0 100% 1 1.82 91% 1.10 1.62 81% 1.23 5.3-T 6. Tiempos de ejecución del programa para el flujo bidimensional no estacionario sobre la plataforma Windows 7 Máquina CIC-16 1 Procesador Tiempo Speedup Eficiencia Costo 1,460,347 ms (24.34 min) 1.0 100% 1 CIC-16 2 Procesadores CIC-16 3 Procesadores CIC-16 4 Procesadores 815,836 ms (13.60 min) 570,448 ms (9.51 min) 449,513 ms (7.49 min) 1.79 90% 1.12 2.56 85% 1.17 3.25 81% 1.23 5.3-T 7. Tiempos de ejecución del programa para el flujo bidimensional no estacionario sobre la CIC-16 SUN 8
CAPÍTULO 5. PRUEBAS Y RESULTADOS Máquina Tiempo Speedup Eficiencia Costo SUN Sparc 1 Procesador 1,197,005 ms (19.95 min) 1.0 100% 1 Sun Enterprise 4 Procesadores 352,498 ms (5.88 min) 3.40 85% 1.18 5.3-T 8. Tiempos de ejecución del programa para el flujo bidimensional estacionario sobre SUN 47 48 Tiempo (ms) 220,000 200,000 180,000 160,000 140,000 120,000 100,000 80,000 60,000 40,000 20,000 0 Pentium IV 2.4 Ghz Dual Pentium IV Xeon (SMP) 2.4Ghz 2 Procesadores Pentium IV 2.4 Ghz Conectados por una red de 100 Mbps CIC-16 1 Procesador CIC-16 2 Procesadores CIC-16 3 Procesadores CIC-16 4 Procesadores SUN Sparc 1 Procesador SUN Enterprise 4 Procesadores 5.3-F 47. Tiempos de ejecución del programa estacionario Speedup 3.4 3.2 2.8 3 2.6 2.4 2.2 1.8 2 1.6 1.4 1.2 0.8 1 0.6 0.4 0.2 0 Dual Pentium IV Xeon (SMP) 2.4Ghz 2 Procesadores Pentium IV 2.4 Ghz conectados por una red de 100Mbps Máximo speedup (3 procesadores) Máximo speedup (2 procesadores) CIC-16 2 Procesadores Máximo speedup (4 procesadores) CIC-16 CIC-16 3 Procesadores 4 Procesadores SUN Enterprise 4 Procesadores 5.3-F 48. Speedup s del programa estacionario
5.3. TIEMPOS DE EJECUCIÓN Tiempo (ms) 1,600,000 1,500,000 1,400,000 1,300,000 1,200,000 1,100,000 1,000,000 900,000 800,000 700,000 600,000 500,000 400,000 300,000 200,000 100,000 0 Pentium IV 2.4 Ghz Dual Pentium IV Xeon (SMP) 2.4 Ghz 2 Procesadores Pentium IV 2.4 Ghz Conectados por una red de 100 Mbps CIC-16 1 Procesador CIC-16 2 Procesadores CIC-16 3 Procesadores CIC-16 4 Procesadores SUN Sparc 1 Procesador SUN Enterprise 4 Procesadores 5.3-F 49. Tiempos de ejecución del programa no estacionario Speedup 3.5 3 2.5 2 1.5 1 0.5 0 Máximo speedup (2 procesadores) Dual Pentium IV 2 Procesadores CIC-16 Xeon (SMP) Pentium IV 2 Procesadores 2 Ghz 2.4 Ghz Conectados por una red de100 Mbps Máximo speedup (3 procesadores) CIC-16 3 Procesadores Máximo speedup (4 procesadores) CIC-16 4 Procesadores SUN Enterprise 4 Procesadores 5.3-F 50. Speedup s del programa no estacionario 48 SMP 50
CAPÍTULO 5. PRUEBAS Y RESULTADOS SMP 9 x = 200.21 j y,in u, m/s v, m/s kg/m 3 p, N/m 3 T, K M 1 8.0 0.000 5.125E+02 0.000E+00 2.678E+00 2.992E+05 3.891E+02 1.296E+00 2 8.7 0.025 5.055E+02-1.166E+00 2.671E+00 2.994E+05 3.904E+02 1.276E+00 3 9.3 0.050 5.005E+02-2.305E+00 2.682E+00 3.011E+05 3.911E+02 1.262E+00 4 10.0 0.075 4.984E+02-2.370E+00 2.687E+00 3.020E+05 3.914E+02 1.257E+00 5 10.6 0.100 4.983E+02-1.394E+00 2.686E+00 3.017E+05 3.912E+02 1.257E+00 6 11.3 0.125 4.993E+02 3.295E-01 2.677E+00 3.003E+05 3.907E+02 1.260E+00 7 11.9 0.150 5.006E+02 2.143E+00 2.667E+00 2.986E+05 3.901E+02 1.264E+00 8 12.6 0.175 5.011E+02 3.329E+00 2.662E+00 2.979E+05 3.898E+02 1.266E+00 9 13.2 0.200 5.003E+02 3.255E+00 2.669E+00 2.990E+05 3.902E+02 1.263E+00 10 13.9 0.225 4.975E+02 1.599E+00 2.693E+00 3.027E+05 3.916E+02 1.254E+00 11 14.5 0.250 4.934E+02-1.102E+00 2.728E+00 3.083E+05 3.936E+02 1.240E+00 12 15.2 0.275 4.901E+02-3.186E+00 2.756E+00 3.127E+05 3.952E+02 1.230E+00 13 15.8 0.300 4.897E+02-3.276E+00 2.760E+00 3.133E+05 3.954E+02 1.228E+00 14 16.5 0.325 4.916E+02-1.752E+00 2.744E+00 3.108E+05 3.945E+02 1.234E+00 15 17.1 0.350 4.939E+02 6.827E-02 2.724E+00 3.077E+05 3.934E+02 1.242E+00 16 17.8 0.375 4.954E+02 1.237E+00 2.711E+00 3.056E+05 3.926E+02 1.247E+00 17 18.4 0.400 4.959E+02 1.524E+00 2.707E+00 3.049E+05 3.924E+02 1.249E+00 18 19.1 0.425 4.958E+02 1.197E+00 2.707E+00 3.050E+05 3.924E+02 1.249E+00 19 19.7 0.450 4.957E+02 6.841E-01 2.709E+00 3.052E+05 3.925E+02 1.248E+00 20 20.4 0.475 4.957E+02 2.792E-01 2.709E+00 3.053E+05 3.925E+02 1.248E+00 21 21.0 0.500 4.957E+02 1.546E-02 2.709E+00 3.052E+05 3.925E+02 1.248E+00 22 21.7 0.525 4.957E+02-2.583E-01 2.709E+00 3.052E+05 3.925E+02 1.248E+00 23 22.3 0.550 4.958E+02-6.817E-01 2.708E+00 3.052E+05 3.924E+02 1.248E+00 24 23.0 0.575 4.959E+02-1.201E+00 2.707E+00 3.050E+05 3.924E+02 1.249E+00 25 23.6 0.600 4.959E+02-1.515E+00 2.707E+00 3.049E+05 3.923E+02 1.249E+00 26 24.3 0.625 4.954E+02-1.216E+00 2.711E+00 3.056E+05 3.926E+02 1.247E+00 27 24.9 0.650 4.939E+02-7.966E-02 2.724E+00 3.076E+05 3.933E+02 1.242E+00 28 25.6 0.675 4.917E+02 1.628E+00 2.743E+00 3.106E+05 3.944E+02 1.235E+00 29 26.2 0.700 4.900E+02 3.028E+00 2.757E+00 3.129E+05 3.952E+02 1.229E+00 30 26.9 0.725 4.904E+02 3.005E+00 2.754E+00 3.124E+05 3.951E+02 1.231E+00 31 27.5 0.750 4.933E+02 1.162E+00 2.729E+00 3.084E+05 3.936E+02 1.240E+00 32 28.2 0.775 4.973E+02-1.430E+00 2.695E+00 3.031E+05 3.917E+02 1.253E+00 33 28.8 0.800 5.001E+02-3.145E+00 2.671E+00 2.993E+05 3.903E+02 1.263E+00 34 29.5 0.825 5.011E+02-3.295E+00 2.663E+00 2.980E+05 3.898E+02 1.266E+00 35 30.1 0.850 5.006E+02-2.164E+00 2.667E+00 2.987E+05 3.900E+02 1.264E+00 36 30.8 0.875 4.994E+02-4.035E-01 2.677E+00 3.002E+05 3.906E+02 1.260E+00 37 31.4 0.900 4.985E+02 1.252E+00 2.685E+00 3.015E+05 3.911E+02 1.257E+00 38 32.1 0.925 4.988E+02 2.225E+00 2.687E+00 3.018E+05 3.912E+02 1.258E+00 39 32.7 0.950 5.018E+02 2.176E+00 2.681E+00 3.009E+05 3.908E+02 1.266E+00 40 33.4 0.975 5.115E+02 1.183E+00 2.672E+00 2.994E+05 3.902E+02 1.291E+00 41 34.0 1.000 5.106E+02 0.000E+00 2.678E+00 2.992E+05 3.891E+02 1.296E+00 9 x = 200.21