I would like to use the most trivial example of parallelism in python and I am failing to understand how to do this from the multiprocessing documentation.
Here is some sample toy code that shows what I would like do.
import igraph
n = 10
g = igraph.Graph()
g.add_vertices(n)
h= igraph.Graph()
h.add_vertices(n)
[add some nodes and edges to g and h]
print "h omega is ", h.omega()
print "g alpha is", g.alpha()
I would like the last two lines to run in parallel as I have multiple cores and they take a long time to run. Each one simply outputs an integer and I don't care which order I get the results in.
Is there a simple way to do this python?