Parallel Ruby - PowerPoint PPT Presentation

Loading...

PPT – Parallel Ruby PowerPoint presentation | free to download - id: 13264c-ZDc1N



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Parallel Ruby

Description:

creator of Ruby, is a professional. programmer who worked for the. Japanese open ... www.textpad.com/add-ons/ntsyn.html. 3 ???? 2003. Parallel Ruby - pp11. 14 ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 43
Provided by: MIL163
Learn more at: http://www.ee.bgu.ac.il
Category:
Tags: addons | parallel | ruby

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Parallel Ruby


1
Parallel Ruby
2
Ruby
Ruby is a powerful and dynamic open source,
object-oriented programming language.
3
creator of Ruby
Yukihiro Matsumoto ("Matz"), the creator of
Ruby, is a professional programmer who worked
for the Japanese open source company,
netlab.jp. Matz is also known as one of the
open source evangelists in Japan. matz_at_netlab.jp
4
History
birthday of ruby - 23 february 1993
5
History
1995 First release 1999 Overtakes Python in
Japan 2000 Comp.lang.ruby (newsgroup) First
English-language Ruby book IBM, Inform IT,Brave
GNU World ,Sun World Feature Ruby on web
6
Introducing
7
Introducing
Ruby is developed under Linux, and is written in
fairly straightforward C. It runs under
UNIX, DOS, Windows 95/98/NT/2000, Mac OS X,
BeOS, Amiga, Acorn Risc OS, and OS/2.
8
Introducing
Ruby's primary focus is productivity of program
development, and users will find that programming
in Ruby is productive and even fun. Ruby is well
suited for the problem domains such as these
Text processing Ruby's File, String, and Regexp
classes help you process text data quickly and
cleanly.
Network programming Network programming can be
fun with Ruby's well-designed socket classes.
9
Introducing
CGI programming Ruby has everything you need to
do CGI programming, including text-handling
classes, a CGI library, database interface, and
even eRuby (embedded Ruby) and mod_ruby for
Apache.
GUI programming GUI tool kit interfaces such as
Ruby/Tk and Ruby/Gtk are available
10
Introducing
XML programming Text-handling features and the
UTF-8-aware regular expression engine make XML
programming handy in Ruby. The interface to the
expat XML parser library is also available.
Prototyping With its high productivity, Ruby is
often used to make prototypes. Prototypes
sometimes become production systems by replacing
the bottlenecks with C written extensions.
11
Introducing - editors
emacs/xemacs www.gnu.org/software/emacs/emacs.htm
l or http//www.xemacs.org/ name"XEmacs"
ruby-mode.el is supplied in the Ruby
distribution. With some versions of XEmacs, you
may need to add (load "font-lock") to your .emacs
file to allow ruby-mode.el to detect the syntax
highlighting package youre using.
Jedit jedit.sourceforge.net A portable editor
written in Java, comes with support for Ruby.
12
Introducing - editors
Vim http//www.vim.org/ Vim 5.7 and later have
Ruby syntax files as standard in the runtime
package. For prior versions, a syntax file for
Ruby is available at www.xs4all.nl/hipster/lib/ru
by/ruby.vim.
Jed space.mit.edu/davis/jed.html An s-lang
file supporting Ruby is available at
www.kondara.org/g/slang/ruby.sl .
13
Introducing - editors
Nedit http//www.nedit.org Eric Santonacci has
written Ruby support for Nedit, available from
ftp.talc.fr/pub/ruby/ruby.nedit-0.1.tar.gz
TextPad Barry Shultz has written a Ruby
definition file for TextPad, available at
www.textpad.com/add-ons/ntsyn.html
14
Design Policy of Ruby by Matz
15
Design Policy of Ruby by Matz
16
Design Policy of Ruby by Matz
17
Design Policy of Ruby by Matz
Principle of Flexibility Because languages are
meant to express thought, a language should not
restrict human thought, but should help it. Ruby
consists of an unchangeable small core (that is,
syntax) and arbitrary extensible class libraries.
Because most things are done in libraries, you
can treat user-defined classes and objects just
as you treat built-in ones. Programming is
incredibly less stressful in Ruby because of
these principles.
18
Example of ruby code
def fact(n) if n 0 1 else
n fact(n-1) end end
19
Ruby features
  Ruby has simple syntax, partially inspired
by Eiffel and Ada.
  Ruby has exception handling features, like
Java or Python, to make it easy to handle
errors.
  Ruby's operators are syntax sugar for the
methods. You can redefine them easily.
20
Ruby features
  Ruby is a complete, full, pure object
oriented language OOL. This means all data
in Ruby is an object, not in the sense of
Python or Perl, but in the sense of
Smalltalk no exceptions.
  Ruby features true closures. Not just
unnamed function, but with present variable
bindings.
21
Ruby features
  Ruby's OO is carefully designed to be both
complete and open for improvements.
Example Ruby has the ability to add
methods to a class,or even to an instance
during runtime. So, if needed, an instance
of one class can behave differently from
other instances of the same class
22
Ruby features
  Ruby features a true mark-and-sweep garbage
collector. It works with all Ruby objects.
You don't have to care about maintaining
reference counts in extension libraries
  Writing C extensions in Ruby is easier than
in Perl or Python, due partly to the
garbage collector, and partly to the fine
extension API.
23
Ruby features
  Ruby needs no variable declarations. It uses
simple naming conventions to denote the
scope of variables. Examples
simple 'var' local variable, '_at_var'
instance variable, 'var' global
variable.
24
Ruby features
  Ruby can load extension libraries
dynamically if an OS allows.
  Ruby features OS independent threading.
Thus, for all platforms on which Ruby runs,
you also have multithreading, regardless of
if the OS supports it or not, even on MS-DOS!
25
(No Transcript)
26
MPI Ruby is a Ruby binding of MPI. The
primary goal in making this binding was to make
the power of MPI available to Ruby users in a
way that fits into the language's object
oriented model. In order to do this, the
buffer and datatype management necessary in
the C, C, and Fortran bindings have been
removed.
27
  What this means is that MPI Ruby allows you to
treat objects as messages. MPI Ruby also
aims to be a complete binding to MPI, in
that it offers access to nearly all functionality
of MPI
28
Using MPI Ruby
29
Using MPI Ruby
  •          All classes are contained in Module MPI
  • MPIComm
  • MPIGroup
  • MPIOp
  • MPIKeyval
  • MPIRequest
  • MPIStatus
  • MPIException

30
Methods - Constructors
MPICommdup() Duplicates the communicator and
returns a new communicator C equivalent
MPI_Comm_dup() MPIComm.create(grp) Creates a
new communicator from the grp (of type
MPIGroup) C equivalent MPI_Comm_create()
31
Methods - Topology Constructors
MPICommgraph_create(index, edges,
reorder) Creates a new communicator to which
graph topology information is attached. index is
an array in which the i-th entry is the the total
number of neighbors of the first i nodes. edges
is a flattened array of the edge lists for nodes
0, 1, ...index.length reorder is a logical value
indicating whether the processes may be reordered
in the new topology C equivalent
MPI_Graph_create()
32
Methods
Attributes Informational Methods Topology
Specific Information Methods Point-to-Point
Communications Non-blocking Point-to-Point
Communications Persistent Communications Buffering
Methods Collective Operations Probing Comparison
Abortive Methods Constants
33
Methods
Constructors Informational Methods MPIGroupsize
() Returns the size of the group C equivalent
MPI_Group_size() MPIGroup(grp) Returns the
union of the receiver group and grp. C
equivalent MPI_Group_union()
34
Methods
Constructors MPIOp.create(proc,
commute) Returns a new MPIOp based on the Proc
object proc. proc must accept two arguments. If
commute is true, proc is considered to be
commutative. C equivalent MPI_Op_create()
35
Methods
Constructors MPIKeyval.create(uniq) Returns a
new MPIKeyval. If uniq is true, then the
attribute associated with a keyval will be
deleted from the original communicator to which
it was attached when that communicator is
duplicated. If uniq is false, then the attribute
will simply be copied to the new communicator. C
equivalent MPI_Keyval_create()
36
Methods
Informational Methods MPIRequestnull?() Returns
true if the request is null. C equivalent
request MPI_REQUEST_NULL Wait Methods Test
Methods Initiation and Cancellation Accessors
37
Methods
Informational Methods MPIStatussource() Returns
the source of the message to which the status
object refers. C equivalent status.MPI_STATUS
38
exception class
An exception class used for passing back MPI
errors
39
Project
Parallel computation (with MPI) of PI in two
languages 1. C. 2. Ruby. Comparison between two
programs.
40
Ruby Books
41
Ruby on WEB
42
Ruby on WEB
http//www.ruby-lang.org/en/ http//www.ruby-lang.
org/en/hotlinks.html http//www-unix.mcs.anl.gov/m
pi/mpi_ruby/ http//www.ddj.com/articles/2002/0209
/ http//www.rubygarden.org/ruby http//www.rubyce
ntral.com/ matz_at_netlab.jp - Matz onge_at_mcs.anl.gov
- Emil Ong
About PowerShow.com