Added command line parameter to accept the number of threads. 

The number of threads can be passed as an optional third parameter. If it is omitted a smart default is used.

call with:
ljmd-cl.x device [thread-number] < input