| 1 | == Sample execution == |
| 2 | 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. |
| 3 | |
| 4 | === Hello World === |
| 5 | |
| 6 | Sender:: In {{{src/java/examples/simplejava/Sender.java}}} we provide a minimalist kernel written in Java, which sends data (an array of double). |
| 7 | |
| 8 | 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. |
| 9 | |
| 10 | 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. |
| 11 | |
| 12 | Execution:: To run the simulation defined in src/cxa/SimpleExample.cxa.rb use the following command: |
| 13 | {{{ |
| 14 | muscle2 --cxa src/cxa/SimpleExample.cxa.rb --main --allkernels |
| 15 | }}} |
| 16 | or in shorthand notation |
| 17 | {{{ |
| 18 | muscle2 -c src/cxa/SimpleExample.cxa.rb -am |
| 19 | }}} |
| 20 | 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. |
| 21 | |
| 22 | |