GRID-Machine

 view release on metacpan or  search on metacpan

lib/GRID/Machine/perlparintro.pod  view on Meta::CPAN

=head1 NAME

GRID::Machine::perlparintro - A brief and basic introduction to Parallel Distributed Computing in Perl

=head1 SYNOPSIS

    $ time gridpipes.pl 1 1000000000
    Process 0: machine = beowulf partial = 3.141593 pi = 3.141593
    Pi = 3.141593. N = 1000000000 Time = 27.058693

    real    0m28.917s
    user    0m0.584s
    sys     0m0.192s

    pp2@nereida:~/LGRID_Machine/examples$ time gridpipes.pl 2 1000000000
    Process 0: machine = beowulf partial = 1.570796 pi = 1.570796
    Process 1: machine = orion partial = 1.570796 pi = 3.141592
    Pi = 3.141592. N = 1000000000 Time = 15.094719

    real    0m17.684s
    user    0m0.904s
    sys     0m0.260s


    pp2@nereida:~/LGRID_Machine/examples$ time gridpipes.pl 3 1000000000
    Process 0: machine = beowulf partial = 1.047198 pi = 1.047198
    Process 1: machine = orion partial = 1.047198 pi = 2.094396
    Process 2: machine = nereida partial = 1.047198 pi = 3.141594
    Pi = 3.141594. N = 1000000000 Time = 10.971036

    real    0m13.700s
    user    0m0.952s
    sys     0m0.240s



=head1 SUMMARY

The total computational power of institutions 
as a whole has dramatically rised in the last decades, but
due to distributed ownership and administration restrictions, 
individuals are not able to capitalize such computing power. 
Many machines sit idle for very long periods of time while 
their owners are busy doing other things. Many of them run
some sort of UNIX, have Perl installed and provide SSH access.

If such is your scenario you can use L<GRID::Machine> to
have perl interpreters running in 
those nodes and make them collaborate to give you more computational 
power and more fun. All this without having to ask administrators 
or having to install any additional software.

This tutorial introduces the basics of parallel computing by means of 
a simple program that distributes 
the evaluation of some mathematical expression between several machines. 
The computational results show that - when the problem is large enough -
a substantial improving is gained in performance: The execution times
is reduced to the half by using two machines.

=head1 REQUIREMENTS

To experiment with the examples in this tutorial 
you will need at least two Unix machines with Perl and SSH.
If you are not familiar with Perl or Linux this module probably
isn't for you.
If you are not familiar with SSH, see 

=over 2

=item * I<SSH, The Secure Shell: The Definitive Guide> by Daniel J. Barrett   
and Richard E. Silverman. O'Reilly

=item * L<http://www.openssh.com>

=item * Man pages of C<ssh>, C<ssh-key-gen>, C<ssh_config>, C<scp>, 
C<ssh-agent>, C<ssh-add>, C<sshd>

=item * L<http://www.ssh.com>

=item * Linux Focus article L<http://tldp.org/linuxfocus/English/Archives/lf-2003_01-0278.pdf>
by Erdal Mutlu I<Automating system administration with ssh and scp>

=back


=head1 BUILDING A "FUZZY" PARALLEL CLUSTER

SSH includes the ability to authenticate users using public keys. Instead of 
authenticating the user with a password, the SSH server on the remote machine will
verify a challenge signed by the user's I<private key> against its copy
of the user's I<public key>. To achieve this automatic ssh-authentication
you have to:

=over 2

=item * Generate a public key use the C<ssh-keygen> utility. For example:

  local.machine$ ssh-keygen -t rsa -N ''

The option C<-t> selects the type of key you want to generate.
There are three types of keys: I<rsa1>, I<rsa> and I<dsa>.
The C<-N> option is followed by the I<passphrase>. The C<-N ''> setting
indicates that no pasphrase will be used. This is useful when used 
with key restrictions or when dealing with cron jobs, batch 



( run in 0.559 second using v1.01-cache-2.11-cpan-d8267643d1d )