1 / 114

Parallel Processing Lab 1

Parallel Processing Lab 1. Dr. Guy Tel- Zur. August 2013 edition. מטרות השיעור. התחברות לקלאסטר המקבילי תרגול ביצוע משימות בסיסיות תחת מערכת ההפעלה Linux הרצת תכניות מקביליות בסיסיות המשתמשות ב MPI - שימוש ב - Profiler. יעדים. יישור קו בנושא לינוקס הכרות ראשונית עם MPI פיתוח קוד

keely-doyle
Télécharger la présentation

Parallel Processing Lab 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Parallel ProcessingLab 1 Dr. Guy Tel-Zur August 2013 edition

  2. מטרות השיעור • התחברות לקלאסטר המקבילי • תרגול ביצוע משימות בסיסיות תחת מערכת ההפעלה Linux • הרצת תכניות מקביליות בסיסיות המשתמשות בMPI- • שימוש ב- Profiler

  3. יעדים • יישור קובנושא לינוקס • הכרות ראשונית עם MPI • פיתוח קוד • קימפול • ניפוי שגיאות • הרצה • ניתוח התוצאה

  4. The Hobbits • Old hobbits: • Hobbit1 132.72.53.1 • Hobbit2 132.72.53.2 • Hobbit3 132.72.53.3 • Hobbit4 132.72.53.4 • Hobbit5 132.72.53.5 • New hobbits: • Hobbit6 132.72.50.36 • Hobbit7 132.72.50.35 • Hobbit8 132.72.55.240 • Hobbit9 132.72.55.241 • Hobbit10 132.72.52.160 • Virtual hobbits: • Hobbit11 132.72.50.68 • Hobbit12 132.72.50.71 • Hobbit13 132.72.50.91 • Hobbit14 132.72.50.93 • Hobbit15 132.72.50.94

  5. Ganglia Monitorhttp://hobbit5.ee.bgu.ac.il/

  6. Enter the system login: username password: passwd Exit the system exit Text editors pico, vi, (x)Emacs, gedit… or Edit on Windows then transfer file using ftp C Compiler gcc –o file file.c Basic Linux Commands – 1/5

  7. DOS Linux See files dir ls ls -l Copy files copy cp Erase files del rm Basic Linux Commands – 2/5

  8. DOS Linux Make directory mkdir mkdir Remove directory rmdir rmdir More/Rename rename mv OS version ver uname -a Basic Linux Commands – 3/5

  9. Basic Linux Commands – 4/5 • Getting help: man topic • Look at the contents of a file: cat, more,head and tail • Quit from man or more: q • Where am I? pwd • Clear the screen: clear

  10. Basic Linux Commands – 5/5 • Redirection: >, >> • Pipe: | • telnet • ftp • ping • chmod • chown

  11. http://www.ctssn.com/linux/linuxfaq.html Linux FAQ

  12. ESC Puts you in command mode h, j, k, l Left, down, up, right or use the arrows keys w, W, b, B Forward, backward by word 0, $ First, last position of current line /pattern Search forward for pattern ?pattern Search backward for pattern n,N Repeat last search in same, opposite direction x Delete character dd Delete current line D Delete to end of line dw Delete word p, P Put deleted text before, after cursor u Undo last command . Repeat the last command i, a Insert text before, after cursor [Puts you into INPUT MODE] o, O Open new line for text below, above cursor [Puts you into INPUT MODE] ZZ Save file and quit :w Save file :q! Quit, without saving changes The vi Editor

  13. vi reference card • Download and print: • http://my.pages.de/vi-refcard.html • http://vh224401.truman.edu/~dbindner/mirror/vi-ref.pdf

  14. Vi for Windows

  15. Vi for windows

  16. nano

  17. Other text editors • Vi, Vim • Pico • Emacs/Xemacs • Nedit (very friendly) • Eclipse IDE‏

  18. Linux: Gathering Information Kernel version: uname –a CPU information:more /proc/cpuinfo Memory Information:more /proc/meminfo

  19. הגנה על הפרטיות – הרשאות גישה לקבצים

  20. Connecting from Windows to a remote node • Secured: SSH SSH client from: http://www.ssh.com/support/downloads/ PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/ Please download Putty!!!!!

  21. Putty

  22. Putty + Xming (option 1) Install xmingand xming fonts

  23. Connecting with cygwin X (option 2) • Connect with PuTTY • Programs  cygwin  xwin server • xhost + • From PuTTY’swindow: open X application

  24. For a secured connection from home http://vpn.bgu.ac.il

  25. For a secured connection from home

  26. For a secured connection from home IPconfig

  27. Configuring PuTTY

  28. Download links • Putty: • http://www.putty.org/ • Xming: • http://sourceforge.net/projects/xming

  29. Password-less SSH: http://telzur.blogspot.co.il/2006/03/password-less-ssh-connection.html

  30. תרגיל מס' 1 • התחבר לאחת מהתחנות תוך שימוש ב- ssh • כתוב תכנית מחשב קצרה שמדפיסה: Hello World • בצע קומפילציה: gcc –o hello_worldhello_world.c • הרץ את התכנית ושמור הפלט: % ./hello_world > hello.txt • בדוק את הפלט על-ידי: • more hello.txt

  31. The GNU compilerhttp://gcc.gnu.org/ • gcc filename.c • Will produce an executable “a.out” • gcc –o runme filename.c • Will produce an executable “runme” • Optimization: gcc –O3 –o runme filename.c • gcc –c filename.c will produce an object file “filename.o”

  32. פתרון תרגיל מס' 1 – 1/3

  33. פתרון תרגיל מס' 1 – 2/3

  34. פתרון תרגיל מס' 1 – 3/3

  35. MPI

  36. MPI-Quick reference card 1/2

  37. MPI-Quick reference card 2/2

  38. MPI Quick Reference Card: http://web.eecs.utk.edu/~dongarra/WEB-PAGES/SPRING-2006/mpi-quick-ref.pdf

  39. Data Process 0 Data May I Send? Data Data Data Data Data Data Data Process 1 Yes Time What is message passing? • Data transfer through messaging • Requires a sender and a receiver cooperation

  40. תהליך מס' 1 תהליך מס' 2 x y הזזת נתונים Send(&x,2); Recv(&y,1); Point to Point: Basic Send/Receive

  41. Space-Time Diagram of a Message-Passing Program

  42. MPI - Message Passing Interface API • MPI is a standard not an implementation • Popular implementations are LAM and MPICH • MPICH is installed under /usr/local/mpich • Always put in the code: #include “mpi.h” • Compilation: mpicc –o filename file.c • Execution: mpirun –np N filename • Help: man mpirun

  43. MPI Naming Conventions MPI_Xxxxx(parameter,...)‏ Example: MPI_Init(&argc,&argv)‏

  44. The First 4 Functions of MPI • MPI_Init • MPI_Finalize • MPI_Comm_size • MPI_Comm_rank • …and don’t forget the #include “mpi.h”

  45. The First 4 Functions Syntax • int MPI_Init(int argc, char *argv[] )‏ • int MPI_Finilize()‏ • int MPI_Comm_size(MPI_Comm comm, int *size)‏ • int MPI_Comm_rank(MPI_Comm comm, int *rank)‏

  46. MPI Communicator A communicator is a handle representing a group of processors that can communicate with one another. The communicator nameis required as an argument to all point-to-point and collective operations. The communicator specified in the send and receive calls must agree for communication to take place. Processors can communicate only if they share a communicator.

  47. Basic Point to Point Functions • MPI_Send • MPI_Recv • MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); • MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status status);

  48. MPI_Send int MPI_Send(void *buf, int count, MPI_Datatype dtype, int dest, int tag, MPI_Comm comm);

  49. MPI Data types MPI data typeC Type MPI_CHAR signed char MPI_SHORT signed short int MPI_INT signed int MPI_LONG signed long int MPI_UNSIGNED_CHAR unsigned char MPI_UNSIGNED_SHORT unsigned short int MPI_UNSIGNED unsigned int MPI_UNSIGNED_LONG unsigned long int MPI_FLOAT float MPI_DOUBLE double MPI_LONG_DOUBLE long double MPI_BYTE (none)‏ MPI_PACKED (none)‏

More Related