Changes between Version 1 and Version 2 of Tutorials

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

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials

    v1 v2  
    1 == User account: == 
    2  
    3 An user account on the grass machine (or localy) can be provided to anyone willing to execute the tutorial. 
    4  
    5 For more information, please contact: j . borgdorff at uva . nl 
    6  
    7 == Assignment 1: installing and testing == 
    8  
    9 In this assignment you will download MUSCLE 1.1.1 and compile it on the grass machine. 
    10  
    11 1. Go to [[http://apps.man.poznan.pl/trac/muscle]], there you can see the installation guide and download MUSCLE for yourself. We will not download it from the webpage, but directly on the grass machine. 
    12  
    13 2.  Log in to the grass machine using the provided log-in credentials with a terminal (Linux and Mac OS X) or with [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|PuTTY]] (Windows) 
    14 {{{ 
    15 ssh [mschoolXX]@grass1.man.poznan.pl 
    16 }}} 
    17  
    18  
    19 Once logged in there, download and unzip muscle-1.1.1.zip.  
    20 {{{ 
    21 wget apps.man.poznan.pl/trac/muscle/downloads/muscle-1.1.1.zip 
    22 unzip muscle-1.1.1.zip 
    23 cd muscle-1.1.1 
    24 }}} 
    25  
    26 you can then build it with 
    27 {{{ 
    28 ./build.rb all 
    29 ./build.rb install -p $HOME/muscle 
    30 }}} 
    31 All prerequisites described on the installation page are already installed on the grass machine. 
    32  
    33 To add MUSCLE to the path, and set a few environment variables, run the following (don't forget the dot at the start): 
    34 {{{ 
    35 . $HOME/muscle/etc/muscle.profile 
    36 }}} 
    37  
    38 3. Now you can run muscle, first showing which submodels a simple example contains: 
    39 {{{ 
    40 muscle --cxa_file src/cxa/SimpleExample.cxa.rb  
    41 }}} 
    42 This example has the MUSCLE plumber, a writer w and a reader r. The writer sends data to the reader, and the reader prints that data to screen. 
    43  
    44 You can run the simple example in the main container, by specifying {{{--main}}}, and specifying all submodels that should run in this container: 
    45 {{{ 
    46 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX  --main plumber w r 
    47 }}} 
    48 quit with Ctrl-C, or give the flag {{{--autoquit}}}. 
    49  
    50 4. Take a look at all the options by running just 
    51 {{{ 
    52 muscle 
    53 }}} 
    54  
    55 == Assignment 2: distributed execution == 
    56  
    57 In this assignment we will do an inter-process and an inter-machine run of MUSCLE. 
    58  
    59 1. Open a second terminal, and also log in to grass1. When logged in do 
    60 {{{ 
    61 . $HOME/muscle/etc/muscle.profile 
    62 cd muscle-1.1.1 
    63 }}} 
    64  
    65 Now we can run muscle on the same site. In the first terminal window, start a main container with the plumber and the writing submodel w, using your own port number. Your port numbers are 55XX and 56XX, where XX is your login number, as in mschoolXX. This is done by typing: 
    66 {{{ 
    67 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber w 
    68 }}} 
    69 What happens here? 
    70  
    71 In the second terminal, start the reading submodel r. This instance of muscle locates the one you just started by supplying its port number 55XX. 
    72 {{{ 
    73 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --mainport 55XX r 
    74 }}} 
    75 What happens? 
    76  
    77 Try now, using port 56XX in the second terminal 
    78 {{{ 
    79 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 56XX --mainport 55XX r 
    80 }}} 
    81 And now? 
    82 Quit by doing Ctrl-C. What does MUSCLE in terminal 1 say? 
    83  
    84 2. In the second terminal, now log in to grass2 
    85 {{{ 
    86 ssh mschoolXX@grass2 
    87 . $HOME/muscle/etc/muscle.profile 
    88 cd muscle-1.1.1 
    89 }}} 
    90 We will perform the same experiment, but now on different hosts. So on grass1, for instance run only plumber 
    91 {{{ 
    92 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber 
    93 }}} 
    94  
    95 On grass2, we now also need to specify which host the other MUSCLE instance is running on 
    96 {{{ 
    97 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 56XX --mainport 55XX --mainhost grass1 w r 
    98 }}} 
    99 Quit with Ctrl-C. What is the output in grass1? And in grass2? 
    100  
    101 **Related:** inter-cluster executions can be done with the {{{--intercluster}}} tag, with which the MUSCLE transport overlay (MTO) is used. We will not be doing this directly, because we have only one cluster arranged. In the [[http://www.mapper-project.eu/web/guest/wiki/-/wiki/Main/QosCosGrid+tutorial+for+1st+seasonal+school|QCG tutorial]] this is done under the hood by QCG-Broker. 
    102  
    103 == Assignment 3: modifying the example (optional) == 
    104  
    105 To start on using MUSCLE for your own applications, you can start by modifying the examples. Depending on the programming language of your application, you can start with (Java) the files in src/java/examples/simplejava or with (C++/C/Fortran) src/cpp/examples/simplecpp. The last only modifies the Sender (the submodel w) of the simple example. 
    106  
    107 1. Modify src/java/examples/simplejava/ConsoleWriter.java so that it sends a message back to Sender.java; modify Sender.java to receive this message. Test it by running 
    108 {{{ 
    109 ./build.rb java 
    110 ./build.rb install -p $HOME/muscle 
    111 muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber w r 
    112 }}} 
    113  
    114 Steps that you can do: 
    115 # Open ConsoleWriter.java 
    116 # Define a port field {{{private ConduitEntrance<double[]> msgEntrance;}}} You will use this to receive data. 
    117 # At the top, import the entrance with {{{import muscle.core.ConduitEntrance;}}}. 
    118 # Instantiate it in {{{addPortals()}}} with {{{msgEntrance = addConduitEntrance("messages",1,double[]);}}} 
    119 # send some data over it in execute by defining {{{double[] msg = {1.0, 0.0, 1.0}; msgEntrance.send(msg);}}} 
    120 # Open Sender.java 
    121 # Define a port field {{{private ConduitExit<double[]> msgExit;}}} You will use this to receive data. 
    122 # At the top, import the exit with {{{import muscle.core.ConduitExit;}}} 
    123 # Instantiate it in {{{addPortals()}}} with {{{msgExit = addConduitExit("messages",1,double[]);}}} 
    124 # Receive some data over it in execute by doing {{{double[] msg = msgExit.send(msg);}}} 
    125 # Print the data with {{{ for (double d : msg) System.out.println("Message " + d);}}} 
    126 # Open the configuration file src/cxa/SimpleExample.cxa.rb 
    127 # Add the lines {{{cs.attach('r' => 'w') { tie('messages', 'messages') } }}} 
    128 # Build it and execute 
    129  
    130 2. Modify src/cpp/examples/simplecpp/Sender.java and Sender.cpp to receive a message from ConsoleWriter 
    131 {{{ 
    132 ./build.rb all 
    133 ./build.rb install -p $HOME/muscle 
    134 muscle --cxa_file src/cxa/NativeExample.cxa.rb --localport 55XX --main plumber w r 
    135 }}} 
     1For MAPPER partners, visit the [[MAPPER tutorial]].