|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
This page takes you from a source checkout to a running Psyclone system in a few minutes. Everything here uses the shipped Examples project — the same code you will later copy to start your own modules.
Follow Compiling and linking with the CMSDK library for the full build instructions. The short version:
The build produces the Psyclone executable plus at least two shared libraries in bin/<arch> (win32, win64, linux32, linux64):
The quickest possible check needs no configuration at all. From the bin/<arch> directory the build just produced (where the Psyclone executable sits next to the Examples library), run:
./Psyclone psytest
This auto-generates a PsySpec with modules, whiteboards and catalogs from the Examples library and runs a self-test on a single node. psytest=N spawns N nodes on the local machine and spreads the test modules across them. The full test architecture is in Examples/psytest.xml and Examples/src/PsyTest.cpp.
The smallest interesting system is two modules batting messages back and forth. This is the complete PsySpec (Examples/pingpong.xml):
Reading it top to bottom:
The crank code behind it lives in Examples/src/Examples.cpp. The essential shape of every crank is:
shouldContinue() asks the system whether the crank should keep running, waitForNewMessage() blocks (here up to 100 ms) for the next trigger, and postOutputMessage() posts through the named <post> entry in the PsySpec — the crank never needs to know the destination or the message type. See Writing a Module (Crank) for the full story.
Run it from the Examples directory:
./Psyclone spec=pingpong.xml
You will see the Ping module logging its message-per-microsecond statistics, then the system shutting itself down. Use port=<port> to run on something other than the default port 10000.
Every Psyclone node serves a web-based monitoring interface, PsyProbe, using the CMSDK's built-in HTTP server (cmlabs::NetworkManager). While a system is running, open:
http://localhost:10000
(or whatever host/port the node runs on). PsyProbe shows the nodes, spaces, modules, whiteboards and catalogs of the running system, lets you inspect message traffic, filter whiteboard contents by type patterns (My.Namespace.*), and post messages manually — invaluable for verifying that your triggers and posts are wired the way you think they are. The ping-pong system is over too quickly to watch; try ./Psyclone spec=psyprobe.xml (a steadily-active system built precisely for browsing in PsyProbe, see Examples/psyprobe.xml and Examples Index) and browse while it runs.