Some examples are provided in the standard distribution. Each example is followed by a Makefile
which provides the commands to translate(generate stub code) the CnC graph, compile the generated and user code, and finally run the program. Running make all
should run each of these steps in the examples.
Once successfully installed, please refer to the examples on how to write CnC-Scala programs. The two simplest examples to get started are:
- Partition String: finds the odd length repeating fragments from the input string
- Find Primes: finds all odd numbers which are primes up to the given input
These are steps required to write a CnC-Scala program from scratch:
- Provide a definition of the CnC computation graph
- Generate the stub code for the CnC Graph, Steps and Tag Collections using
cnc_scala_translate
command - Provide implementations for the Steps
- Write a main method to initialize the CnC graph and start the computation
- Compile the generated and custom code using
cnc_scala_compile
command - Run the compiled program using
cnc_scala_run
command