About Me

My photo
A Computer Enthusiast who's learning as much as I can, while attempting to share and re-distribute the knowledge! Enjoy! :D
Showing posts with label red hat enterprise linux. Show all posts
Showing posts with label red hat enterprise linux. Show all posts

Tuesday, May 25, 2010

Parallel Tools Platform (PTP) Plugin for Eclipse + OpenMPI

Quickstart

Assumption: A working Eclipse Development Environment successfully installed (JDT, J2EE, CDT).

1. Install the CDT (if not already installed). Replace Galileo with your version of Eclipse (Europa)
  • Help --> Install New Software
  • Work With --> Galileo --> http://download.eclipse.org/release/galileo
  • Programming Languages --> Eclipse C/C++ Development Tools

2. Install the PTP Plugin. Replace Galileo with your version of Eclipse (Europa), and Insert your own name for the NAME field
  • Help --> Install New Software
  • Work With --> Add
  • PTP (NAME)
  • http://download.eclipse.org/tools/ptp/releases/galileo (Location)

3. Install the following software (This is the minimal plugins I use for OpenMPI):
  • Parallel Tools Platform: Parallel Tools Platform Core
  • Parallel Tools Platform: Parallel Tools Platform End-User
  • Parallel Tools Platform: PTP Common Utilities
  • Parallel Tools Platform: PTP Parallel Language Development Tools
  • Parallel Tools Platform: PTP Scalable Debug Manager
  • Parallel Tools Platform: PTP Support for OpenMPI

You now have a fully functional environment to begin using Eclipse as your Parallel Computing IDE!

A few more steps are necessary to actually compile and run your OpenMPI code ...

Specify the MPI include path

1. Within the Eclipse IDE
  • Window --> Preferences (OS X: Eclipse --> Preferences)
  • Select Parallel Tools
  • Parallel Language Development Tools --> MPI
  • Under MPI --> Include Paths --> New

2. Navigate to the location of your include files for OpenMPI
  • /home/mlagatuz/Desktop/openmpi/include (Red Hat Enterprise Linux)
  • /usr/include (OS X) --> If I used the GUI, I needed to select /Developer/SDKs/MacOSX10.6.sdk/usr/include

6. Apply and OK

7. For some odd reason, the above steps only cover C, not C++. You will need to complete the following for C++
  • Right-Click on your project name --> Select Properties --> C/C++ General --> Paths and Symbols
  • Under Includes Tab --> Select GNU C++ --> Add
  • Navigate to your include files for OpenMPI (same as above)
  • Apply and OK

Adding a Resource Manager

This allows you to submit jobs onto your localhost. This assumes you will be running only on your own workstation, and not on a cluster.

1. Switch to the Parallel Runtime Perspective

2. Right click on the Resource Manager

3. Click on Resource Manager

4. Select Resource Manager Type: for this example it will be OpenMPI. This will be different if you have another version of MPI (MPICH).

5. During the next couple of screens, selecting the default options will suffice. You would deviate if you're working on a cluster

6. Start Resource Manager

--
Resources

1. Setup for MPI tools within the Parallel Language Development Tools
  • http://www.eclipse.org/ptp/documentation/org.eclipse.ptp.pldt.help/html/setup.html

2. Trial & Error

OpenMPI Quickstart

Setting up your environment for OpenMPI: Quickstart

Assumptions: C and C++ compilers are already installed (usually located in /usr/bin). Additionally, if you have root (or write) access to /usr/local/bin, then after untar'ing the file (step 3), remove the prefix on Step 5.

1. Download the latest openmpi source files:

  • http://www.open-mpi.org/software/ompi/v1.4/

2. Find out how many processors are available to utilize:

[mlagatuz@fedora-boot Download]$ grep 'processor.*:'\
/proc/cpuinfo | wc -l
2
[mlagatuz@fedora-boot Download]$

3. cd into the download directory and untar the file

[mlagatuz@fedora-boot Download]$ tar -xzf \
openmpi-1.4.2.tar.gz

4. cd into the newly created openmpi- directory and view the INSTALL file. Here you will find more information on how to intall OpenMPI

[mlagatuz@fedora-boot Download]$ cd openmpi-1.4.2
[mlagatuz@fedora-boot Download]$ less INSTALL

5. Run configure (./configure) and append the prefix option with your preference of binary installation location (/home/mlagatuz/Desktop/openmpi for me)
[mlagatuz@fedora-boot openmpi-1.4.2]$ ./configure \
--prefix=/home/mlagatuz/Desktop/openmpi

6. Run within the same the directory --> make all install
[mlagatuz@fedora-boot openmpi-1.4.2]$ make all install

7. cd into your home directory and edit your .bash_profile (or .cshrc) to include the binary installation location within your PATH, then source it
[mlagatuz@fedora-boot build]$ cd
[mlagatuz@fedora-boot ~]$ vi .bash_profile

PATH=$PATH:$HOME/bin:/home/mlagatuz/Desktop/openmpi/bin

You now have a fully functionally parallel processing environment!
[mlagatuz@fedora-boot ~]$ which mpic++
~/Desktop/openmpi/bin/mpic++
[mlagatuz@fedora-boot ~]$
--
Resources

1. MPI in 30 Minutes
  • http://www.linux-mag.com/id/5759
2. Trial & Error

Monday, May 24, 2010

CUDA (Version 3.0) on Linux

Installing a working CUDA Environment

Assumptions: You have a working c/c++ environment (compilers and libraries)

I was able to install the drivers, toolkit, and SDK on Red Hat Enterprise 5 (without root access).

Please refer to NVIDIA's CUDA website to confirm your video card is CUDA ready (or you can check it here --> http://www.nvidia.com/object/cuda_gpus.html

1. Create the following directories on your Desktop (or another location specified by you):
  • Download Directory: /path/to/your/Desktop/cudaDownload (create the cudaDownload directory)
  • CUDA Installation Directory: /path/to/your/Desktop/cudadir (create the cudadir directory)
  • SDK Installation Directory: /path/to/your/Desktop/NVIDIA_GPU_COMPUTING_SDK ( create the NVIDIA_GPU_COMPUTING_SDK)

2. Set the following variables in your .bash_profile or .cshrc (I use csh at work, but bash at home)
  • PATH: /cuda/bin
  • LD_LIBRARY_PATH: /cuda/lib

3. Download the Development Drivers, Toolkit, and SDK from:
  • http://developer.nvidia.com/object/cuda_3_0_downloads.html

4. Install the drivers as root. If you've installed Proprietary NVIDIA drivers before, the process is the same. I wasn't able to install the drivers at work b/c of the root access problem:
  • Alt-Ctrl-F2
  • Log in as root (or yourself)
  • Stop your window manager: telinit 3 usually does it
  • Become root (if not already)
  • Navigate to the directory where you've downloaded the NVIDIA graphic drivers
  • Run sh .run

5. I usually reboot the system after installing the video card drivers, but I guess you could restart the window manager and log back in.

6. Install the Toolkit

7. Install the SDK:
I ran into a few problems at this point. Some Linux distributions look for glut libraries (specifically libglut.so) in /usr/lib (/usr/lib64 for 64-bit libraries). Red Hat Enterprise was complaining about -lglut library not being found when I ran the make command. A Google search led me to this website:
  • http://forums.nvidia.com/lofiversion/index.php?t46575.html
It explains on how I need to create a symbolic link (which you may or may not need to complete).

[root@rhel-boot lib] pwd
/usr/lib
[root@rhel-boot lib] ln -s /usr/lib/libglut.so.3 /usr/lib/libglut.so
[root@rhel-boot lib] cd ../lib64
[root@rhel-boot lib] ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so

cd into /path/to/your/Desktop/NVIDIA_GPU_Computing_SDK/C

run the make command

8. At this point after the make command you should have a fully functional CUDA Development Environment. To test your environment:
  • cd into /path/to/your/Desktop/NVIDA_GPU_Computing_SDK/C/bin/linux/release
  • execute the binary deviceQuery: ./deviceQuery

The output should give you information on your CUDA Enabled Device!

--
Resources

1. NVIDIA CUDA 3.0 Downloads
  • http://developer.nvidia.com/object/cuda_3_0_downloads.html
2. NVIDIA Forums
  • http://forums.nvidia.com/lofiversion/index.php?t46575.html
3. Trial & Error