Factoring N with MPI and GMP - The Steps


  1. Check that 2 is not a factor of N .

  2. Create a "shared memory" buffer of one integer, initialized to -1.

  3. Split the odd numbers between 3 and N1/2 into Chunks, sending each to a separate Task. Each Task tries to find a factor of N. Checking that the contents of the shared buffer is still -1.

  4. The Task that finds a factor sets the value of the shared buffer to its rank.