# Talk:Parallel calculations

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

## Python example?

Sure looks to me as if it is outputting the smallest factor (of a list of numbers). Which I don't think is what the task is asking for.

Hint: look-up `map` in the Python reference. P.S. please sign your edits here, thanks. --Paddy3118 07:13, 21 December 2010 (UTC)
I didn't doubt the parallelism. My intention for the task was that to have multiple threads/processes do some parallel calculations (factorize the numbers), and then have the main process receive the results, and proceed with other calculations based on the results. Finding an extremum in these numbers is just an example, the main process might well want to do other things with the returned lists. The current Python solution is different in that it respect: It searches for the minimum already in the sub-process (returning a single number from lowest_factor), but this is not what the task asks for: Return that number and its prime factors. --Abu 09:02, 21 December 2010 (UTC)
Hi Abu, the lowest factors of each of the numbers are returned to the main process where the minimum is then found. A full prime factorization of the numbers seems wasteful given the task description and that the smallest prime factor is computed first.
Should you the modify the task to state explicitely that all prime factors should be returned or should you keep this aspect un-specified? I, (of course), think that the current task keeps the focus on the parallelism and that specifying that all factors should be computed when only the smallest is needed goes against your need for speed. --Paddy3118 10:28, 21 December 2010 (UTC)
Hi Paddy, I don't want to be picky, but task already does that. It says "... and return that number and its prime factors". The two solutions so far seem to do that, and I didn't think it would be a problem to change the Python version accordingly. It isn't even necessary to write a new function, just call the solution in the Prime decomposition task. --Abu 10:46, 21 December 2010 (UTC)
Not Picky - necessarily exacting! I missed the import of the final s in your quote above. Thanks. I will fix it.