Changes between Version 19 and Version 20 of Tutorials

Show
Ignore:
Timestamp:
09/12/13 11:17:19 (12 years ago)
Author:
jorisborgdorff
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials

    v19 v20  
    2222  muscle2 --cxa src/cxa/SimpleSubmodelExample.cxa.rb  
    2323 }}} 
    24  
    2524 This example has a writer submodel `w` and a reader submodel `r`. The writer sends data to the reader, and the reader prints that data to screen. 
    26  
    2725 You can run the simple example by specifying that the current MUSCLE command will run the Simulation Manager with the `--main` flag or its shorthand `-m`, and specifying all submodels that should run in this command: 
    2826 {{{ 
    2927 muscle2 -mc src/cxa/SimpleSubmodelExample.cxa.rb w r 
    3028 }}} 
    31  
    3229 Usually, if you want to run all the submodels instances with the current MUSCLE command, specify the `--allinstances` or its shorthand `-a`: 
    3330 {{{ 
    3431 muscle2 -amc src/cxa/SimpleSubmodelExample.cxa.rb 
    3532 }}} 
    36  
    3733 So what do we observe? MUSCLE detects that it should start the Simulation Manager and a Simulation. It first starts the manager, which shows its TCP/IP address. Then the Simulation starts and it executes the submodel instances `w` and `r`. These start their respective conduits, and start 'computing'. 
    38  
    3934 On local machines, these commands are sufficient to run any MUSCLE model. You can try the other examples in the `src/cxa` directory, just run 
    4035 {{{ 
     
    4641 muscle2 -amc src/cxa/LaplaceExample.cxa.rb 
    4742 }}} 
    48  
    4943 It will open two windows that compute temperature dissipation, that are coupled on the boundary. Red is a +1 temparature, blue a -1 temperature, and green a zero temperature. The initial condition, far right and far left correspond to zero temperature, the top to a sine function and the bottom to a cosine. Temperature is dissipated during each time step by taking the average of the four neighboring cells. The adjacent boundary is transmitted each iteration. 
    5044 
     
    6256  . [MUSCLE_DIR]/etc/muscle.profile 
    6357 }}} 
    64  
    6558 Then go to the unzipped MUSCLE directory. Now we can run muscle on the same site. In the first terminal window, start the main MUSCLE with the writing submodel w. This is done by typing: 
    6659 {{{ 
    6760  muscle2 -mc src/cxa/SimpleSubmodelExample.cxa.rb w 
    6861 }}} 
    69  
    7062 So what do you observe? 
    71  
    7263 One of the most important messages is `Started the connection handler, listening on [IPADDRESS:PORT]`. 
    7364 Copy the IP address and port number.  
     
    7768  muscle2 -c src/cxa/SimpleSubmodelExample.cxa.rb r -M [IPADDRESS:PORT] 
    7869 }}} 
    79  
    8070 What happens in both terminals? 
    8171 
    82722. To isolate the output from the Simulation Manager, we can run it separately. 
    83  
    8473 In the first terminal window, start the Simulation Manager: 
    8574 {{{ 
    8675  muscle2 -mc src/cxa/SimpleSubmodelExample.cxa.rb 
    8776 }}} 
    88  
    8977 In the second terminal, start the submodels. Again, replace the port number 
    9078 with the one that is printed by the Simulation Manager. 
     
    9280  muscle2 -ac src/cxa/SimpleSubmodelExample.cxa.rb -M [IPADDRESS:PORT] 
    9381 }}} 
    94  
    9582 What happens in both terminals? 
    9683 
     
    10188 . MUSCLE_DIR/etc/muscle.profile 
    10289 }}} 
    103  
    10490 And go to the source directory of MUSCLE. We will perform the same experiment, 
    10591 but now on different hosts. So on the first node, for instance run only `w` 
     
    10793 muscle2 -mc src/cxa/SimpleSubmodelExample.cxa.rb w 
    10894 }}} 
    109  
    11095 On the other node, we now also need to specify which host and port the other 
    11196 MUSCLE instance is running on 
     
    11398  muscle -c src/cxa/SimpleSubmodelExample.cxa.rb -M [IPADDRESS:PORT] r 
    11499 }}} 
    115  
    116100 What is the output in node one? And on the other? 
    117101 
     
    173157  this example, call both the sending and the receiving port "messages", for 
    174158  example. Test your implementation by running 
    175   
    176159  {{{ 
    177160    cd build