Version 6 (modified by jorisborgdorff, 12 years ago) (diff)

--

MUSCLE tutorials

There are some examples provided within the MUSCLE bundle. Example code for kernels can be found in the directories src/java/examples and src/cpp/examples. There are also prepared configurations for coupled examples CxA (MUSCLE simulations), which can be found in the src/cxa directory.

Running SimpleExample

Sender
In src/java/examples/simplejava/Sender.java we provide a minimalist kernel written in Java, which sends data (an array of double).
Receiver
In src/java/examples/simplejava/ConsoleWriter.java we provide a simple kernel written in Java. It receives data (an array of double) and prints its content to the standard output.
CxA (coupling schema)
The configuration src/cxa/SimpleExample.cxa.rb configures a minimal CxA which couples the examples.simplejava.Sender and examples.simplejava.ConsoleWriter kernels.
Execution
To run the simulation defined in src/cxa/SimpleExample.cxa.rb use the following command:
muscle2 --cxa src/cxa/SimpleExample.cxa.rb --main --allkernels
or in shorthand notation
muscle2 -c src/cxa/SimpleExample.cxa.rb -am
It will first start the Simulation Manager, of which one per simulation is necessary, and then the local manager, which manages the kernels that are started with one muscle2 invocation.

For MAPPER partners, visit the MAPPER tutorial.

Attachments