I want to run say 10 tasks, in different cpus of same function with different 10 parameters (10 tasks) each run on different cpu. how do i do it using openmp in python code. For some reasons mpi4py and multiprocessing packages are blocked in local cluster. So i am wondering, whether i can parallelize the code using openmp alone.
what i tried:
import numpy as np
import time
t1_start = time.process_time()
def func(a):
print("helloworld")
for b in range(max):
obs = func(b)
print(time.process_time()-t1_start)
i want obs = func(b) to run on different processors assigned automatically for a range of values. In mpi4y package, i can use MPI.scatter() to do this automatically. But i don't know whether it is possible to do the same with openmp alone.
or b in range(max)loop in a C function which you then make OpenMP parallel.