Hi everyone,
Firstly I just want to state that I think the concept of scoop is great.
Secondly just as the subject heading suggests, I wanted to know if you can nest calls to futures.map.
My use case is doing a parameter sweep of a DEAP genetic algorithm on a cluster.
In an outer-loop I want to iterate through different values of GA population sizes, and random number seeds. However a part of the GA specifically the evaluate function is also able to be distributed with futures.map.
If I do a nested call to futures.map can these sub-processes be launched on an entirely different pool of hosts/CPUs?
Can I some how specify how many CPUs each call to futures.map takes, and also their rank/id/worker_number?
Thanks a lot for any advice:). Also in the code below I was playing around
from scoop import futures
def helloWorld(value):
print utils.getCPUcount() #me desperately trying to find a function that will return the worker id
print utils.getHosts() #me desperately trying to find a function that will return the worker id
return "Hello World from Future #{}".format(value)
def helloWorld_nested(value):
returnValues = futures.map(helloWorld, range(5))
print("\n".join(returnValues))
return "Hello World from Future nested #{}".format(value)
if __name__ == "__main__":
returnValues = futures.map(helloWorld_nested, range(5))
print("\n".join(returnValues))