You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I run separate mvp solver instances in different threads simultaneously? I tried using python's multiprocessing module for this. Every time I keep the number of processes/threads as 1, it works as expected but when I increase the number of threads, I get this error: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpp105vrd2/1.tmp'
Here's the code for reference:
from pyvpsolver import VPSolver, MVP
def func(i):
instance = MVP.from_file('demo.mvp')
out, solution = VPSolver.script(
"vpsolver_gurobi.sh", instance, verbose=False, options="Threads=12"
)
print(solution)
from multiprocessing import Pool
def run_parallel():
list_ranges = [i for i in range(2)]
pool = Pool(processes=len(list_ranges))
pool.map(func, list_ranges)
if __name__ == '__main__':
run_parallel()
Can I run separate mvp solver instances in different threads simultaneously? I tried using python's multiprocessing module for this. Every time I keep the number of processes/threads as 1, it works as expected but when I increase the number of threads, I get this error:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpp105vrd2/1.tmp'
Here's the code for reference:
MVP file (demo.mvp)
The text was updated successfully, but these errors were encountered: