I am using the python multiprocessing module to run a single process on multiple cores, but I want to run several independent processes in parallel. For ex - Process one analyzes a large file, processes two search patterns in different files, and process 3 performs some calculations; can all three different processed files that have different arguments be parallel?
def Process1(largefile):
Parse large file
runtime 2hrs
return parsed_file
def Process2(bigfile)
Find pattern in big file
runtime 2.5 hrs
return pattern
def Process3(integer)
Do astronomical calculation
Run time 2.25 hrs
return calculation_results
def FinalProcess(parsed,pattern,calc_results):
Do analysis
Runtime 10 min
return final_results
def main():
parsed = Process1(largefile)
pattern = Process2(bigfile)
calc_res = Process3(integer)
Final = FinalProcess(parsed,pattern,calc_res)
if __name__ == __main__:
main()
sys.exit()
Process1 Process2 Process3 , . 2 + 2,5 + 2,25 = 6,75 . ? /, (Process2) , Final Process.
.
AK