• CnC-Python Partition String Example
Skip to end of metadata
Go to start of metadata

Please refer to the Find-Primes example before starting with this example.

First, define the CnC graph for the partition string example:

PartitionString.cnc

This graph is a little more interesting than the Find-Primes example since it has two Steps: createSpan and processSpan. createSpan produces Items for the span Item Collection. This in turn trigger the prescription of the processSpan step which writes results to the results Item Collection. The environment reads off these values from the results Item Collection.

Next, run the CnC-Python translator:

Next, we need to provide the python implementations for the Steps using the generated templates (as explained in the Find-Primes example ). Note the implementation of the createAwaitsList function in both the python Step classes which defines the input dependences on values from the Item Collections.

userPartitionStringApp.py
userCreateSpanStep.py
userProcessSpanStep.py

Running this program with an input of lllllllllaaaaaaaammmmmmmeeeeeeeeeeeeeee should produce the following output:

  • No labels