Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_t_serial(n, c):
- return (20*(n**2)+c)
- def get_t_parallel(n, c, p):
- return ((20*(n**2))/p + c + 100*p)
- def get_speedup(n, c, p):
- t_serial = get_t_serial(n, c)
- t_parallel = get_t_parallel(n, c, p)
- return t_serial/t_parallel
- def get_efficiency(n, c, p):
- t_serial = get_t_serial(n, c)
- t_parallel = get_t_parallel(n, c, p)
- return t_serial/(t_parallel*p)
- def main():
- C = 100
- x = 6
- for y in range(9):
- print("N: 2^", x, "| P: 2^", y, "| Speedup:", get_speedup(2**x, C, 2**y), "| Efficiency:", get_efficiency(2**x, C, 2**y))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement