Changes between Initial Version and Version 1 of MAPPER tutorial

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

--

Legend:

Unmodified
Added
Removed
Modified
  • MAPPER tutorial

    v1 v1  
     1== User account: == 
     2 
     3An user account on the grass machine (or localy) can be provided to anyone willing to execute the tutorial. 
     4 
     5For more information, please contact: j . borgdorff at uva . nl 
     6 
     7== Assignment 1: installing and testing == 
     8 
     9In this assignment you will download MUSCLE 1.1.1 and compile it on the grass machine. 
     10 
     111. 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 
     132.  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{{{ 
     15ssh [mschoolXX]@grass1.man.poznan.pl 
     16}}} 
     17 
     18 
     19Once logged in there, download and unzip muscle-1.1.1.zip.  
     20{{{ 
     21wget apps.man.poznan.pl/trac/muscle/downloads/muscle-1.1.1.zip 
     22unzip muscle-1.1.1.zip 
     23cd muscle-1.1.1 
     24}}} 
     25 
     26you can then build it with 
     27{{{ 
     28./build.rb all 
     29./build.rb install -p $HOME/muscle 
     30}}} 
     31All prerequisites described on the installation page are already installed on the grass machine. 
     32 
     33To 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 
     383. Now you can run muscle, first showing which submodels a simple example contains: 
     39{{{ 
     40muscle --cxa_file src/cxa/SimpleExample.cxa.rb  
     41}}} 
     42This 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 
     44You can run the simple example in the main container, by specifying {{{--main}}}, and specifying all submodels that should run in this container: 
     45{{{ 
     46muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX  --main plumber w r 
     47}}} 
     48quit with Ctrl-C, or give the flag {{{--autoquit}}}. 
     49 
     504. Take a look at all the options by running just 
     51{{{ 
     52muscle 
     53}}} 
     54 
     55== Assignment 2: distributed execution == 
     56 
     57In this assignment we will do an inter-process and an inter-machine run of MUSCLE. 
     58 
     591. Open a second terminal, and also log in to grass1. When logged in do 
     60{{{ 
     61. $HOME/muscle/etc/muscle.profile 
     62cd muscle-1.1.1 
     63}}} 
     64 
     65Now 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{{{ 
     67muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber w 
     68}}} 
     69What happens here? 
     70 
     71In 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{{{ 
     73muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --mainport 55XX r 
     74}}} 
     75What happens? 
     76 
     77Try now, using port 56XX in the second terminal 
     78{{{ 
     79muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 56XX --mainport 55XX r 
     80}}} 
     81And now? 
     82Quit by doing Ctrl-C. What does MUSCLE in terminal 1 say? 
     83 
     842. In the second terminal, now log in to grass2 
     85{{{ 
     86ssh mschoolXX@grass2 
     87. $HOME/muscle/etc/muscle.profile 
     88cd muscle-1.1.1 
     89}}} 
     90We will perform the same experiment, but now on different hosts. So on grass1, for instance run only plumber 
     91{{{ 
     92muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber 
     93}}} 
     94 
     95On grass2, we now also need to specify which host the other MUSCLE instance is running on 
     96{{{ 
     97muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 56XX --mainport 55XX --mainhost grass1 w r 
     98}}} 
     99Quit 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 
     105To 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 
     1071. 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 
     111muscle --cxa_file src/cxa/SimpleExample.cxa.rb --localport 55XX --main plumber w r 
     112}}} 
     113 
     114Steps that you can do: 
     115>  1. Open ConsoleWriter.java 
     116>  1. Define a port field {{{private ConduitEntrance<double[]> msgEntrance;}}} You will use this to receive data. 
     117>  1. At the top, import the entrance with {{{import muscle.core.ConduitEntrance;}}}. 
     118>  1. Instantiate it in {{{addPortals()}}} with {{{msgEntrance = addConduitEntrance("messages",1,double[]);}}} 
     119>  1. send some data over it in execute by defining {{{double[] msg = {1.0, 0.0, 1.0}; msgEntrance.send(msg);}}} 
     120>  1. Open Sender.java 
     121>  1. Define a port field {{{private ConduitExit<double[]> msgExit;}}} You will use this to receive data. 
     122>  1. At the top, import the exit with {{{import muscle.core.ConduitExit;}}} 
     123>  1. Instantiate it in {{{addPortals()}}} with {{{msgExit = addConduitExit("messages",1,double[]);}}} 
     124>  1. Receive some data over it in execute by doing {{{double[] msg = msgExit.send(msg);}}} 
     125>  1. Print the data with {{{ for (double d : msg) System.out.println("Message " + d);}}} 
     126>  1. Open the configuration file src/cxa/SimpleExample.cxa.rb 
     127>  1. Add the lines {{{cs.attach('r' => 'w') { tie('messages', 'messages') } }}} 
     128>  1. Build it and execute 
     129[[br]] 
     1302. 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 
     134muscle --cxa_file src/cxa/NativeExample.cxa.rb --localport 55XX --main plumber w r 
     135}}}