Skip to content

A C implementation of Agrawal-Kayal-Saxena (AKS) primality test algorithm.

Notifications You must be signed in to change notification settings

brhamon/aks-primality-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aks-primality-test

A C implementation of Agrawal–Kayal–Saxena (AKS) primality test algorithm.

Requires GMP library to handle big numbers.

A Makefile for linux-gnu is included. The code should work in multiple additional platforms and compilers.

Author

Ting Liu ([email protected])

Building

To use OpenMP support:

make
make test

To disable OpenMP, and build single-threaded:

PARALLEL=false make clean all
make test

To experiment with different thread counts, build with OpenMP, and set the following environment variable when running:

OMP_NUM_THREADS=4 ./aks selected.txt

When OMP_NUM_THREADS is not set, it defaults to the number returned by the command:

grep -c ^processor /proc/cpuinfo

References

Manindra Agrawal, Neeraj Kayal, Nitin Saxena, PRIMES is in P, Annals of Mathematics 160(2): 781-793, 2004. The original version of the paper is here.

OpenMP :: Resources :: Tutorials

About

A C implementation of Agrawal-Kayal-Saxena (AKS) primality test algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.4%
  • Makefile 4.6%