|
@@ -202,7 +202,6 @@ print("--(multi_2arr)(A, B)")
|
|
|
n, m = 4, 5
|
|
|
A = np.arange(n*m).reshape(n, m)
|
|
|
B = np.arange(n*m, 2*n*m, 1).reshape(n, m)
|
|
|
-print("The input arrays are A", A, "B", B)
|
|
|
start_exec6=time.time()
|
|
|
start_cpu6=time.process_time()
|
|
|
starpu.joblib.Parallel(mode="normal", n_jobs=-1, perfmodel="multi_2arr")(starpu.joblib.delayed(multi_2arr)(A, B))
|
|
@@ -210,7 +209,6 @@ end_exec6=time.time()
|
|
|
end_cpu6=time.process_time()
|
|
|
print("the program execution time is", end_exec6-start_exec6)
|
|
|
print("the cpu execution time is", end_cpu6-start_cpu6)
|
|
|
-print("The return arrays are A", A, "B", B)
|
|
|
|
|
|
print("--(scal)(2, t=(j for j in a))")
|
|
|
a=np.arange(N)
|
|
@@ -224,7 +222,6 @@ print("the cpu execution time is", end_cpu7-start_cpu7)
|
|
|
|
|
|
print("--(scal)(2,A)")
|
|
|
A=np.arange(N)
|
|
|
-print("The input array is", A)
|
|
|
start_exec8=time.time()
|
|
|
start_cpu8=time.process_time()
|
|
|
starpu.joblib.Parallel(mode="normal", n_jobs=-1, perfmodel="scal")(starpu.joblib.delayed(scal)(2,A))
|
|
@@ -232,12 +229,10 @@ end_exec8=time.time()
|
|
|
end_cpu8=time.process_time()
|
|
|
print("the program execution time is", end_exec8-start_exec8)
|
|
|
print("the cpu execution time is", end_cpu8-start_cpu8)
|
|
|
-print("The return array is", A)
|
|
|
|
|
|
print("--(add_scal)(t1=A,t2=B,a=2)")
|
|
|
A=np.arange(N)
|
|
|
B=np.arange(N)
|
|
|
-print("The input arrays are A", A, "B", B)
|
|
|
start_exec9=time.time()
|
|
|
start_cpu9=time.process_time()
|
|
|
starpu.joblib.Parallel(mode="normal", n_jobs=-1, perfmodel="add_scal")(starpu.joblib.delayed(add_scal)(t1=A,t2=B,a=2))
|
|
@@ -245,7 +240,6 @@ end_exec9=time.time()
|
|
|
end_cpu9=time.process_time()
|
|
|
print("the program execution time is", end_exec9-start_exec9)
|
|
|
print("the cpu execution time is", end_cpu9-start_cpu9)
|
|
|
-print("The return arrays are A", A, "B", B)
|
|
|
|
|
|
|
|
|
print("--input is iterable function list")
|
|
@@ -271,35 +265,39 @@ async def main():
|
|
|
print("--(sqrt)(i**2)for i in range(N)")
|
|
|
fut1=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="sqrt")(starpu.joblib.delayed(sqrt)(i**2)for i in range(N))
|
|
|
res1=await fut1
|
|
|
- #print(res1)
|
|
|
+ print("The result is", sum(res1,[]))
|
|
|
|
|
|
print("--(multi)(i,j) for i,j in zip(a,b)")
|
|
|
a=np.arange(N)
|
|
|
b=np.arange(N, 2*N, 1)
|
|
|
+ print("The inputs are a", a, "b", b)
|
|
|
fut2=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="multi")(starpu.joblib.delayed(multi)(i,j) for i,j in zip(a,b))
|
|
|
res2=await fut2
|
|
|
- #print(res2)
|
|
|
+ print("The result is", sum(res2,[]))
|
|
|
|
|
|
print("--(scal_arr)((i for i in b), A)")
|
|
|
A=np.arange(N)
|
|
|
b=np.arange(N, 2*N, 1)
|
|
|
+ print("The input arrays are A", A, "b", b)
|
|
|
fut3=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="scal_arr")(starpu.joblib.delayed(scal_arr)((i for i in b), A))
|
|
|
res3=await fut3
|
|
|
- #print(res3)
|
|
|
+ print("The return array is", np.concatenate(res3))
|
|
|
|
|
|
print("--(multi_list)((i,j) for i,j in zip(a,b))")
|
|
|
a=np.arange(N)
|
|
|
b=np.arange(N, 2*N, 1)
|
|
|
+ print("The input lists are a", a, "b", b)
|
|
|
fut4=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="multi_list")(starpu.joblib.delayed(multi_list)((i,j) for i,j in zip(a,b)))
|
|
|
res4=await fut4
|
|
|
- #print(res4)
|
|
|
+ print("The result is", sum(res4,[]))
|
|
|
|
|
|
print("--(multi_2arr)((i for i in a), (j for j in b))")
|
|
|
a=np.arange(N)
|
|
|
b=np.arange(N, 2*N, 1)
|
|
|
+ print("The input lists are a", a, "b", b)
|
|
|
fut5=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="multi_2arr")(starpu.joblib.delayed(multi_2arr)((i for i in a), (j for j in b)))
|
|
|
res5=await fut5
|
|
|
- #print(res5)
|
|
|
+ print("The result is", sum(res5,[]))
|
|
|
|
|
|
print("--(multi_2arr)(b=B, a=A)")
|
|
|
A=np.arange(N)
|
|
@@ -307,21 +305,22 @@ async def main():
|
|
|
print("The input arrays are A", A, "B", B)
|
|
|
fut6=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="multi_2arr")(starpu.joblib.delayed(multi_2arr)(b=B, a=A))
|
|
|
res6=await fut6
|
|
|
- print("The return arrays are A", A, "B", B)
|
|
|
+ print("The return array is", np.concatenate(res6))
|
|
|
|
|
|
|
|
|
print("--(scal)(2, (j for j in a))")
|
|
|
a=np.arange(N)
|
|
|
+ print("The input list is a", a)
|
|
|
fut7=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="scal")(starpu.joblib.delayed(scal)(2, (j for j in a)))
|
|
|
res7=await fut7
|
|
|
- #print(res6)
|
|
|
+ print("The result is", sum(res7,[]))
|
|
|
|
|
|
print("--(scal)(2,t=A)")
|
|
|
A=np.arange(N)
|
|
|
print("The input array is", A)
|
|
|
fut8=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="scal")(starpu.joblib.delayed(scal)(2,t=A))
|
|
|
res8=await fut8
|
|
|
- print("The return array is", A)
|
|
|
+ print("The return array is", np.concatenate(res8))
|
|
|
|
|
|
print("--(scal)(2,A,B)")
|
|
|
A=np.arange(N)
|
|
@@ -329,7 +328,7 @@ async def main():
|
|
|
print("The input arrays are A", A, "B", B)
|
|
|
fut9=starpu.joblib.Parallel(mode="future", n_jobs=-1, perfmodel="add_scal")(starpu.joblib.delayed(add_scal)(2,A,B))
|
|
|
res9=await fut9
|
|
|
- print("The return arrays are A", A, "B", B)
|
|
|
+ print("The return array is", np.concatenate(res9))
|
|
|
|
|
|
print("--input is iterable function list")
|
|
|
fut10=starpu.joblib.Parallel(mode="future", n_jobs=-1)(g_func)
|