I need to pass a variable to the setup() method of dispy node so i can tell the node which data set to load from a config file. Else i have to write a specific script for each data set and this is going to be painful.
def setup(): # executed on each node before jobs are scheduled
# read data in file to global variable
global data
data = open('file.dat').read()
return 0
...
if __name__ == '__main__':
import dispy
cluster = dispy.JobCluster(compute, depends=['file.dat'], setup=setup, cleanup=cleanup)
So i want to pass the string "file.dat"
to setup so each node can instantiate the data once (as its large).