-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I tried putting a barrier after each prime is broadcasted and after all are broadcasted by the generator and the two runs yield different results:
(one barrier at the end, commented code in the source)
Running an example with parameters N=100000000(10^8) M=8
6250000 : 3 12500001 6250048
6250000 : 25000003 37500001 6250048
6250000 : 12500003 25000001 6250048
6250000 : 75000003 87500001 6250048
6250000 : 37500003 50000001 6250048
6250000 : 62500003 75000001 6250048
6250000 : 50000003 62500001 6250048
6250000 : 87500003 100000001 6250048
Computation of 5776249 primes (wrong number!!)
real 0m0.813s
user 0m5.548s
sys 0m0.340s
(one barrier after each prime number used to sieve)
Running an example with parameters N=100000000 (10^8) M=8
6250000 : 3 12500001 6250048
6250000 : 87500003 100000001 6250048
6250000 : 37500003 50000001 6250048
6250000 : 25000003 37500001 6250048
6250000 : 75000003 87500001 6250048
6250000 : 62500003 75000001 6250048
6250000 : 12500003 25000001 6250048
6250000 : 50000003 62500001 6250048
Computation of 5761455 primes (correct number)
real 0m1.408s
user 0m4.836s
sys 0m0.676s
I've tried to figure out if there's is a mistake in the sieving logic, but this change alone solves the correctness issue which might mean that multiple messages to the same actor are not sequential!