Ley de Amdahl y Gustafson

Ley de Amdahl y Gustafson#

Ley de Amdahl#

import numpy as np
import matplotlib.pyplot as plt
N=np.linspace(1,100,100)
F1=0.1
F2=0.3
F3=0.5
F4=0.9
S1=N/(N*F1+1-F1)
S2=N/(N*F2+1-F2)
S3=N/(N*F3+1-F3)
S4=N/(N*F4+1-F4)
plt.plot(N,S1,N,S2,N,S3,N,S4)
plt.title("Ley Amdlah")
plt.xlabel("#Procesadores")
plt.ylabel("Speed-Up o Aceleración")
plt.grid(True)
../../_images/8f9e1f2eeefce0f2ed1ccffc0ddf824e9eb3c554af298c1a1dec1751dc4c8d0a.png
E1=1/(N*F1+1-F1)
E2=1/(N*F2+1-F2)
E3=1/(N*F3+1-F3)
E4=1/(N*F4+1-F4)
plt.plot(N,E1,N,E2,N,E3,N,E4)
plt.title("Ley Amdlah")
plt.xlabel("#Procesadores")
plt.ylabel("Eficiencia")
plt.grid(True)
../../_images/667ee54f54f9ea336ac86fff7a0d5cee5d0a7c8479c30953414b54418342cd5b.png
F=np.linspace(0,1,100)
N1=10
N2=20
N3=50
S1=N1/(N1*F+1-F)
S2=N2/(N2*F+1-F)
S3=N3/(N3*F+1-F)
plt.plot(F,S1,F,S2,F,S3)
plt.title("Ley Amdlah")
plt.xlabel("Fraccion no paralelizable - F")
plt.ylabel("Speed-Up o Aceleración")
plt.grid(True)
../../_images/d0914e103cc553be7838b7bb1395d5f7795a9a402e53c1701ab7ab2f8b553e5a.png

Ley de Gustafson#

F=np.linspace(0,1,10)
N1=10
N2=20
S1=F+N1*(1-F)
S2=F+N2*(1-F)
plt.plot(F,S1,F,S2)
plt.title("Ley Gustafson")
plt.xlabel("Fracción no paralela")
plt.ylabel("Speed-Up o Aceleración")
plt.grid(True)
../../_images/71dd67475d676527b45d48c6e507fb91500e2d1b2e4484baa6e2ef72f8fa0156.png
N=np.linspace(1,100,100)
F1=0.1
F2=0.3
F3=0.5
F4=0.9
S1=F1+N*(1-F1)
S2=F2+N*(1-F2)
S3=F3+N*(1-F3)
plt.plot(N,S1,N,S2,N,S3)
plt.title("Ley Gustafson")
plt.xlabel("#Procesadores")
plt.ylabel("Speed-Up o Aceleración")
plt.grid(True)
../../_images/aa9cb952a78637cdcf25159c7c8c40697bcd04c34a82042f92d104dffe4c493b.png
E1=S1/N
E2=S2/N
E3=S3/N
E4=S4/N
plt.plot(N,E1,N,E2,N,E3,N,E4)
plt.title("Ley Gustafson")
plt.xlabel("#Procesadores")
plt.ylabel("Eficiencia")
plt.grid(True)
../../_images/176f151456173218803606ec182f527745151db961438c4ae4fcae140cb6bf84.png