Tutorial Building PVM with SSH Passwordless Part 2

Running the PVM

Adding node

PVM cluster have 2 way to add node (client) to master node, ie:

  1. make hostname on master node
  2. manually with type add name_node

1. Make Hostname

After fourth step we did it. It time to running program from $PVM_ROOT/example. Before do that we make hostname (for furthermore about hostname, you can read README file). We make hostname on $PVM_ROOT/lib with name pvm.hosts. File pvm.hosts containing with name of every node or like your /etc/hosts (You do this step on master node)

[root@node1 .ssh]# cat > pvm.hosts

node4

node1

node2

[root@node1 .ssh]#

[root@node4 lib]# /usr/local/pvm3/lib/pvm pvm.hosts

pvm> conf

conf

3 hosts, 1 data format

HOST DTID ARCH SPEED DSIG

node4 40000 LINUX 1000 0x00408841

node1 80000 LINUX 1000 0x00408841

node2 c0000 LINUX 1000 0x00408841

pvm>

If you need more syntaks that can type on pvm mode (pvm > ), do you type help

pvm> help

help

help Print helpful information about a command

Syntax: help [ command ]

Commands are:

addAdd hosts to virtual machine

aliasDefine/list command aliases

confList virtual machine configuration

deleteDelete hosts from virtual machine

echoEcho arguments

exportAdd environment variables to spawn export list

getoptDisplay PVM options for the console task

haltStop pvmds

helpPrint helpful information about a command

idPrint console task id

jobsDisplay list of running jobs

killTerminate tasks

mstatShow status of hosts

namesList message mailbox names

psList tasks

pstatShow status of tasks

putAdd entry to message mailbox

quitExit console

resetKill all tasks, delete leftover mboxes

setenvDisplay or set environment variables

setoptSet PVM options – for the console task *only*!

sigSend signal to task

spawnSpawn task

traceSet/display trace event mask

unaliasUndefine command alias

unexportRemove environment variables from spawn export list

versionShow libpvm version

pvm>

2. Add node manually

we add another node with type add node_name

[root@node4 lib]# pvm

pvm> conf

conf

1 host, 1 data format

HOST DTID ARCH SPEED DSIG

node4 40000 LINUX 1000 0x00408841

pvm> add node1

add node1

1 successful

HOST DTID

node1 80000

pvm> add node2

add node2

1 successful

HOST DTID

node2 c0000

pvm> conf

conf

3 hosts, 1 data format

HOST DTID ARCH SPEED DSIG

node4 40000 LINUX 1000 0x00408841

node1 80000 LINUX 1000 0x00408841

node2 c0000 LINUX 1000 0x00408841

pvm>

Now every node is connected

Important:

pvm > halt is not same with pvm > quit. pvm > halt is shutdown the pvm and pvm > quit is pvm still working and quit from pvm mode ( pvm > ). This even sometime is happen, that is your PC shutdown with automatic or do you intentionally shutting down your PC but the pvm cluster is working. And do you swith on your PC again then type pvm

# pvm

pvm already running

#

Don’t be so confuse, if it happen you can delete temporary file of pvm that it still running on /tmp

# rm -rf /tmp/pvm*

#pvm

pvm >

Try our example

Change your directory on /usr/local/pvm3/example

[root@node1 root]# cd /usr/local/pvm3/example

[root@node4 examples]# aimk master1 slave1

making in LINUX/ for LINUX

cc -g -I../../include -DSYSVSIGNAL -DNOWAIT3 -DRSHCOMMAND=\”/usr/bin/ssh\” -DNEEDENDIAN -DFDSETNOTSTRUCT -DHASERRORVARS -DCTIMEISTIMET -DSYSERRISCONST -DNOTMPNAM -o master1 ../../examples/master1.c -L../../lib/LINUX -lpvm3

../../lib/LINUX/libpvm3.a(lpvmgen.o)(.text+0x292): In function `pvmlogperror’:

: `sys_errlist’ is deprecated; use `strerror’ or `strerror_r’ instead

../../lib/LINUX/libpvm3.a(lpvmgen.o)(.text+0x289): In function `pvmlogperror’:

: `sys_nerr’ is deprecated; use `strerror’ or `strerror_r’ instead

mv master1 ../../bin/LINUX

……….

………..

[root@node4 examples]# cd ../bin/LINUX

copy slave1 to client node (node 2 &1)

[root@node4 LINUX]# scp slave1 root@node1:/usr/local/pvm3/bin/LINUX

slave1 100% |*****************************| 144 KB 00:00

then program master1

[root@node4 LINUX]# ./master1

Spawning 9 worker tasks … SUCCESSFUL

I got 1300.000000 from 7; (expecting 1300.000000)

I got 1500.000000 from 8; (expecting 1500.000000)

I got 700.000000 from 4; (expecting 700.000000)

I got 800.000000 from 0; (expecting 800.000000)

I got 100.000000 from 1; (expecting 100.000000)

I got 900.000000 from 5; (expecting 900.000000)

I got 300.000000 from 2; (expecting 300.000000)

I got 500.000000 from 3; (expecting 500.000000)

I got 1100.000000 from 6; (expecting 1100.000000)

[root@node4 LINUX]#

Finally right now we can spawning the program to cluster.

Alhamdulillah, we can finish this tutorial to build PVM with SSH Passwordless. In this tutorial, maybe process of writing still have something in lacking. So I apreciated if you send suggestion me on e-mail thyspir4@gmail.com or thyspir@gmail.com,,,, because I still learn it.

If you want to download complete this tutorial, just click this

Taufik Hidayat

Bachelor Degree of University Of Trunojoyo (insyallah on this year)

Bangkalan, Indonesia

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s