Skip to content

Instantly share code, notes, and snippets.

@cmd-ntrf
Last active December 14, 2015 01:38
Show Gist options
  • Save cmd-ntrf/5007185 to your computer and use it in GitHub Desktop.
Save cmd-ntrf/5007185 to your computer and use it in GitHub Desktop.
Example of the distribution of an instance method from a Cython class object with SCOOP. It uses the Benchmark class defined by pycec2013 available here : https://bitbucket.org/CmdNtrf/niching-benchmark-cec2013
import array
import pycec2013
from scoop import futures
if __name__ == "__main__":
bench = pycec2013.Benchmark(1)
pop = [array.array('d', [1.0]), array.array('d', [2.0]), array.array('d', [3.0])]
print(list(futures.map(bench.evaluate, pop)))
# print(list(map(bench.evaluate, pop)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment