Skip to content

C implementation of an exhaustive method of checking the Collatz Conjecture

Notifications You must be signed in to change notification settings

kieselnb/CollatzConjecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CollatzConjecture

This project is an exhaustive check of numbers against the Collatz Conjecture (explained here).

Although the usefulness of this project is very questionable, it's become a great source of coding practice for myself.

Requirements

  • CMake
  • Boost
  • CUDA (only if building/running the CUDA executable)

Building

This project uses CMake, so build using this format after cloning:

mkdir build
cd build
cmake ..
make

By default, this will build the C and C++ versions of the code. To enable build of the CUDA executable, turn on the Collatz_CUDA flag using either ccmake . or cmake .. -DCollatz_CUDA=ON.

Running

C++

To run the C++ version, run the built CollatzConjectureCPP executable. This executable can take the following options:

  -h [ --help ]         Display this message
  -n [ --numproc ] arg  Number of cpu threads to use
  -s [ --server ] arg   Start a CollatzServer on this machine
  -c [ --client ] arg   Point this machine as a client to the given server
Server/Client Operation

To start an executable in the serving mode, run with the option -s <port>, where port is the number of the port you want to serve from. To connect a client to this server, run with the option -c <ip:port>, where ip is the address of the machine running the server and port is the port number the server was told to serve from.

C

The C executable is not built with client/server capabilities, even though it claims it is. Run it with the option --server <port> to get it to run, but it will not serve anything. This executable, being the original, is just called CollatzConjecture.

CUDA

The CUDA version of the conjecture is also a standalone application, and acts like it. Run it by executing the CollatzConjectureCUDA executable.

Documentation

The C++ code has adopted a Doxygen-compatible documentation standard, so documentation can be generated by just running Doxygen in the checkout directory.

About

C implementation of an exhaustive method of checking the Collatz Conjecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published