I have this project I'm working on and I'm trying to implement multiprocessing. I can't quite get it to work because the function I'm trying to have it run requires multiple arguments. Basically, there are sites that processDFStandardCurve processes and that is the only variable that changes in each test that multiprocess would be running. Those different site names are stored as siteIDList.
def multiprocess (cursor, testsDict, optionsDict, outputPath, calculated_pdf, stationToPriority, result):
siteIDList = []
for line in result:
siteID = line[3]
nbsNum = line[2]
if siteID != "":
siteIDList.append(siteID)
else:
siteIDList.append(nbsNum)
p = multiprocessing.Pool()
p.starmap(processDFStandardCurve, siteIDList, cursor, testsDict, optionsDict, outputPath, calculated_pdf, stationToPriority)
processDFStandardCurve is as follows:
def processDFStandardCurve(cursor, siteID, testsDict, optionsDict, outputPath, calculated_pdf, stationToPriority):
It all stops after the p.map() call.
When using starmap it throws this error
TypeError: starmap() takes from 3 to 4 positional arguments but 9 were given