Open vlad-serbanescu opened 10 years ago
This issue is the same as the example that Keyvan wanted to formulate to show the order of messages that are received. Please make sure that you use similar Configuration
to initialize the context for the actors as in this line.
It's exactly how I initialized it, I have to look and see again, but I still get the same concurrency issue. And that is the only change.
2014-06-17 5:50 GMT+02:00 Behrooz Nobakht notifications@github.com:
This issue is the same as the example that Keyvan wanted to formulate to show the order of messages that are received. Please make sure that you use similar Configuration to initialize the context for the actors as in this line https://github.com/CrispOSS/abs-api-prime-sieves/blob/master/src/main/java/abs/api/primesieves/Generator.java#L37 .
— Reply to this email directly or view it on GitHub https://github.com/CrispOSS/abs-api-prime-sieves/issues/1#issuecomment-46264701 .
Vlad Nicolae Serbanescu
That's actually my point. Please ask Keyvan to provide those bootstrap lines that I provided to use a different inbox.
On Tuesday, June 17, 2014, vlad-serbanescu notifications@github.com wrote:
It's exactly how I initialized it, I have to look and see again, but I still get the same concurrency issue. And that is the only change.
2014-06-17 5:50 GMT+02:00 Behrooz Nobakht <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');>:
This issue is the same as the example that Keyvan wanted to formulate to show the order of messages that are received. Please make sure that you use similar Configuration to initialize the context for the actors as in this line < https://github.com/CrispOSS/abs-api-prime-sieves/blob/master/src/main/java/abs/api/primesieves/Generator.java#L37>
.
— Reply to this email directly or view it on GitHub < https://github.com/CrispOSS/abs-api-prime-sieves/issues/1#issuecomment-46264701>
.
Vlad Nicolae Serbanescu
— Reply to this email directly or view it on GitHub https://github.com/CrispOSS/abs-api-prime-sieves/issues/1#issuecomment-46289368 .
-- Behrooz Nobakht
Even after adding the bootstrap lines I get the same incorrect numbers.
private static final Configuration config = Configuration .newConfiguration() .withInbox(new DispatchInbox(Executors.newWorkStealingPool())) .build(); private final Context context = new LocalContext();
I updated here the latest version with this addition.
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!