I'll try your way. But like @seaandsailor was saying it could be that I'm not doing enough on each worker? Turbo thanks for code I'll try. 
-
-
OK, so I don't actually understand your way, sorry. You have to bear in mind I used multiprocessing for the first time yesterday.
1 reply 0 retweets 0 likes -
for example where you define your arguments why are you using itertools.product?
1 reply 0 retweets 0 likes -
does that mean I have to use itertools.combinations? my loop is outside all this... hmm...
2 replies 0 retweets 0 likes -
Replying to @o_guest @seaandsailor
my point is that you don't need to use the loop. I use itertools because I want all combinations of lists A and B.
1 reply 0 retweets 1 like -
map will take care of splitting your array of arguments and combine the results for you.
1 reply 0 retweets 1 like -
-
sorry I don't get how to use combinations to get what I want into a single array — and then the function has to accept the whole array?
2 replies 0 retweets 0 likes -
Replying to @o_guest @seaandsailor
nop. In your case you actually need something like: results = mp.starmap(calculate_pairwise_distance, combinations(X,X)).
2 replies 0 retweets 0 likes -
Replying to @draxus @seaandsailor
OK will keep trying — is this way equivalent to your way? Because sadly it's extremely slow: https://gist.github.com/jfsantos/8184653991558e30a9eab8613a6ea20f …
1 reply 0 retweets 0 likes
ah I think mp.starmap is python 3
sadly python3 is something I haven't got working with numpy
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.