With PVM you will need additional libraries and parameters to compile the C code. To make the live easier for you it is better to use a shell script, which includes all the needed parameters. For that reason you should create a new file in your pvm_directory called "pcc".
Add the following rows into this file:
#!/bin/sh
#script to compile all C-progs in the subdirs
if [ $1 ]
then
echo "start compiling"
cc -c $1.c -I/packages/pvm3/include -xCC
cc -o $1 $1.o -I/packages/pvm3/include -L/packages/pvm3/lib/`/packages/pvm3/lib/pvmgetarch` -lpvm3 -lsocket -lnsl
echo "done"
else
echo "Parameter (filename without ending .c) missing."
fi
Save the file and make it executable with chmod: "chmod u+x pcc"
Now you can compile your code just with a simple command "pcc program_name"
PVM daemon
Before you can try to test your program you need to start the pvm daemon. However, first at all you need to add some environment variables and then you can start the daemon.
For this you should open a second shell and run the following commands:
module add pvm
ClusterA
pvm is a stand alone PVM task which allows the user to interactively query and modify the virtual machine. The console can be started and stopped multiple times on any of the hosts in the virtual machine without affecting PVM or any applications that may be running.
Here are some importend commands:
Do not forget to stop the PVM daemon after you finished your work. You can allocate the cluster only once with your user account. If you start PVM a second time you will get an error message.
If you get the error message "command not found" after the "module add pvm" command, then you should update you login profile. Run the following command and after it logout and login again:
/etc/local/dotfiles/restore_ssu
Here is the hello sample to make some first test's (please change in the hello.c file the path to hello_other.c to your own directory): hello.c hello_other.c
To see the difference between SPMD and Master/Slave look here: examples