The SimGrid Framework for Research on Large-Scale
Transcription
The SimGrid Framework for Research on Large-Scale
The SimGrid Framework for Research on Large-Scale Distributed Systems - Second Part Martin Quinson (Nancy University, France) Arnaud Legrand (CNRS, Grenoble University, France) Henri Casanova (Hawaii University at Manoa, USA) Presented By: Pedro Velho (Grenoble University, France) [email protected] Scheduling Problem SimGrid Installation Master/Slave Model Exercises Scheduling Problem Harry Lessard Disney Fraser St_Jean Stephen SPICE Provost Julian Bellemarre TeX Fernand 70 17 18 Morin Paul Boston 75 16 Bousquet Casavant 60 100 Heterogeneous platform 14 Drouin Marcoux Europe Papineau Robert Sirois Kansas Audy Dodge 20 15 Jamie McGee Laroche UNIX Pointe_Claire Homogeneous tasks Lapointe Florient Gatien 21 Fafard 22 Domey 59 7 SunOS 25 52 53 Jill 50 Monique 27 LaTeX 57 51 26 2 58 Master/Worker approach Gordon Juneau Croteau St_Bruno Boucherville 24 Soucy Boivin 23 3 Ethernet iRMX Louis Use SimGrid Jocelyne 8 6 Model the scheduler Evaluate performance of heuristics Bescherelle OHara Doyon Jean_Claude Victoria 32 kV 0 Intel 145 Tanguay Julien 34 42 Jackson 31 Olivier 5 Kuenning 39 36 44 45 155 Yolande Amadeus 40 Jean_Yves St_Antoine 47 Tremblay Geoff Gavrel Mathematica Varennes 46 Bourassa Jacquelin 140 Pronovost Cambridge Roy Lafontaine King Lachapelle Rubin Jacques Wright Ste_Julie Thierry Marcel Pierre Gaston St_Paul Browne “Given n identical independent tasks that are initially hold by the master, what is the best way to distribute them to the p other computers ?” SimGrid for Research on Large-Scale Distributed Systems 2/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises SimGrid Installation 1/2 All files and links you need you can find here http://mescal.imag.fr/membres/pedro.velho/workshop-simgrid.html 1 In links section download SimGrid 3.3 http://gforge.inria.fr/frs/?group_id=12 2 Get the file named simgrid-3.3.3.tar.gz 3 Decode/decompress the tar ball file tar zxvf simgrid-3.3.3.tar.gz 4 Get to the new created directory cd simgrid-3.3.3 SimGrid for Research on Large-Scale Distributed Systems 3/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises SimGrid Installation 2/2 1 Configure SimGrid for your architecture, select an installation path ./configure --prefix=/simgrid/installation/path 2 Compile SimGrid make 3 Install SimGrid make install 4 Add SimGrid libraries to your library path export LD LIBRARY PATH=/simgrid/installation/path/lib Any doubt try the SimGrid FAQ http://simgrid.gforge.inria.fr/doc/faq.html SimGrid for Research on Large-Scale Distributed Systems 4/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises Compiling/Running - Master/Slave Model 1 2 3 4 5 6 Download brainless version http://mescal.imag.fr/membres/pedro.velho/src.tgz Decode/decompress the tar ball file tar zxvf src.tgz Get to the new created directory cd src Open Makefile in a text editor, set properly the SimGrid installation path INSTALL PATH=/simgrid/installation/path Compile it make Run it ./mslave Required Files Main file: mslave.c Master/Slave functions: sched struct.c,sched struc.h Makefile: Makefile SimGrid for Research on Large-Scale Distributed Systems 5/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises SimGrid Master/Slave Example (1/2) Write the Code of your Agents int master(int argc, char **argv) { int worker(int ,char**){ for (i = 0; i < number_of_tasks; i++) { t=MSG_task_create(name,comp_size,comm_size,data ); sprintf(mailbox,"worker-%d",i % workers_count); MSG_task_send(t, mailbox); } sprintf(my_mailbox,"worker-%d",my_id); while(1) { MSG_task_receive(&task, my_mailbox); MSG_task_execute(task); MSG_task_destroy(task); } Detail your Experiment Platform XML Platform File XML Deployment File <?xml version=’1.0’?> <!DOCTYPE platform SYSTEM "surfxml.dtd"> <platform version="2"> <host name="host1" power="1E8"/> <host name="host2" power="1E8"/> <link name="link1" bandwidth="1E6" latency="1E-2" /> <route src="host1" dst="host2"> <link:ctn id="link1"/> </route> ... </platform> <?xml version=’1.0’?> <!DOCTYPE platform SYSTEM "surfxml.dtd"> <platform version="2"> <!-- The master process --> <process host="host1" function="master"> <argument value="10"/><!--argv[1]:#tasks--> <argument value="1"/><!--argv[2]:#workers--> </process> <!-- The workers --> <process host="host2" function="worker"> <argument value="0"/></process> </platform> SimGrid for Research on Large-Scale Distributed Systems 6/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises SimGrid Master/Slave Example (2/2) Glue things together int main(int argc, char *argv[ ]) { /* Bind agents’ name to their function */ MSG_function_register("master", &master); MSG_function_register("worker", &worker); MSG_create_environment("my_platform.xml"); /* Load a platform instance */ MSG_launch_application("my_deployment.xml"); /* Load a deployment file */ MSG_main(); /* Launch the simulation */ INFO1("Simulation took %g seconds",MSG_get_clock()); } Compile your code (linked against -lsimgrid), run it and enjoy SimGrid for Research on Large-Scale Distributed Systems 7/8 Scheduling Problem SimGrid Installation Master/Slave Model Exercises Question In the current implementation, the master starts satisfying requests only when there are enough pending requests. Propose and try other request selection strategies: fastest CPU slowest CPU higher Bandwidth grater CPU/Bandwidth ratio Other Evaluate different application parameters Number of tasks Task size Other Useful files test.sh deployment generic.xml deployment generic smarter.xml SimGrid for Research on Large-Scale Distributed Systems 8/8