This material has **4** associated documents. Select a document title to view a document's information.

*
written by
Wolfgang Christian
*

The Concurrent Prime Number Test Model uses the trial division algorithm to decide if a number is prime. The prime division algorithm is inefficient and we use it here only to test the EJS implementation of the Parallel Region Element in EJS. A parallel region executes independent code in threads that execute simultaneously on a multi-core processor. The screen capture shows that the total execution time for four computations on a quad-core processor is only one millisecond longer than the execution time for the longest single computation. This linear speedup is close to the theoretical maximum.

The Concurrent Prime Number Test Model was created using the Easy Java Simulations (EJS) modeling tool. It is distributed as a ready-to-run (compiled) Java archive. Double clicking the model's jar file will run the simulation if Java is installed.

**Download**- 1133kb Java Archive File*ejs_parallel_math_PrimeNumberTestingConcurrent.jar*

Last Modified *June 3, 2014*

*
This file has previous versions.
*

The Sequential Prime Number Test model uses the prime division algorithm to decide if a number is prime. The model records the computational time in milliseconds required to test each number and total computational time. The model shows that the total computational time is approximately equal to the sum of the individual times because the tests are performed sequentially.

**Download**- 899kb Java Archive File*ejs_math_PrimeNumberTestingSequential.jar*

Last Modified *October 11, 2013*

*
*

The source code zip archive contains an XML representation of the Parallel Region Prime Number Computation Model. Unzip this archive in your Ejs workspace to compile and run this model using EJS.

**Download**- 37kb Compressed File*ejs_parallel_math_PrimeNumberTestingConcurrent.zip*

Last Modified *October 15, 2013*

*
This file has previous versions.
*

The source code zip archive contains an XML representation of the Sequential Prime Number Test Model. Unzip this archive in your EJS workspace to compile and run this model using EJS.

**Download**- 20kb Compressed File*ejs_math_PrimeNumberTestingSequential.zip*

Last Modified *October 11, 2013*

*
*