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.
- CMake
- Boost
- CUDA (only if building/running the CUDA executable)
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
.
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
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.
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
.
The CUDA version of the conjecture is also a standalone application, and acts
like it. Run it by executing the CollatzConjectureCUDA
executable.
The C++ code has adopted a Doxygen-compatible documentation standard, so documentation can be generated by just running Doxygen in the checkout directory.