I have a program that needs to create several graphs, with each one often taking hours. Therefore I want to run these simultaneously on different cores, but cannot seem to get these processes to run with the multiprocessing
module. Here is my code:
if __name__ == '__main__':
jobs = []
for i in range(5):
p = multiprocessing.Process(target=full_graph)
jobs.append(p)
p.start()
(full_graph()
has been defined earlier in the program, and is simply a function that runs a collection of other functions)
Note: All output goes to .txt files
If it helps, here is the output of the code (with the actual file locations changed):
runfile('file location', wdir='file directory')
Having given this output, the program still outputs nothing to the text file, and I have verified that the function that is being run works by itself. I have tried a few other methods, but this is the only one so far that has given an output. I am using the Spyder IDE with WinPython 3.6.3