<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Seventh Sense &#187; MichiganTech</title>
	<atom:link href="http://sgowtham.net/blog/category/arts-science/michigan-tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://sgowtham.net/blog</link>
	<description>Rambling about life&#039;s little things, in 7 ≡ 1 (mod 6) fashion</description>
	<lastBuildDate>Tue, 28 Feb 2012 23:25:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
	<title>Seventh Sense</title>
	<url>http://sgowtham.net/images/sg_logo_rss.png</url>
	<link>http://sgowtham.net/blog</link>
	<width>32</width>
	<height>32</height>
	</image>
		<item>
		<title>HPL 2.0 Benchmark With GCC 4.1.2 On Rocks 5.4.2</title>
		<link>http://sgowtham.net/blog/2012/02/27/hpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/</link>
		<comments>http://sgowtham.net/blog/2012/02/27/hpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 23:44:17 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Clusters]]></category>
		<category><![CDATA[HPL]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=3361</guid>
		<description><![CDATA[Disclaimer The instructions/steps given below worked for me (and Michigan Technological University) running NPACI Rocks 5.4.2 (with CentOS 5.5) &#8211; as has been a common practice for several years now, a full version of Operating System was installed. These instructions may very well work for you (or your institution), on Rocks-like or other linux clusters. [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>The instructions/steps given below worked for me (and <a href="http://www.mtu.edu/" target="_blank" class="underline">Michigan Technological University</a>) running <a href="http://www.rocksclusters.org/" class="underline" target="_blank">NPACI Rocks</a> 5.4.2 (with CentOS 5.5) &#8211; as has been a common practice for several years now, a full version of Operating System was installed. These instructions may very well work for you (or your institution), on Rocks-like or other linux clusters. Please note that if you decide to use these instructions on your machine, you are doing so entirely at your very own discretion and that neither this site, <em>sgowtham.net</em>, nor its author (or Michigan Technological University) is responsible for any/all damage – intellectual and/or otherwise.</p>
<p><br clear="all"></p>
<h3 class="blog">A Bit About HPL</h3>
<blockquote><p><a href="http://netlib.org/linpack/" class="underline" target="_blank">LINPACK</a> is a software library for performing numerical linear algebra on computers. It was written in FORTRAN by Jack Dongarra, Jim Bunch, Cleve Moler and Gilbert Stewart. LINPACK makes use of the <a href="http://www.netlib.org/blas/" class="underline" target="_blank">BLAS</a> libraries for performing basic vector and matrix operations. It has largely been superseded by LAPACK, which runs more efficiently on modern architectures.</p>
<p>The LINPACK benchmarks are a measure of a system&#8217;s floating point computing power. Introduced by Jack Dongarra, they measure how fast a computer solves a dense <code>N * N</code> system of linear equations, <code>Ax = b</code>. The solution is obtained by <em>Gaussian Elimination with Partial Pivoting</em>, with</p>
<p class="bpcaption"><img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B2%7D%7B3%7D%5C%3AN%5E3%20%5C%3A%2B%5C%3A%202%5C%3AN%5E2%20%5C%3A%2B%5C%3A%20%5Cmathcal%7BO%7D%5Cleft%28N%5Cright%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\frac{2}{3}\:N^3 \:+\: 2\:N^2 \:+\: \mathcal{O}\left(N\right)' title='\frac{2}{3}\:N^3 \:+\: 2\:N^2 \:+\: \mathcal{O}\left(N\right)' class='latex' /></p>
<p>floating point iterations. The result is often expressed in billions of floating point operations per second (<code>GFLOPS</code>). <a href="http://netlib.org/benchmark/hpl/" class="underline" target="_blank">HPL</a>, a portable implementation of <em>High Performance LINPACK Benchmark</em>, is used as a performance measure for ranking the supercomputers in the <a href="http://www.top500.org/" target="_blank" class="underline">Top500</a> list.
</p></blockquote>
<p><br clear="all"></p>
<h3 class="blog">Pre-requisite #1: MPI</h3>
<p>Following Rocks recommendations, this and other pre-requisites will be installed under <code>/share/apps/</code>; software installed by me, in clusters at Michigan Tech, have the following template for their folder structure:</p>
<p class="bpcaption"><code>/share/apps/Software/Software_Version/Compiler/Compiler_Version</code></p>
<p><br clear="all"><br />
Rocks 5.4.2 installation has an instance (of few flavors) of MPI but I prefer to compile <a href="http://www.mcs.anl.gov/research/projects/mpich2/" class="underline" target="_blank">MPICH2</a> using GCC 4.1.2. At the time of writing this post, the latest stable version of MPICH2 is 1.4.1p1 and it may be downloaded from <a href="http://www.mcs.anl.gov/research/projects/mpich2/" target="_blank" class="underline">here</a>.  Following folder structure/template mentioned above, it will be installed under</p>
<p class="bpcaption"><code>/share/apps/mpich2/1.4.1p1/gcc/4.1.2</code></p>
<p><br clear="all"><br />
To avoid confusion and/or missed steps leading to undesired results, steps associated with installation of MPICH2 have been put in the following script:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_mpich2.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install MPICH2 (compiled against GCC 4.1.2) on a</span>
<span style="color: #666666; font-style: italic;"># Rocks 5.4.2 cluster's front end</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;"># Set necessary variables</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CC</span>=<span style="color: #ff0000;">&quot;gcc&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXX</span>=<span style="color: #ff0000;">&quot;g++&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">FC</span>=<span style="color: #ff0000;">&quot;gfortran&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">F77</span>=<span style="color: #ff0000;">&quot;gfortran&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MPICH2_VERSION</span>=<span style="color: #ff0000;">&quot;1.4.1p1&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GCC_VERSION</span>=<span style="color: #ff0000;">&quot;4.1.2&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MPICH2_INSTALL</span>=<span style="color: #ff0000;">&quot;/share/apps/mpich2/<span style="color: #007800;">${MPICH2_VERSION}</span>/gcc/<span style="color: #007800;">${GCC_VERSION}</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ANL</span>=<span style="color: #ff0000;">&quot;http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs&quot;</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #0: Download MPICH2 to /share/apps/tmp&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #800000;">${ANL}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MPICH2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>mpich2-<span style="color: #800000;">${MPICH2_VERSION}</span>.tar.gz
&nbsp;
  <span style="color: #666666; font-style: italic;"># Begin mpich2-${MPICH2_VERSION}.tar.gz check IF</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;mpich2-<span style="color: #007800;">${MPICH2_VERSION}</span>.tar.gz&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #1: configure, make clean, make and make install&quot;</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxpf</span> mpich2-<span style="color: #800000;">${MPICH2_VERSION}</span>.tar.gz
    <span style="color: #7a0874; font-weight: bold;">cd</span> mpich2-<span style="color: #800000;">${MPICH2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>
    .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #800000;">${MPICH2_INSTALL}</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> clean
    <span style="color: #c20cb9; font-weight: bold;">make</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #2: Update <span style="color: #007800;">$HOME</span>/.bashrc&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
&nbsp;
  Add the following lines to $HOME/.bashrc and remember to source it
&nbsp;
  # MPICH2 (${MPICH2_VERSION}) settings
  export MPICH2=&quot;${MPICH2_INSTALL}&quot;
  export PATH=&quot;\${PATH}:\${MPICH2}/bin:\${MPICH2}/sbin&quot;
  export MANPATH=&quot;\${MANPATH}:\${MPICH2}/man&quot;
  export LD_LIBRARY_PATH=&quot;\${LD_LIBRARY_PATH}:\${MPICH2}/lib&quot;
&nbsp;
EOF</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># End mpich2-${MPICH2_VERSION}.tar.gz check IF</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"><br />
A good test of a successful installation is that <em>which mpicc</em>, <em>which mpif77</em>, etc. return the respective commands located in <code>${MPICH2_INSTALL}</code>.</p>
<p><br clear="all"></p>
<h3 class="blog">Pre-requisite #2: Goto BLAS</h3>
<p>As in the case of pre-requisite #1, this one will be installed under</p>
<p class="bpcaption"><code>/share/apps/gotoblas2/1.13/gcc/4.1.2</code></p>
<p><br clear="all"><br />
The following script, used in installation, will assume that one has downloaded Goto BLAS2 1.13 from <a href="http://www.tacc.utexas.edu/tacc-projects/gotoblas2" target="_blank" class="underline">here</a> and placed it in<br />
<code>/share/apps/tmp/</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_gotoblas2.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install Goto BLAS2 (compiled against GCC 4.1.2) on a</span>
<span style="color: #666666; font-style: italic;"># Rocks 5.4.2 cluster's front end</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;"># Set necessary variables</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CC</span>=<span style="color: #ff0000;">&quot;gcc&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXX</span>=<span style="color: #ff0000;">&quot;g++&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">FC</span>=<span style="color: #ff0000;">&quot;gfortran&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">F77</span>=<span style="color: #ff0000;">&quot;gfortran&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GOTOBLAS2_VERSION</span>=<span style="color: #ff0000;">&quot;1.13&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GCC_VERSION</span>=<span style="color: #ff0000;">&quot;4.1.2&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GOTOBLAS2_INSTALL</span>=<span style="color: #ff0000;">&quot;/share/apps/gotoblas2/<span style="color: #007800;">${GOTOBLAS2_VERSION}</span>/gcc/<span style="color: #007800;">${GCC_VERSION}</span>&quot;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Begin GotoBLAS2-${GOTOBLAS2_VERSION}.tar.gz check IF</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/share/apps/tmp/GotoBLAS2-<span style="color: #007800;">${GOTOBLAS2_VERSION}</span>.tar.gz&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>gotoblas2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${GOTOBLAS2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>gotoblas2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${GOTOBLAS2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>GotoBLAS2-<span style="color: #800000;">${GOTOBLAS2_VERSION}</span>.tar.gz
    <span style="color: #c20cb9; font-weight: bold;">mv</span> GotoBLAS2 <span style="color: #800000;">${GCC_VERSION}</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #0: make clean and make&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #800000;">${GOTOBLAS2_INSTALL}</span>
    <span style="color: #c20cb9; font-weight: bold;">make</span> clean
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">BINARY</span>=<span style="color: #000000;">64</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #1: Update <span style="color: #007800;">$HOME</span>/.bashrc&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
&nbsp;
  Add the following lines to $HOME/.bashrc and remember to source it
&nbsp;
  # GOTOBLAS2 (${GOTOBLAS2_VERSION}) settings
  export GOTOBLAS2=&quot;${GOTOBLAS2_INSTALL}&quot;
  export LD_LIBRARY_PATH=&quot;\${LD_LIBRARY_PATH}:\${GOTOBLAS2}&quot;
&nbsp;
EOF</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># End GotoBLAS2-${GOTOBLAS2_VERSION}.tar.gz check IF</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">HPL Installation/Compilation</h3>
<p>With MPICH2 and Goto BLAS2 in place, HPL 2.0 will be installed under</p>
<p class="bpcaption"><code>/share/apps/hpl/2.0/mpich2/1.4.1p1/gcc/4.1.2</code></p>
<p><br clear="all"><br />
The following script, used in installation, will assume that one has downloaded HPL 2.0 from <a href="http://netlib.org/benchmark/hpl/" target="_blank" class="underline">here</a> &#038; the necessary <code>Make.MPICH2141p1_GCC412.HPL</code> (listed below) and placed them in <code>/share/apps/tmp/</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
</pre></td><td class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Makefile (Make.MPICH2141p1_GCC412) used to compile HPL </span>
<span style="color: #339900; font-style: italic;"># on HPC clusters running NPACI Rocks (5.4.2) with CentOS (5.5)</span>
<span style="color: #339900; font-style: italic;"># at Michigan Technological University.</span>
<span style="color: #339900; font-style: italic;"># </span>
<span style="color: #339900; font-style: italic;"># Disclaimer:</span>
<span style="color: #339900; font-style: italic;"># Please note that you are using these instructions </span>
<span style="color: #339900; font-style: italic;"># at your very own risk and that Michigan Technological</span>
<span style="color: #339900; font-style: italic;"># University is not responsible for any/all damage caused to </span>
<span style="color: #339900; font-style: italic;"># your property, intellectual or otherwise.</span>
<span style="color: #339900; font-style: italic;"># </span>
<span style="color: #339900; font-style: italic;"># For additional help and/or comments, questions, suggestions,</span>
<span style="color: #339900; font-style: italic;"># please contact </span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Gowtham</span>
<span style="color: #339900; font-style: italic;"># Information Technology Services &amp; Security</span>
<span style="color: #339900; font-style: italic;"># Michigan Technological University</span>
<span style="color: #339900; font-style: italic;"># g@mtu.edu</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;">#  -- High Performance Computing Linpack Benchmark (HPL)                </span>
<span style="color: #339900; font-style: italic;">#     HPL - 2.0 - September 10, 2008                          </span>
<span style="color: #339900; font-style: italic;">#     Antoine P. Petitet                                                </span>
<span style="color: #339900; font-style: italic;">#     University of Tennessee, Knoxville                                </span>
<span style="color: #339900; font-style: italic;">#     Innovative Computing Laboratory                                 </span>
<span style="color: #339900; font-style: italic;">#     (C) Copyright 2000-2008 All Rights Reserved                       </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  -- Copyright notice and Licensing terms:                             </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  Redistribution and use in source and binary forms, with or without</span>
<span style="color: #339900; font-style: italic;">#  modification, are permitted provided that the following conditions</span>
<span style="color: #339900; font-style: italic;">#  are met:                                                             </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  1. Redistributions of source code must retain the above copyright</span>
<span style="color: #339900; font-style: italic;">#  notice, this list of conditions and the following disclaimer.        </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  2. Redistributions in binary form must reproduce the above copyright</span>
<span style="color: #339900; font-style: italic;">#  notice, this list of conditions, and the following disclaimer in the</span>
<span style="color: #339900; font-style: italic;">#  documentation and/or other materials provided with the distribution. </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  3. All advertising materials mentioning features or use of this</span>
<span style="color: #339900; font-style: italic;">#  software must display the following acknowledgement:                 </span>
<span style="color: #339900; font-style: italic;">#  This product includes software developed at the University of</span>
<span style="color: #339900; font-style: italic;">#  Tennessee, Knoxville, Innovative Computing Laboratory.             </span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  4. The name of the University, the name of the Laboratory, or the</span>
<span style="color: #339900; font-style: italic;">#  names of its contributors may not be used to endorse or promote</span>
<span style="color: #339900; font-style: italic;">#  products derived from this software without specific written</span>
<span style="color: #339900; font-style: italic;">#  permission.</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;">#  -- Disclaimer:</span>
<span style="color: #339900; font-style: italic;">#                                                                       </span>
<span style="color: #339900; font-style: italic;">#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span>
<span style="color: #339900; font-style: italic;">#  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span>
<span style="color: #339900; font-style: italic;">#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span>
<span style="color: #339900; font-style: italic;">#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY</span>
<span style="color: #339900; font-style: italic;">#  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<span style="color: #339900; font-style: italic;">#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span>
<span style="color: #339900; font-style: italic;">#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span>
<span style="color: #339900; font-style: italic;">#  DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span>
<span style="color: #339900; font-style: italic;">#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<span style="color: #339900; font-style: italic;">#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span>
<span style="color: #339900; font-style: italic;">#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<span style="color: #339900; font-style: italic;">#  </span>
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Shell Details</span>
SHELL        <span style="color: #004400;">=</span> <span style="color: #004400;">/</span>bin<span style="color: #004400;">/</span>sh
CD           <span style="color: #004400;">=</span> cd
CP           <span style="color: #004400;">=</span> cp
LN_S         <span style="color: #004400;">=</span> ln <span style="color: #004400;">-</span>s
MKDIR        <span style="color: #004400;">=</span> mkdir
RM           <span style="color: #004400;">=</span> <span style="color: #004400;">/</span>bin<span style="color: #004400;">/</span>rm <span style="color: #004400;">-</span>f
TOUCH        <span style="color: #004400;">=</span> touch
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Platform Identifier</span>
ARCH         <span style="color: #004400;">=</span> MPICH2141p1_GCC412
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># HPL Directory Structure / HPL library</span>
TOPdir       <span style="color: #004400;">=</span> <span style="color: #004400;">/</span>share<span style="color: #004400;">/</span>apps<span style="color: #004400;">/</span>hpl<span style="color: #004400;">/</span><span style="color: #CC2200;">2.0</span><span style="color: #004400;">/</span>mpich2<span style="color: #004400;">/</span>1<span style="color: #004400;">.</span>4<span style="color: #004400;">.</span>1p1<span style="color: #004400;">/</span>gcc<span style="color: #004400;">/</span>4<span style="color: #004400;">.</span>1<span style="color: #004400;">.</span>2
INCdir       <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TOPdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span><span style="color: #666622; font-weight: bold;">include</span>
BINdir       <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TOPdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>bin<span style="color: #004400;">/$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">ARCH</span><span style="color: #004400;">&#41;</span>
LIBdir       <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TOPdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>lib<span style="color: #004400;">/$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">ARCH</span><span style="color: #004400;">&#41;</span>
HPLlib       <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LIBdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>libhpl<span style="color: #004400;">.</span>a 
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Message Passing library (MPI)</span>
MPdir        <span style="color: #004400;">=</span> <span style="color: #004400;">/</span>share<span style="color: #004400;">/</span>apps<span style="color: #004400;">/</span>mpich2<span style="color: #004400;">/</span>1<span style="color: #004400;">.</span>4<span style="color: #004400;">.</span>1p1<span style="color: #004400;">/</span>gcc<span style="color: #004400;">/</span>4<span style="color: #004400;">.</span>1<span style="color: #004400;">.</span>2
MPinc        <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MPdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span><span style="color: #666622; font-weight: bold;">include</span>
MPlib        <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MPdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/</span>lib<span style="color: #004400;">/</span>libmpich<span style="color: #004400;">.</span>a
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Linear Algebra library (BLAS)</span>
LAlib        <span style="color: #004400;">=</span> <span style="color: #004400;">/</span>share<span style="color: #004400;">/</span>apps<span style="color: #004400;">/</span>gotoblas2<span style="color: #004400;">/</span><span style="color: #CC2200;">1.13</span><span style="color: #004400;">/</span>gcc<span style="color: #004400;">/</span>4<span style="color: #004400;">.</span>1<span style="color: #004400;">.</span>2<span style="color: #004400;">/</span>libgoto2<span style="color: #004400;">.</span>a
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># F77 / C Interface</span>
<span style="color: #339900; font-style: italic;"># You can skip this section if and only if you are not planning to use</span>
<span style="color: #339900; font-style: italic;"># a BLAS library featuring a Fortran 77 interface. Otherwise, it is</span>
<span style="color: #339900; font-style: italic;"># necessary to fill out the F2CDEFS variable with the appropriate</span>
<span style="color: #339900; font-style: italic;"># options. **One and only one** option should be chosen in **each** of</span>
<span style="color: #339900; font-style: italic;"># the 3 following categories:</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># 1) name space (How C calls a Fortran 77 routine)</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># -DAdd_              : all lower case and a suffixed underscore (Suns,</span>
<span style="color: #339900; font-style: italic;">#                       Intel, ...) [default]</span>
<span style="color: #339900; font-style: italic;"># -DNoChange          : all lower case (IBM RS6000)</span>
<span style="color: #339900; font-style: italic;"># -DUpCase            : all upper case (Cray)</span>
<span style="color: #339900; font-style: italic;"># -DAdd__             : the FORTRAN compiler in use is f2c</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># 2) C and Fortran 77 integer mapping</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># -DF77_INTEGER=int   : Fortran 77 INTEGER is a C int [default]</span>
<span style="color: #339900; font-style: italic;"># -DF77_INTEGER=long  : Fortran 77 INTEGER is a C long</span>
<span style="color: #339900; font-style: italic;"># -DF77_INTEGER=short : Fortran 77 INTEGER is a C short</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># 3) Fortran 77 string handling</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># -DStringSunStyle    : The string address is passed at the string location</span>
<span style="color: #339900; font-style: italic;">#                       on the stack, and the string length is then</span>
<span style="color: #339900; font-style: italic;">#                       passed as an F77_INTEGER after all explicit</span>
<span style="color: #339900; font-style: italic;">#                       stack arguments [default]</span>
<span style="color: #339900; font-style: italic;"># -DStringStructPtr   : The address of a structure is passed by a</span>
<span style="color: #339900; font-style: italic;">#                       Fortran 77 string, and the structure is of the</span>
<span style="color: #339900; font-style: italic;">#                       form: struct {char *cp; F77_INTEGER len;}</span>
<span style="color: #339900; font-style: italic;"># -DStringStructVal   : A structure is passed by value for each Fortran</span>
<span style="color: #339900; font-style: italic;">#                       77 string, and the structure is of the form:</span>
<span style="color: #339900; font-style: italic;">#                       struct {char *cp; F77_INTEGER len;}</span>
<span style="color: #339900; font-style: italic;"># -DStringCrayStyle   : Special option for Cray machines, which uses</span>
<span style="color: #339900; font-style: italic;">#                       Cray fcd (fortran character descriptor) for</span>
<span style="color: #339900; font-style: italic;">#                       interoperation</span>
F2CDEFS      <span style="color: #004400;">=</span>  <span style="color: #004400;">-</span>DAdd_
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># HPL Includes / Libraries / Specifics</span>
HPL_INCLUDES <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">INCdir</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">INCdir</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">ARCH</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LAinc</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MPinc</span><span style="color: #004400;">&#41;</span>
HPL_LIBS     <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HPLlib</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LAlib</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MPlib</span><span style="color: #004400;">&#41;</span>
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># HPL Compile Time Options</span>
<span style="color: #339900; font-style: italic;"># -DHPL_COPY_L           force the copy of the panel L before bcast</span>
<span style="color: #339900; font-style: italic;"># -DHPL_CALL_CBLAS       call the cblas interface</span>
<span style="color: #339900; font-style: italic;"># -DHPL_CALL_VSIPL       call the vsip library</span>
<span style="color: #339900; font-style: italic;"># -DHPL_DETAILED_TIMING  enable detailed timers</span>
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># By default HPL will:</span>
<span style="color: #339900; font-style: italic;">#    *) not copy L before broadcast</span>
<span style="color: #339900; font-style: italic;">#    *) call the BLAS Fortran 77 interface</span>
<span style="color: #339900; font-style: italic;">#    *) not display detailed timing information</span>
HPL_OPTS     <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>DHPL_COPY_L <span style="color: #004400;">-</span>DHPL_CALL_CBLAS <span style="color: #004400;">-</span>DHPL_DETAILED_TIMING 
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># HPL Definitions</span>
HPL_DEFS     <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">F2CDEFS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HPL_OPTS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HPL_INCLUDES</span><span style="color: #004400;">&#41;</span>
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># Compilers / linkers - Optimization Flags</span>
CC           <span style="color: #004400;">=</span> mpicc
CCNOOPT      <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HPL_DEFS</span><span style="color: #004400;">&#41;</span>
CCFLAGS      <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">HPL_DEFS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>fomit<span style="color: #004400;">-</span>frame<span style="color: #004400;">-</span>pointer <span style="color: #004400;">-</span>O3 <span style="color: #004400;">-</span>funroll<span style="color: #004400;">-</span>loops <span style="color: #004400;">-</span>W <span style="color: #004400;">-</span>Wall
&nbsp;
<span style="color: #339900; font-style: italic;">#</span>
<span style="color: #339900; font-style: italic;"># On some platforms, it is necessary to use the Fortran linker </span>
<span style="color: #339900; font-style: italic;"># to find the Fortran internals used in the BLAS library</span>
LINKER       <span style="color: #004400;">=</span> mpif77
LINKFLAGS    <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CCFLAGS</span><span style="color: #004400;">&#41;</span>
ARCHIVER     <span style="color: #004400;">=</span> ar
ARFLAGS      <span style="color: #004400;">=</span> r
RANLIB       <span style="color: #004400;">=</span> echo
<span style="color: #339900; font-style: italic;">#</span></pre></td></tr></table></div>

<p><br clear="all"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_hpl.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install HPL 2.0 (compiled against MPICH2 1.4.1p1) on a</span>
<span style="color: #666666; font-style: italic;"># Rocks 5.4.2 cluster's front end</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;"># Set necessary variables</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HPL_VERSION</span>=<span style="color: #ff0000;">&quot;2.0&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MPICH2_VERSION</span>=<span style="color: #ff0000;">&quot;1.4.1p1&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GCC_VERSION</span>=<span style="color: #ff0000;">&quot;4.1.2&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HPL_INSTALL</span>=<span style="color: #ff0000;">&quot;/share/apps/hpl/<span style="color: #007800;">${HPL_VERSION}</span>/mpich2/<span style="color: #007800;">${MPICH2_VERSION}</span>/gcc/<span style="color: #007800;">${GCC_VERSION}</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MAKEFILE_ARCH</span>=<span style="color: #ff0000;">&quot;MPICH2141p1_GCC412&quot;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Begin hpl-${HPL_VERSION}.tar.gz check IF</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/share/apps/tmp/hpl-<span style="color: #007800;">${HPL_VERSION}</span>.tar.gz&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>hpl<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${HPL_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>mpich2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MPICH2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>hpl<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${HPL_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>mpich2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MPICH2_VERSION}</span><span style="color: #000000; font-weight: bold;">/</span>gcc<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>hpl-<span style="color: #800000;">${HPL_VERSION}</span>.tar.gz
    <span style="color: #c20cb9; font-weight: bold;">mv</span> hpl-<span style="color: #800000;">${HPL_VERSION}</span> <span style="color: #800000;">${GCC_VERSION}</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #0: copy the makefile, make clean and make&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #800000;">${HPL_INSTALL}</span>
    <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>Make.<span style="color: #800000;">${MAKEFILE_ARCH}</span>.HPC .<span style="color: #000000; font-weight: bold;">/</span>Make.<span style="color: #800000;">${MAKEFILE_ARCH}</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${HPL_INSTALL}</span>/bin/<span style="color: #007800;">${MAKEFILE_ARCH}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #c20cb9; font-weight: bold;">make</span> clean <span style="color: #007800;">arch</span>=<span style="color: #800000;">${MAKEFILE_ARCH}</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(ls -A ${HPL_INSTALL}/bin)</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>;
    <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #c20cb9; font-weight: bold;">make</span> clean_arch_all <span style="color: #007800;">arch</span>=<span style="color: #800000;">${MAKEFILE_ARCH}</span> 
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">arch</span>=<span style="color: #800000;">${MAKEFILE_ARCH}</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #1: Update <span style="color: #007800;">$HOME</span>/.bashrc&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
&nbsp;
  Add the following lines to $HOME/.bashrc and remember to source it
&nbsp;
  # HPL (${HPL_VERSION}) settings
  export HPL=&quot;${HPL_INSTALL}&quot;
  export PATH=&quot;\${PATH}:\${HPL}/bin/${MAKEFILE_ARCH}&quot;
  export LD_LIBRARY_PATH=&quot;\${LD_LIBRARY_PATH}:\${HPL}/${MAKEFILE_ARCH}&quot;
&nbsp;
EOF</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># End hpl-${HPL_VERSION}.tar.gz check IF</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">Running HPL Benchmark</h3>
<p>The amount of memory used by HPL is essentially the size of the co-efficient matrix, <code>A</code>. Following standard binary definition, 1 GB is 1024 * 1024 * 1024 bytes (<code>TOTAL_MEMORY_BYTES</code>). Most scientific/engineering computations use double precision numbers, with each such double precision number taking 8 bytes of memory. Thus, 1 GB can accommodate 134,217,728 double precision entities (<code>TOTAL_DP_ELEMENTS = TOTAL_MEMORY_BYTES/8</code>). Theoretically, <code>sqrt(TOTAL_DP_ELEMENTS)</code> represents the maximum possible value of <code>N</code>. However, operating system needs some memory to perform some necessary operations. As such, HPL benchmark is usually performed for the following values of <code>N</code> &#8211; with <code>m</code> representing the fraction of total memory &#8211; making sure that swapping did not occur (which would result in reduced performance).</p>
<p class="bpcaption"><img src='http://s.wordpress.com/latex.php?latex=N%20%5C%3A%3D%5C%3A%20m%5C%3A%5Csqrt%7B%5Cmathrm%7BTOTAL%5C_DP%5C_ELEMENTS%7D%7D%20%20%5Chspace%7B0.50in%7D%20m%3A%200.50%5C%3A%280.10%29%5C%3A0.80&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='N \:=\: m\:\sqrt{\mathrm{TOTAL\_DP\_ELEMENTS}}  \hspace{0.50in} m: 0.50\:(0.10)\:0.80' title='N \:=\: m\:\sqrt{\mathrm{TOTAL\_DP\_ELEMENTS}}  \hspace{0.50in} m: 0.50\:(0.10)\:0.80' class='latex' /></p>
<p><br clear="all"><br />
HPL uses the block size (<code>NB</code>) for the data distribution as well as for the computational granularity. From a data distribution perspective, the smaller <code>NB</code>, the better the load balance. From a computational perspective, too small of a value for <code>NB</code> may limit the computational performance by a large factor since almost no data re-use will occur in the highest level of the memory hierarchy. The number of messages will also increase. In my case, this benchmark was performed for <code>NB</code> values of 128, 256 and 512.</p>
<p>The results so obtained are compared with the theoretical peak value, <img src='http://s.wordpress.com/latex.php?latex=%5Cmathrm%7BGFLOPS%7D_%5Cmathrm%7BTheory%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathrm{GFLOPS}_\mathrm{Theory}' title='\mathrm{GFLOPS}_\mathrm{Theory}' class='latex' />, computed as follows:</p>
<p><br clear="all"></p>
<p class="bpcaption"><img src='http://s.wordpress.com/latex.php?latex=%20%5Cmbox%7B%5C%23%20of%20Nodes%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B%5C%23%20of%20Sockets%2FNode%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B%5C%23%20of%20Cores%2FSocket%7D%20%5C%3B%5Ctimes%5C%3B%20%5C%5C%5C%5C%5Cmbox%7BCPU%20Frequency%20%28Cycles%2Fsecond%29%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B%5C%23%20of%20Floating%20Point%20Operations%2FCycle%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt=' \mbox{\# of Nodes} \;\times\; \mbox{\# of Sockets/Node} \;\times\; \mbox{\# of Cores/Socket} \;\times\; \\\\\mbox{CPU Frequency (Cycles/second)} \;\times\; \mbox{\# of Floating Point Operations/Cycle}' title=' \mbox{\# of Nodes} \;\times\; \mbox{\# of Sockets/Node} \;\times\; \mbox{\# of Cores/Socket} \;\times\; \\\\\mbox{CPU Frequency (Cycles/second)} \;\times\; \mbox{\# of Floating Point Operations/Cycle}' class='latex' /></p>
<p><br clear="all"><br />
For e.g., for a cluster with 16 identical <em>recent</em> Intel architecture compute nodes, each compute node with dual hex cores @ 3.00 GHz, <img src='http://s.wordpress.com/latex.php?latex=%5Cmathrm%7BGFLOPS%7D_%5Cmathrm%7BTheory%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathrm{GFLOPS}_\mathrm{Theory}' title='\mathrm{GFLOPS}_\mathrm{Theory}' class='latex' /> will be</p>
<p><br clear="all"></p>
<p class="bpcaption"><img src='http://s.wordpress.com/latex.php?latex=%20%5Cmbox%7B16%20%28%5C%23%20of%20Nodes%29%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B2%20%28%5C%23%20of%20Sockets%2FNode%29%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B6%20%28%5C%23%20of%20Cores%2FSocket%29%7D%20%5C%3B%5Ctimes%5C%3B%20%5C%5C%5C%5C%5Cmbox%7B3%20G%20%5BCPU%20Frequency%20%28Cycles%2Fsecond%29%5D%7D%20%5C%3B%5Ctimes%5C%3B%20%5Cmbox%7B4%20%28%5C%23%20of%20Floating%20Point%20Operations%2FCycle%29%7D%5C%5C%5C%5C%20%3D%202304%20%5Cmbox%7B%20GFLOPS%7D%20%5C%5C%5C%5C%20%5Capprox%202.3%20%5Cmbox%7B%20TFLOPS%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt=' \mbox{16 (\# of Nodes)} \;\times\; \mbox{2 (\# of Sockets/Node)} \;\times\; \mbox{6 (\# of Cores/Socket)} \;\times\; \\\\\mbox{3 G [CPU Frequency (Cycles/second)]} \;\times\; \mbox{4 (\# of Floating Point Operations/Cycle)}\\\\ = 2304 \mbox{ GFLOPS} \\\\ \approx 2.3 \mbox{ TFLOPS}' title=' \mbox{16 (\# of Nodes)} \;\times\; \mbox{2 (\# of Sockets/Node)} \;\times\; \mbox{6 (\# of Cores/Socket)} \;\times\; \\\\\mbox{3 G [CPU Frequency (Cycles/second)]} \;\times\; \mbox{4 (\# of Floating Point Operations/Cycle)}\\\\ = 2304 \mbox{ GFLOPS} \\\\ \approx 2.3 \mbox{ TFLOPS}' class='latex' /></p>
<p><br clear="all"><br />
If each of these nodes had 24 GB RAM, then <code>TOTAL_MEMORY_BYTES = 1024 * 1024 * 1024 * 24 * 16 = 412316860416</code><br />
and <code>TOTAL_DP_ELEMENTS = 412316860416/8 = 51539607552</code>. </p>
<p>As such, <code>N</code> values will be</p>
<p><br clear="all"></p>
<p class="bpcaption"><img src='http://s.wordpress.com/latex.php?latex=N%20%5C%3A%3D%5C%3A%20m%5C%3A%5Ctimes%5C%3A%20%5Csqrt%7B51539607552%7D%20%5C%3A%5Capprox%5C%3A%20m%5C%3A%5Ctimes%5C%3A%20227020%20%5Chspace%7B0.50in%7D%20m%3A%200.50%5C%3A%280.10%29%5C%3A0.80&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='N \:=\: m\:\times\: \sqrt{51539607552} \:\approx\: m\:\times\: 227020 \hspace{0.50in} m: 0.50\:(0.10)\:0.80' title='N \:=\: m\:\times\: \sqrt{51539607552} \:\approx\: m\:\times\: 227020 \hspace{0.50in} m: 0.50\:(0.10)\:0.80' class='latex' /></p>
<p><br clear="all"></p>
<h3 class="blog">What if the cluster has heterogeneous compute nodes?</h3>
<p>Computing <img src='http://s.wordpress.com/latex.php?latex=%5Cmathrm%7BGFLOPS%7D_%5Cmathrm%7BTheory%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\mathrm{GFLOPS}_\mathrm{Theory}' title='\mathrm{GFLOPS}_\mathrm{Theory}' class='latex' /> isn&#8217;t easy in this case; becomes even more so when these compute nodes belong to different generations as one has to account for <em>aging factor</em>. It has been a practice at Michigan Tech, in such cases, to split the cluster into different queues &#8211; one for each generation/type of compute nodes &#8211; and run the HPL benchmark separately.</p>
<p><br clear="all"></p>
<h3 class="blog">Thanks be to</h3>
<p><a href="http://marc.info/?l=npaci-rocks-discussion" target="_blank" class="underline">Rocks mailing list</a> and its participants.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2012%2F02%2F27%2Fhpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2%2F&amp;title=HPL%202.0%20Benchmark%20With%20GCC%204.1.2%20On%20Rocks%205.4.2" id="wpa2a_2"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2012/02/27/hpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ganglia – gmond Python Module For Monitoring NVIDIA GPU On Rocks 5.4.2</title>
		<link>http://sgowtham.net/blog/2012/02/17/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rocks-5-4-2/</link>
		<comments>http://sgowtham.net/blog/2012/02/17/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rocks-5-4-2/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 23:24:43 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Clusters]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Ganglia]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=3238</guid>
		<description><![CDATA[Disclaimer The instructions/steps given below worked for me (and Michigan Technological University) running NPACI Rocks 5.4.2 (with CentOS 5.5) &#8211; as has been a common practice for several years now, a full version of Operating System was installed. These instructions may very well work for you (or your institution), on Rocks-like or other linux clusters. [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>The instructions/steps given below worked for me (and <a href="http://www.mtu.edu/" target="_blank" class="underline">Michigan Technological University</a>) running <a href="http://www.rocksclusters.org/" class="underline" target="_blank">NPACI Rocks</a> 5.4.2 (with CentOS 5.5) &#8211; as has been a common practice for several years now, a full version of Operating System was installed. These instructions may very well work for you (or your institution), on Rocks-like or other linux clusters. Please note that if you decide to use these instructions on your machine, you are doing so entirely at your very own discretion and that neither this site, <em>sgowtham.net</em>, nor its author (or Michigan Technological University) is responsible for any/all damage – intellectual and/or otherwise.</p>
<p><br clear="all"></p>
<h3 class="blog">A Bit About Ganglia (gmond &amp; gmetad)</h3>
<p>Citing <a href="http://ganglia.info/" target="_blank" class="underline">Ganglia website</a>, </p>
<blockquote><p>Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRD tool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on thousands of clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.</p></blockquote>
<p>Further, citing <a href="http://en.wikipedia.org/wiki/Ganglia_%28software%29" class="underline" target="_blank">Wikipedia</a>,</p>
<blockquote><p><code>gmond</code> (Ganglia Monitoring Daemon) is a multi-threaded daemon which runs on each cluster node that needs to be monitored. Installation does not require having a common NFS file system or a database back-end, install special accounts or maintain configuration files. It has four main responsibilities: monitor changes in host state; announce relevant changes; listen to the state of all other ganglia nodes via a unicast or multicast channel; answer requests for an XML description of the cluster state.</p>
<p>Each <code>gmond</code> transmits in information in two different ways: unicasting or multicasting host state in external data representation (XDR) format using UDP messages OR sending XML over a TCP connection.</p>
<p>Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon (<code>gmetad</code>) periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either <code>gmond</code> daemons, representing specific clusters, or other <code>gmetad</code> daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for fail over. The latter capability is natural for aggregating data from clusters since each <code>gmond</code> daemon contains the entire state of its cluster.</p>
<p>The Ganglia web front-end provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web front-end to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colourful history of all collected data. The Ganglia web front-end caters to system administrators and users (for e.g., one can view the CPU utilization over the past hour, day, week, month, or year). The web front-end shows similar graphs for memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics. The web front-end depends on the existence of the <code>gmetad</code> which provides it with data from several Ganglia sources. </p>
<p>Specifically, the web front-end will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behaviour leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web front-end should run on a fairly powerful, dedicated machine if it presents a large amount of data. The Ganglia web front-end is written in the PHP scripting language, and uses graphs generated by <code>gmetad</code> to display history information.
</p></blockquote>
<p><br clear="all"></p>
<h3 class="blog">Installation &#038; Configuration</h3>
<p>Rocks 5.4.2 installation in itself takes care of almost everything pertaining to installing and configuring Ganglia, <code>gmond</code>, <code>gmetad</code> and Ganglia web interface. However, by default &#038; design, a Rocks cluster&#8217;s web interface is not publicly accessible. To fix this, following commands were run:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># update_web_firewall.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to run necessary 'rocks' commands to update the firewall rules on a</span>
<span style="color: #666666; font-style: italic;"># Rocks 5.4.2 cluster's front end to make the web interface accessible from anywhere</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #0: display current firewall rules&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks report host firewall localhost
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #1: removing the current rule for www&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks remove host firewall localhost <span style="color: #007800;">chain</span>=INPUT \
    <span style="color: #007800;">flags</span>=<span style="color: #ff0000;">&quot;-m state --state NEW --source &amp;Kickstart_PublicNetwork;/&amp;Kickstart_PublicNetmask;&quot;</span> \
    <span style="color: #007800;">protocol</span>=tcp <span style="color: #007800;">service</span>=www <span style="color: #007800;">action</span>=ACCEPT <span style="color: #007800;">network</span>=public
&nbsp;
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks <span style="color: #c20cb9; font-weight: bold;">sync</span> host firewall localhost
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #2: removing the current rule for https&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks remove host firewall localhost <span style="color: #007800;">chain</span>=INPUT \
    <span style="color: #007800;">flags</span>=<span style="color: #ff0000;">&quot;-m state --state NEW --source &amp;Kickstart_PublicNetwork;/&amp;Kickstart_PublicNetmask;&quot;</span> \
    <span style="color: #007800;">protocol</span>=tcp <span style="color: #007800;">service</span>=https <span style="color: #007800;">action</span>=ACCEPT <span style="color: #007800;">network</span>=public
&nbsp;
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks <span style="color: #c20cb9; font-weight: bold;">sync</span> host firewall localhost
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #3: adding new rule for www&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks add host firewall localhost <span style="color: #007800;">chain</span>=INPUT \
    <span style="color: #007800;">flags</span>=<span style="color: #ff0000;">&quot;-m state --state NEW --source 0.0.0.0/0.0.0.0&quot;</span> \
    <span style="color: #007800;">protocol</span>=tcp <span style="color: #007800;">service</span>=www <span style="color: #007800;">action</span>=ACCEPT <span style="color: #007800;">network</span>=public
&nbsp;
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks <span style="color: #c20cb9; font-weight: bold;">sync</span> host firewall localhost
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #4: adding new rule for https&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks add host firewall localhost <span style="color: #007800;">chain</span>=INPUT \
    <span style="color: #007800;">flags</span>=<span style="color: #ff0000;">&quot;-m state --state NEW --source 0.0.0.0/0.0.0.0&quot;</span> \
    <span style="color: #007800;">protocol</span>=tcp <span style="color: #007800;">service</span>=https <span style="color: #007800;">action</span>=ACCEPT <span style="color: #007800;">network</span>=public
&nbsp;
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks <span style="color: #c20cb9; font-weight: bold;">sync</span> host firewall localhost
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Step #5: display current firewall rules&quot;</span>
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rocks report host firewall localhost
  <span style="color: #7a0874; font-weight: bold;">echo</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"><br />
Upon pointing the browser to the <code>http://FQDN/ganglia/</code>, the web page should display the relevant information.</p>
<p><br clear="all"></p>
<h3 class="blog">Monitoring NVIDIA GPU</h3>
<p>The aforementioned set up works fine and as expected but it doesn&#8217;t necessarily provide any information about GPU(s) that may be part of the hardware. For e.g., the cluster used in this case has two <code>NVIDIA GeForce GTX 260</code> cards in each compute node. For testing purposes, only one compute node was installed &#8211; also, one of the <code>GTX 260</code> cards was replaced with a <code>NVIDIA Quadro 6000</code>. With more and more scientific &amp; engineering computations tending towards GPU based computing, it&#8217;d be useful to include their status/usage information in Ganglia&#8217;s web portal. To this effect, NVIDIA released <a href="http://developer.nvidia.com/ganglia-monitoring-system" target="_blank"><code>gmond</code> Python module for GPUs</a> (made aware of it by one of Michigan Tech ITSS directors). The instructions given in the NVIDIA-linked pages do work as described &#8211; however, Rocks 5.4.2 uses <code>python 2.4</code> while one requires <code>python 2.5</code> (or higher) to get the GPU metrics to show up in Ganglia. </p>
<p><br clear="all"></p>
<h4>Rebuilding Rocks Distribution with Python ctypes Library</h4>
<p>I downloaded <code>python-ctypes-1.0.2-2.el5.x86_64.rpm</code> from <a href="http://ftp.osuosl.org/pub/fedora-epel/5/x86_64/" target="_blank" class="underline">http://ftp.osuosl.org/pub/fedora-epel/5/x86_64/</a> and placed it in<br />
<code>/export/rocks/install/contrib/5.4/x86_64/RPMS/</code> &#8211; rebuilding of the distribution, with following commands as usual, was uneventful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># update_rocks_distribution.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to download python-ctypes-1.0.2-2.el5.x86_64.rpm from </span>
<span style="color: #666666; font-style: italic;"># http://ftp.osuosl.org/pub/fedora-epel/5/x86_64/ and rebuild the</span>
<span style="color: #666666; font-style: italic;"># rocks distribution</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>export<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>install<span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.4</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>ftp.osuosl.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>fedora-epel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>python-ctypes-1.0.2-<span style="color: #000000;">2</span>.el5.x86_64.rpm
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>export<span style="color: #000000; font-weight: bold;">/</span>rocks<span style="color: #000000; font-weight: bold;">/</span>install<span style="color: #000000; font-weight: bold;">/</span>
  rocks create distro
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"><br />
Re-install the compute node(s) [in this case, <code>compute-0-0</code>]. Without and with <code>ctypes</code> library, <code>gmond</code> (when run in debug mode, i.e. <code>gmond -d9 -f</code>), results in the following message.</p>
<p><br clear="all"></p>
<p>
<a href="http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_41.png" title="" class="shutterset_singlepic39"  rel="lightbox[3238]">
	<img class="ngg-singlepic ngg-left" src="http://sgowtham.net/blog/wp-content/gallery/cache/39__320x240_ganglia_gpu_41.png" alt="ganglia_gpu_41" title="ganglia_gpu_41" />
</a>

<a href="http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_42.png" title="" class="shutterset_singlepic40"  rel="lightbox[3238]">
	<img class="ngg-singlepic ngg-left" src="http://sgowtham.net/blog/wp-content/gallery/cache/40__320x240_ganglia_gpu_42.png" alt="ganglia_gpu_42" title="ganglia_gpu_42" />
</a>
</p>
<p><br clear="all"><br />
<br clear="all"></p>
<h4>NVIDIA Driver Installation</h4>
<p>Once the compute node(s) are re-installed, NVIDIA driver, <code>NVIDIA-Linux-x86_64-285.05.33.run</code>, was installed using the following script.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_nvidia_driver.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install NVIDIA driver in compute node(s) - save this in /share/apps/bin/</span>
<span style="color: #666666; font-style: italic;"># Assumes that NVIDIA-Linux-x86_64-285.05.33.run is located in /share/apps/src/nvidia_cuda/</span>
<span style="color: #666666; font-style: italic;"># Also, assumes that CUDA SDK 4.1.28 has been installed on front end in /share/apps/cuda/</span>
<span style="color: #666666; font-style: italic;"># Must be root to run this script and run this in all compute nodes from the front end via</span>
<span style="color: #666666; font-style: italic;"># the command</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># rocks run host '/share/apps/bin/install_nvidia_driver.sh'</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #666666; font-style: italic;"># 1. Install NVIDIA driver</span>
  <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>nvidia_cuda<span style="color: #000000; font-weight: bold;">/</span>NVIDIA-Linux-x86_64-285.05.33.run <span style="color: #660033;">--silent</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># 2: Updating /etc/ld.so.config</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/share/apps/cuda/lib64&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;/share/apps/cuda/lib&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf
  <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>ldconfig
&nbsp;
  <span style="color: #666666; font-style: italic;"># 3: Creating missing symbolic links to necessary libraries</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> libXmu.so.6.2.0 libXmu.so
  <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> libXi.so.6.0.0  libXi.so
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h4>Python Bindings for the NVIDIA Management Library</h4>
<p>This provides Python access to static information and monitoring data for NVIDIA GPUs, as well as management capabilities. It exposes the functionality of the <a href="http://developer.nvidia.com/nvidia-management-library-nvml" target="_blank" class="underline">NVML</a> and one may download these from <a href="http://pypi.python.org/pypi/nvidia-ml-py/" target="_blank" class="underline">here</a> &#8211; as before, the necessary steps are included in a BASH script.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_python_nvml_bindings.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install Python Bindings for the NVML in compute node(s) - save this in /share/apps/bin/</span>
<span style="color: #666666; font-style: italic;"># Assumes that nvidia-ml-py-2.285.01.tar.gz is in /share/apps/src/nvidia_ganglia/</span>
<span style="color: #666666; font-style: italic;"># Must be root to run this script and run this in all compute nodes from the front end via the command</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># rocks run host '/share/apps/bin/install_python_nvml_bindings.sh'</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Download and install</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>nvidia_ganglia<span style="color: #000000; font-weight: bold;">/</span>nvidia-ml-py-2.285.01.tar.gz .
&nbsp;
  <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvpf</span> nvidia-ml-py-2.285.01.tar.gz
  <span style="color: #7a0874; font-weight: bold;">cd</span> nvidia-ml-py-2.285.01
  python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Copy nvidia_smi.py &amp; pynvml.py to /opt/ganglia/lib64/ganglia/python_modules/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> nvidia_smi.py <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> pynvml.py <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h4><code>gmond</code> Python Module For Monitoring NVIDIA GPUs using NVML</h4>
<p>After downloading <code>ganglia-gmond_python_modules-3dfa553.tar.gz</code> from <a href="https://github.com/ganglia/gmond_python_modules/tree/master/gpu/nvidia" target="_blank" class="underline">GitHub for ganglia / gmond_python_modules</a> to<br />
<code>/share/apps/src/nvidia_ganglia/</code>, the following steps need to be performed:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># copy_ganglia_gmond_python_computenodes.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to copy relevant files from ganglia-gmond_python_modules to Ganglia, </span>
<span style="color: #666666; font-style: italic;"># and restart gmond - save this in /share/apps/bin/</span>
<span style="color: #666666; font-style: italic;"># Assumes that ganglia-gmond_python_modules-3dfa553.tar.gz is in /share/apps/src/nvidia_ganglia/</span>
<span style="color: #666666; font-style: italic;"># Must be root to run this script and run this in all compute nodes from the front end via the command</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># rocks run host '/share/apps/bin/copy_ganglia_gmond_python_computenodes.sh'</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Copy relevant files to Ganglia</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvpf</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>nvidia_ganglia<span style="color: #000000; font-weight: bold;">/</span>ganglia-gmond_python_modules-3dfa553.tar.gz
  <span style="color: #7a0874; font-weight: bold;">cd</span> ganglia-gmond_python_modules-3dfa553<span style="color: #000000; font-weight: bold;">/</span>gpu<span style="color: #000000; font-weight: bold;">/</span>nvidia<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> python_modules<span style="color: #000000; font-weight: bold;">/</span>nvidia.py <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> conf.d<span style="color: #000000; font-weight: bold;">/</span>nvidia.pyconf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Restart gmond</span>
  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmond restart
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># copy_ganglia_gmond_python_frontend.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to copy relevant files from ganglia-gmond_python_modules to Ganglia, </span>
<span style="color: #666666; font-style: italic;"># apply patch for Ganglia web interface and restart necessary services </span>
<span style="color: #666666; font-style: italic;"># Assumes that ganglia-gmond_python_modules-3dfa553.tar.gz is in /share/apps/src/nvidia_ganglia/</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script and run this only on front end</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Apply web patch for Ganglia to display custom graphs</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvpf</span> <span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>nvidia_ganglia<span style="color: #000000; font-weight: bold;">/</span>ganglia-gmond_python_modules-3dfa553.tar.gz
  <span style="color: #7a0874; font-weight: bold;">cd</span> ganglia-gmond_python_modules-3dfa553<span style="color: #000000; font-weight: bold;">/</span>gpu<span style="color: #000000; font-weight: bold;">/</span>nvidia<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> graph.d<span style="color: #000000; font-weight: bold;">/*</span>.php <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>graph.d<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p0</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ganglia-gmond_python_modules-3dfa553<span style="color: #000000; font-weight: bold;">/</span>gpu<span style="color: #000000; font-weight: bold;">/</span>nvidia<span style="color: #000000; font-weight: bold;">/</span>ganglia_web.patch
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Restart necessary services</span>
  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmetad restart
  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmond restart
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"><br />
Upon pointing the browser to the <code>http://FQDN/ganglia/</code> (e.g., <a href="http://paracuda.math.mtu.edu/ganglia/" target="_blank"><code>http://paracuda.math.mtu.edu/ganglia/</code></a> &#8211; the link will probably die or be changed to something else in due course), the display should include information about GPU as well, as shown in screenshots below:</p>
<p><br clear="all"></p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_51.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_51.png' alt='ganglia_gpu_51' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_52.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_52.png' alt='ganglia_gpu_52' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_53.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_53.png' alt='ganglia_gpu_53' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_54.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_54.png' alt='ganglia_gpu_54' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_55.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_55.png' alt='ganglia_gpu_55' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_56.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_56.png' alt='ganglia_gpu_56' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_57.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_57.png' alt='ganglia_gpu_57' class='ngg-singlepic ngg-left' /></a> </p>
<p><br clear="all"><br />
<br clear="all"><br />
With little more work, the rather unaesthetic looking Ganglia web interface can be made to look like a given institution&#8217;s theme:</p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_58.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_58.png' alt='ganglia_gpu_58' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_59.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_59.png' alt='ganglia_gpu_59' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_60.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_60.png' alt='ganglia_gpu_60' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_61.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_61.png' alt='ganglia_gpu_61' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_62.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_62.png' alt='ganglia_gpu_62' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_63.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_63.png' alt='ganglia_gpu_63' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_64.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_64.png' alt='ganglia_gpu_64' class='ngg-singlepic ngg-left' /></a> </p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_65.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_65.png' alt='ganglia_gpu_65' class='ngg-singlepic ngg-left' /></a>  <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_66.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_66.png' alt='ganglia_gpu_66' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_67.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_67.png' alt='ganglia_gpu_67' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_68.png' title='' rel="lightbox[3238]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_68.png' alt='ganglia_gpu_68' class='ngg-singlepic ngg-left' /></a> </p>
<p><br clear="all"><br />
<br clear="all"></p>
<h3 class="blog">Thanks be to</h3>
<p><a href="http://www.math.mtu.edu/~struther/" target="_blank" class="underline">Dr. Allan Struthers</a> for letting his <code>paracuda.math</code> be used for this purpose; my friendly neighbors for their kindness in letting me borrow a NVIDIA Quadro 6000 card; Robert Alexander of NVIDIA (<a href="http://developer.nvidia.com/ganglia-monitoring-system/" target="_blank" class="underline">http://developer.nvidia.com/ganglia-monitoring-system/</a>), <a href="http://www.lbl.gov/" target="_blank" class="underline">Bernard Li of Lawrence Berkeley National Laboratory</a> and <a href="http://www.ncsa.illinois.edu/" target="_blank" class="underline">Jeremy Enos of National Center for Supercomputing Applications</a> for developing this <code>gmond Python module</code> as well as making time to answer my questions.</p>
<p><br clear="all"><br />
</p>
<h3 class="blog">Near Future Work</h3>
<p>Work is currently underway to include all of the compute node related steps in the above described procedure in the local Rocks distribution, so that the compute nodes get them as soon as they are installed.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2012%2F02%2F17%2Fganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rocks-5-4-2%2F&amp;title=Ganglia%20%E2%80%93%20gmond%20Python%20Module%20For%20Monitoring%20NVIDIA%20GPU%20On%20Rocks%205.4.2" id="wpa2a_4"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2012/02/17/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rocks-5-4-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CUDA/C &#8211; Hello, World!</title>
		<link>http://sgowtham.net/blog/2012/02/13/cuda-c-hello-world/</link>
		<comments>http://sgowtham.net/blog/2012/02/13/cuda-c-hello-world/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 20:10:01 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=3223</guid>
		<description><![CDATA[Disclaimer The instructions/steps/programs given below worked for me (and Michigan Technological University) running site licensed Red Hat Enterprise Linux 6.2, with NVIDIA CUDA SDK 4.1.28, NVIDIA GPU Driver v290.10 &#038; two NVIDIA GeForce GTX 570 cards &#8211; as has been a common practice for several years now, a full version of Operating System was installed [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>The instructions/steps/programs given below worked for me (and <a href="http://www.mtu.edu/" target="_blank" class="underline">Michigan Technological University</a>) running site licensed Red Hat Enterprise Linux 6.2, with NVIDIA CUDA SDK 4.1.28, NVIDIA GPU Driver v290.10 &#038; two NVIDIA GeForce GTX 570 cards &#8211; as has been a common practice for several years now, a full version of Operating System was installed and all necessary patches/upgrades have been applied. These instructions may very well work for you (or your institution), on Red Hat-like or other linux distributions. Please note that if you decide to use these instructions on your machine, you are doing so entirely at your very own discretion and that neither this site, <em>sgowtham.net</em>, nor its author (or Michigan Technological University) is responsible for any/all damage – intellectual and/or otherwise.</p>
<p><br clear="all"></p>
<h3 class="blog">The Program</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* hello_world_cuda.cu
   A CUDA C PROGRAM TO PRINT 'HELLO, WORLD!' TO THE SCREEN
&nbsp;
   TESTED SUCCESSFULLY WITH CUDA SDK 4.1.28 AND NVIDIA GPU DRIVER 
   VERSION 290.10 RUNNING ON NVIDIA GeForce GTX 270
&nbsp;
   COMPILATION:
   #1: NON-MAKEFILE APPROACH
       nvcc -g hello_world_cuda.cu -o hello_world_cuda.x
&nbsp;
   #2. MAKEFILE APPROACH (USE THE ASSOCIATED Makefile)
       make
&nbsp;
   EXECUTION:
   ./hello_world_cuda.x
&nbsp;
   PORTIONS OF THE COMMENTS ARE ADOPTED FROM
&nbsp;
     NVIDIA CUDA C
     PROGRAMMING GUIDE
     VERSION 4.0 (5/6/2011)
&nbsp;
   FIRST WRITTEN: GOWTHAM; Mon, 13 Feb 2012 14:06:30 -0500
   LAST MODIFIED: GOWTHAM; Mon, 13 Feb 2012 14:15:30 -0500
*/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* STANDARD HEADERS AND DEFINITIONS 
   REFERENCE: http://en.wikipedia.org/wiki/C_standard_library
*/</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;  /* Core input/output operations                         */</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt; /* Conversions, random numbers, memory allocation, etc. */</span>
<span style="color: #339933;">#include &lt;math.h&gt;   /* Common mathematical functions                        */</span>
<span style="color: #339933;">#include &lt;time.h&gt;   /* Converting between various date/time formats         */</span>
<span style="color: #339933;">#include &lt;cuda.h&gt;   /* CUDA related stuff                                   */</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* KERNEL DEFINITION
   CUDA C EXTENDS C BY ALLOWING THE PROGRAMMER TO DEFINE C FUNCTIONS,
   CALLED KERNELS, THAT, WHEN CALLED, ARE EXECUTED N TIMES IN PARALLEL
   BY N DIFFERENT CUDA THREADS, AS OPPOSED TO ONLY ONCE LIKE REGULAR
   C FUNCTIONS
&nbsp;
   A KERNEL IS DEFINED USING THE __global__ DECLARATION SPECIFIER.
   THE NUMBER OF CUDA THREADS THAT EXECUTE THAT KERNEL FOR A GIVEN
   KERNEL CALL IS SPECIFIED USING &lt;&lt;&lt; &gt;&gt;&gt; (EXECUTION CONFIGURATION)
   SYNTAX. EXECUTION CONFIGURATION DEFINES THE DIMENSION OF THE
   GRIDS AND BLOCKS THAT WILL BE USED TO EXECUTE THE FUNCTION ON THE 
   DEVICE AS WELL AS THE ASSOCIATED STREAM
&nbsp;
   EACH THREAD THAT EXECUTES THE KERNEL IS GIVEN A UNIQUE 'THREAD ID'
   THAT IS ACCESSIBLE WITHIN THE KERNEL THROUGH THE BUILT-IN
   threadIdx VARIABLE
&nbsp;
   A FUNCTION DECLARED AS
&nbsp;
     __global__ void Function(float* parameter);
&nbsp;
   MUST BE CALLED AS FOLLOWS:
&nbsp;
     Function&lt;&lt;&lt; Dg, Db, Ns &gt;&gt;&gt;(parameter);
&nbsp;
   WHERE
&nbsp;
   -- Dg : OF TYPE dim3, IT SPECIFIES THE DIMENSION AND SIZE OF THE GRID
           SUCH THAT Dg.x * Dg.y * Dg.z EQUALS THE NUMBER OF BLOCKS BEING
           LAUNCHED
&nbsp;
   -- Db : OF TYPE dim3, IT SPECIFIES THE DIMENSION AND SIZE OF EACH BLOCK
           SUCH THAT Db.x * Db.y * Db.z EQUALS THE NUMBER OF THREADS PER
           BLOCK
&nbsp;
   -- Ns : OF TYPE size_t, IT SPECIFIES THE NUMBER OF BYTES IN SHARED MEMORY
           THAT IS DYNAMICALLY ALLOCATED PER BLOCK FOR THIS CALL IN ADDITION
           TO THE STATICALLY ALLOCATED MEMORY. THIS DYNAMICALLY ALLOCATED
           MEMORY IS USED BY ANY OF THE VARIABLES DECLARED AS AN EXTERNAL
           ARRAY. NOTE THAT THIS IS AN OPTIONAL ARGUMENT THAT DEFAULTS TO 0
&nbsp;
   -- S  : OF TYPE cudaStream_t, IT SPECIFIES THE ASSOCIATED STREAM. THIS
           TOO IS AN OPTIONAL ARGUMENT THAT DEFAULTS TO 0
*/</span>
__global__ <span style="color: #993333;">void</span> kernel<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* MAIN PROGRAM BEGINS */</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Dg = 1; Db = 1; Ns = 0; S = 0 */</span>
  kernel<span style="color: #339933;">&lt;&lt;&lt;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #339933;">&gt;&gt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* PRINT 'HELLO, WORLD!' TO THE SCREEN */</span>
  <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>  Hello, World!<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* INDICATE THE TERMINATION OF THE PROGRAM */</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* MAIN PROGRAM ENDS */</span></pre></td></tr></table></div>

<p><br clear="all"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
</pre></td><td class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># Simple version of the Makefile used to systematically compile</span>
<span style="color: #339900; font-style: italic;"># one of many CUDA C programs, taking into account respective dependencies</span>
<span style="color: #339900; font-style: italic;"># </span>
<span style="color: #339900; font-style: italic;"># First written: Gowtham; Mon, 13 Feb 2012 14:32:36 -0500</span>
<span style="color: #339900; font-style: italic;"># Last modified: Gowtham; Mon, 13 Feb 2012 15:00:42 -0500</span>
<span style="color: #339900; font-style: italic;"># </span>
&nbsp;
<span style="color: #339900; font-style: italic;"># Necessary variables</span>
CC        <span style="color: #004400;">=</span> nvcc
CFLAGS    <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>g <span style="color: #004400;">-</span>c
OFLAGS    <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>O3
MYPROGRAM <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CPROGRAM</span><span style="color: #004400;">&#41;</span>
&nbsp;
<span style="color: #339900; font-style: italic;"># If CPROGRAM is not defined (and hence MYPROGRAM is empty), </span>
<span style="color: #339900; font-style: italic;"># display help message</span>
<span style="color: #666622; font-weight: bold;">ifndef</span> CPROGRAM
help<span style="color: #004400;">:</span>
<span style="color: #666622; font-weight: bold;">endif</span>
&nbsp;
<span style="color: #339900; font-style: italic;"># Default target</span>
all<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>x
&nbsp;
<span style="color: #339900; font-style: italic;"># Print help message</span>
help<span style="color: #004400;">:</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;  To compile, choose one of the following:&quot;</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;    make CPROGRAM=hello_world_cuda&quot;</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;  To clean, choose one of the following:&quot;</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;    make clean-all-programs&quot;</span>
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;    make clean CPROGRAM=hello_world_cuda&quot;</span>
	<span style="color: #004400;">@</span>echo
&nbsp;
&nbsp;
<span style="color: #339900; font-style: italic;"># $(MYPROGRAM).x (depends on $(MYPROGRAM).o)</span>
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>x<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>o
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CC</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>o <span style="color: #004400;">-</span>o <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>x
&nbsp;
&nbsp;
<span style="color: #339900; font-style: italic;"># $(MYPROGRAM).o (depends on $(MYPROGRAM).cu)</span>
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>o<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>cu
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CC</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">OFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>cu
&nbsp;
&nbsp;
<span style="color: #339900; font-style: italic;"># Remove the appropriate object file and executable</span>
clean<span style="color: #004400;">:</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;Deleting $(MYPROGRAM).o and $(MYPROGRAM).x&quot;</span>
	rm <span style="color: #004400;">-</span>f <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>o <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MYPROGRAM</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>x
	<span style="color: #004400;">@</span>echo
&nbsp;
<span style="color: #339900; font-style: italic;"># Remove all object files and executables</span>
clean<span style="color: #004400;">-</span>all<span style="color: #004400;">-</span>programs<span style="color: #004400;">:</span>
	<span style="color: #004400;">@</span>echo
	<span style="color: #004400;">@</span>echo <span style="color: #CC2200;">&quot;Deleting *.o and *.x files&quot;</span>
	rm <span style="color: #004400;">-</span>f <span style="color: #004400;">*.</span>o <span style="color: #004400;">*.</span>x
	<span style="color: #004400;">@</span>echo</pre></td></tr></table></div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2012%2F02%2F13%2Fcuda-c-hello-world%2F&amp;title=CUDA%2FC%20%26%238211%3B%20Hello%2C%20World%21" id="wpa2a_6"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2012/02/13/cuda-c-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ganglia &#8211; gmond Python Module For Monitoring NVIDIA GPU On RHEL 6.2</title>
		<link>http://sgowtham.net/blog/2012/02/11/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rhel-6-2/</link>
		<comments>http://sgowtham.net/blog/2012/02/11/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rhel-6-2/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 22:27:29 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Ganglia]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=3154</guid>
		<description><![CDATA[Disclaimer The instructions/steps given below worked for me (and Michigan Technological University) running site licensed Red Hat Enterprise Linux 6.2 &#8211; as has been a common practice for several years now, a full version of Operating System was installed and all necessary patches/upgrades have been applied. These instructions may very well work for you (or [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>The instructions/steps given below worked for me (and <a href="http://www.mtu.edu/" target="_blank" class="underline">Michigan Technological University</a>) running site licensed Red Hat Enterprise Linux 6.2 &#8211; as has been a common practice for several years now, a full version of Operating System was installed and all necessary patches/upgrades have been applied. These instructions may very well work for you (or your institution), on Red Hat-like or other linux distributions. Please note that if you decide to use these instructions on your machine, you are doing so entirely at your very own discretion and that neither this site, <em>sgowtham.net</em>, nor its author (or Michigan Technological University) is responsible for any/all damage – intellectual and/or otherwise.</p>
<p><br clear="all"></p>
<h3 class="blog">A Bit About Ganglia (gmond &amp; gmetad)</h3>
<p>Citing <a href="http://ganglia.info/" target="_blank" class="underline">Ganglia website</a>, </p>
<blockquote><p>Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRD tool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on thousands of clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.</p></blockquote>
<p>Further, citing <a href="http://en.wikipedia.org/wiki/Ganglia_%28software%29" class="underline" target="_blank">Wikipedia</a>,</p>
<blockquote><p><code>gmond</code> (Ganglia Monitoring Daemon) is a multi-threaded daemon which runs on each cluster node that needs to be monitored. Installation does not require having a common NFS file system or a database back-end, install special accounts or maintain configuration files. It has four main responsibilities: monitor changes in host state; announce relevant changes; listen to the state of all other ganglia nodes via a unicast or multicast channel; answer requests for an XML description of the cluster state.</p>
<p>Each <code>gmond</code> transmits in information in two different ways: unicasting or multicasting host state in external data representation (XDR) format using UDP messages OR sending XML over a TCP connection.</p>
<p>Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon (<code>gmetad</code>) periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either <code>gmond</code> daemons, representing specific clusters, or other <code>gmetad</code> daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for fail over. The latter capability is natural for aggregating data from clusters since each <code>gmond</code> daemon contains the entire state of its cluster.</p>
<p>The Ganglia web front-end provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web front-end to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colourful history of all collected data. The Ganglia web front-end caters to system administrators and users (for e.g., one can view the CPU utilization over the past hour, day, week, month, or year). The web front-end shows similar graphs for memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics. The web front-end depends on the existence of the <code>gmetad</code> which provides it with data from several Ganglia sources. </p>
<p>Specifically, the web front-end will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behaviour leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web front-end should run on a fairly powerful, dedicated machine if it presents a large amount of data. The Ganglia web front-end is written in the PHP scripting language, and uses graphs generated by <code>gmetad</code> to display history information.
</p></blockquote>
<p><br clear="all"></p>
<h3 class="blog">Installation</h3>
<p>In order to make sure that none of the required steps are missed when performing similar installation on other machines (or repeating on the same machine), a BASH script was written.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_ganglia.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install Ganglia on RHEL 6.2</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Enable EPEL repository</span>
  <span style="color: #666666; font-style: italic;"># EPEL: Extra Packages for Enterprise Linux</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.fedoraproject.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>epel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>epel-release-<span style="color: #000000;">6</span>-<span style="color: #000000;">5</span>.noarch.rpm
  rpm <span style="color: #660033;">-ivh</span> epel-release-<span style="color: #000000;">6</span>-<span style="color: #000000;">5</span>.noarch.rpm
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Install Ganglia</span>
  yum <span style="color: #c20cb9; font-weight: bold;">install</span> ganglia ganglia-gmetad ganglia-gmond ganglia-web ganglia-gmond-python
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Make sure httpd, gmond and gmetad automatically start after each reboot</span>
  chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">345</span> httpd on
  chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">345</span> gmond on
  chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">345</span> gmetad on
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span> 
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">Configuration</h3>
<p>Assuming all went well so far, one can expect to have the following files: <code>/etc/ganglia/gmetad.conf</code>, <code>/etc/ganglia/gmond.conf</code> and<br />
<code>/etc/httpd/conf.d/ganglia.conf</code></p>
<p><br clear="all"><br />
Edit <code>/etc/ganglia/gmetad.conf</code> to have the following line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">data_source <span style="color: #ff0000;">&quot;dirac.dcs&quot;</span> localhost:<span style="color: #000000;">8649</span></pre></td></tr></table></div>

<p><br clear="all"><br />
<code>/etc/ganglia/gmond.conf</code> will have the following edits:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
 * The cluster attributes specified will be used as part of the &lt;CLUSTER&gt;
 * tag that will wrap all hosts collected by this instance.
 */</span>
cluster <span style="color: #009900;">&#123;</span>
  name <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;dirac.dcs&quot;</span>
  owner <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Michigan Technological University&quot;</span>
  latlong <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;N47.11 W88.57&quot;</span>
  url <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://www.it.mtu.edu/&quot;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* Feel free to specify as many udp_send_channels as you like.
 * Gmond used to only support having a single channel 
*/</span>
udp_send_channel <span style="color: #009900;">&#123;</span>
  bind_hostname <span style="color: #339933;">=</span> yes  <span style="color: #339933;"># Highly recommended, soon to be default.</span>
                       <span style="color: #339933;"># This option tells gmond to use a source address</span>
                       <span style="color: #339933;"># that resolves to the machine's hostname.  Without</span>
                       <span style="color: #339933;"># this, the metrics may appear to come from any</span>
                       <span style="color: #339933;"># interface and the DNS names associated with</span>
                       <span style="color: #339933;"># those IPs will be used to create the RRDs.</span>
  mcast_join <span style="color: #339933;">=</span> 239.2.11.71
  host <span style="color: #339933;">=</span> dirac.<span style="color: #202020;">dcs</span>.<span style="color: #202020;">it</span>.<span style="color: #202020;">mtu</span>.<span style="color: #202020;">edu</span>
  port <span style="color: #339933;">=</span> <span style="color: #0000dd;">8649</span>
  ttl <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* You can specify as many udp_recv_channels as you like as well. */</span>
udp_recv_channel <span style="color: #009900;">&#123;</span>
  mcast_join <span style="color: #339933;">=</span> 239.2.11.71
  port <span style="color: #339933;">=</span> <span style="color: #0000dd;">8649</span>
  bind <span style="color: #339933;">=</span> 239.2.11.71
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* You can specify as many tcp_accept_channels as you like to share
 * an xml description of the state of the cluster 
*/</span>
tcp_accept_channel <span style="color: #009900;">&#123;</span>
  port <span style="color: #339933;">=</span> <span style="color: #0000dd;">8649</span>
  acl <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">default</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;deny&quot;</span>
&nbsp;
    access <span style="color: #009900;">&#123;</span>
      ip <span style="color: #339933;">=</span> 127.0.0.1
      mask <span style="color: #339933;">=</span> <span style="color: #0000dd;">32</span>
      action <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;allow&quot;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><br clear="all"><br />
<code>/etc/httpd/conf.d/ganglia.conf</code> will have the following edits:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Ganglia monitoring system php web frontend</span>
  <span style="color: #666666; font-style: italic;">#</span>
&nbsp;
  Alias <span style="color: #000000; font-weight: bold;">/</span>ganglia <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>ganglia
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;</span>Location <span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">&gt;</span>
    Order deny,allow
    <span style="color: #666666; font-style: italic;"># Deny from all</span>
    <span style="color: #666666; font-style: italic;"># Allow from 127.0.0.1</span>
    <span style="color: #666666; font-style: italic;"># Allow from ::1</span>
    <span style="color: #666666; font-style: italic;"># # Allow from .example.com</span>
    Allow from all
  <span style="color: #000000; font-weight: bold;">&lt;/</span>Location<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p><br clear="all"><br />
The firewall needs to be modified so that it accepts UDP &#038; TCP requests on port 8649. To that effect, <code>/etc/sysconfig/iptables</code> will have the following lines:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Ganglia gmond/gmetad</span>
<span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> udp <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">8649</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> tcp <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">8649</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #666666; font-style: italic;">#</span></pre></td></tr></table></div>

<p><br clear="all"><br />
(Re)Start the necessary services:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>iptables restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmetad restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmond restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>httpd restart</pre></td></tr></table></div>

<p><br clear="all"><br />
After a few minutes of collecting the data and upon pointing the browser to the <code>http://FQDN/ganglia/</code>, the web page should display the relevant information.</p>
<p>If, instead of relevant information, the web page displays the following error message</p>
<blockquote><p>There was an error collecting ganglia data (127.0.0.1:8652): fsockopen error: Permission denied</p></blockquote>
<p>then, more often than not, it hints to a <code>selinux</code> related issue. Edit the file, <code>/etc/sysconfig/selinux</code>, to look like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="http" style="font-family:monospace;"># This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted</pre></td></tr></table></div>

<p><br clear="all"><br />
Restart the machine and point the browser to the <code>http://FQDN/ganglia/</code>, the web page should display the relevant information.</p>
<p><br clear="all"></p>
<h3 class="blog">Monitoring NVIDIA GPU</h3>
<p>The aforementioned set up works fine and as expected but it doesn&#8217;t necessarily provide any information about GPU(s) that may be part of the hardware. For e.g., the test machine used in our case has two NVIDIA GeForce GTX 570 cards. With more and more scientific &amp; engineering computations tending towards GPU based computing, it&#8217;d be useful to include their status/usage information in Ganglia&#8217;s web portal. To this effect, NVIDIA released <a href="http://developer.nvidia.com/ganglia-monitoring-system" target="_blank"><code>gmond</code> Python module for GPUs</a> (made aware of it by one of Michigan Tech ITSS directors). The instructions given in the NVIDIA-linked pages do work as described and are included here for the sake of completeness.</p>
<p><br clear="all"></p>
<h4>Python Bindings for the NVIDIA Management Library</h4>
<p>This provides Python access to static information and monitoring data for NVIDIA GPUs, as well as management capabilities. It exposes the functionality of the <a href="http://developer.nvidia.com/nvidia-management-library-nvml" target="_blank" class="underline">NVML</a> and one may download these from <a href="http://pypi.python.org/pypi/nvidia-ml-py/" target="_blank" class="underline">here</a> &#8211; as before, the necessary steps are included in a BASH script.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># install_python_nvml_bindings.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to download and install Python Bindings for the NVML</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
<span style="color: #666666; font-style: italic;"># Does not work with Python 2.4 - needs higher/more recent version</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Download and install</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pypi.python.org<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>source<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #000000; font-weight: bold;">/</span>nvidia-ml-py<span style="color: #000000; font-weight: bold;">/</span>nvidia-ml-py-2.285.01.tar.gz
&nbsp;
  <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvpf</span> nvidia-ml-py-2.285.01.tar.gz
  <span style="color: #7a0874; font-weight: bold;">cd</span> nvidia-ml-py-2.285.01
  python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h4><code>gmond</code> Python Module For Monitoring NVIDIA GPUs using NVML</h4>
<p>After downloading <code>ganglia-gmond_python_modules-3dfa553.tar.gz</code> from <a href="https://github.com/ganglia/gmond_python_modules/tree/master/gpu/nvidia" target="_blank" class="underline">GitHub for ganglia / gmond_python_modules</a> to <code>/tmp/</code>, the following steps need to be performed:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># copy_ganglia_gmond_python.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to copy Copy nvidia_smi.py &amp; pynvml.py to </span>
<span style="color: #666666; font-style: italic;"># /usr/lib64/ganglia/python_modules/, relevant files from </span>
<span style="color: #666666; font-style: italic;"># ganglia-gmond_python_modules to Ganglia, apply patch</span>
<span style="color: #666666; font-style: italic;"># for Ganglia web interface and restart necessary services</span>
<span style="color: #666666; font-style: italic;"># Must be root (or at least have sudo privilege) to run this script</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin root-check IF</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$UID</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;
<span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">clear</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  You must be logged in as root!&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  Exiting...&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Copy nvidia_smi.py &amp; pynvml.py to /usr/lib64/ganglia/python_modules/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>nvidia-ml-py-2.285.01<span style="color: #000000; font-weight: bold;">/</span>nvidia_smi.py <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>nvidia-ml-py-2.285.01<span style="color: #000000; font-weight: bold;">/</span>pynvml.py <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Copy relevant files to Ganglia</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvpf</span> ganglia-gmond_python_modules-3dfa553.tar.gz
  <span style="color: #7a0874; font-weight: bold;">cd</span> ganglia-gmond_python_modules-3dfa553
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">cd</span> gpu<span style="color: #000000; font-weight: bold;">/</span>nvidia<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> python_modules<span style="color: #000000; font-weight: bold;">/</span>nvidia.py <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>python_modules<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> conf.d<span style="color: #000000; font-weight: bold;">/</span>nvidia.pyconf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">cp</span> graph.d<span style="color: #000000; font-weight: bold;">/*</span>.php <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>graph.d<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Apply web patch for Ganglia to display custom graphs</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>ganglia<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p0</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ganglia-gmond_python_modules-3dfa553<span style="color: #000000; font-weight: bold;">/</span>gpu<span style="color: #000000; font-weight: bold;">/</span>nvidia<span style="color: #000000; font-weight: bold;">/</span>ganglia_web.patch
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Restart necessary services</span>
  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmetad restart
  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>gmond restart
&nbsp;
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #666666; font-style: italic;"># End root-check IF</span></pre></td></tr></table></div>

<p><br clear="all"><br />
Upon pointing the browser to the <code>http://FQDN/ganglia/</code> (e.g., <a href="http://dirac.dcs.it.mtu.edu/ganglia/" target="_blank"><code>http://dirac.dcs.it.mtu.edu/ganglia/</code></a> &#8211; the link will probably die or be changed to something else in due course), the display should include information about GPU as well, as shown in screenshots below:</p>
<p><br clear="all"></p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_00.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_00.png' alt='ganglia_gpu_00' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_01.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_01.png' alt='ganglia_gpu_01' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_02.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_02.png' alt='ganglia_gpu_02' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_03.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_03.png' alt='ganglia_gpu_03' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_04.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_04.png' alt='ganglia_gpu_04' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_05.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_05.png' alt='ganglia_gpu_05' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_06.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_06.png' alt='ganglia_gpu_06' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_07.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_07.png' alt='ganglia_gpu_07' class='ngg-singlepic ngg-center' /></a></p>
<p><br clear="all"><br />
With little more work, the rather unaesthetic looking Ganglia web interface can be made to look like a given institution&#8217;s theme:</p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_08.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_08.png' alt='ganglia_gpu_08' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_09.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_09.png' alt='ganglia_gpu_09' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_10.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_10.png' alt='ganglia_gpu_10' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_11.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_11.png' alt='ganglia_gpu_11' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_12.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_12.png' alt='ganglia_gpu_12' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_13.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_13.png' alt='ganglia_gpu_13' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_14.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_14.png' alt='ganglia_gpu_14' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_15.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_15.png' alt='ganglia_gpu_15' class='ngg-singlepic ngg-center' /></a> </p>
<p><a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_16.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_16.png' alt='ganglia_gpu_16' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_17.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_17.png' alt='ganglia_gpu_17' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_18.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_18.png' alt='ganglia_gpu_18' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_19.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_19.png' alt='ganglia_gpu_19' class='ngg-singlepic ngg-left' /></a> <a class="shutterset_" href='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/ganglia_gpu_20.png' title='' rel="lightbox[3154]"><img src='http://sgowtham.net/blog/wp-content/gallery/ganglia_gpu/thumbs/thumbs_ganglia_gpu_20.png' alt='ganglia_gpu_20' class='ngg-singlepic ngg-left' /></a></p>
<p><br clear="all"><br />
</p>
<h3 class="blog">Near Future Work</h3>
<p>Work is currently underway, most certainly with help from <a href="http://marc.info/?l=npaci-rocks-discussion" target="_blank" class="underline">the ever-awesome Rocks mailing list</a>, to integrate the above into a NPACI Rocks 5.4.2 cluster with compute nodes having one or more GPUs. Another post will come along as and when this work has been completed and tested.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2012%2F02%2F11%2Fganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rhel-6-2%2F&amp;title=Ganglia%20%26%238211%3B%20gmond%20Python%20Module%20For%20Monitoring%20NVIDIA%20GPU%20On%20RHEL%206.2" id="wpa2a_8"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2012/02/11/ganglia-gmond-python-module-for-monitoring-nvidia-gpu-on-rhel-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAC &#8211; Quick Fix For WPA2 Password Prompt Issue @ Michigan Tech</title>
		<link>http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/</link>
		<comments>http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 12:43:12 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MichiganTech]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=2823</guid>
		<description><![CDATA[Every once in a while, my Apple MacBook Pro &#8211; running Mac OS X [Snow Leopard] 10.6.4 &#8211; starts prompting for password before connecting to Michigan Tech&#8216;s (@MichiganTech) WPA2 Enterprise network. While it&#8217;s not a difficult task to enter the password once [or many times] a day, it nevertheless is painful. After some googling around [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in a while, my Apple MacBook Pro &#8211; running Mac OS X [Snow Leopard] 10.6.4 &#8211; starts prompting for password before connecting to <a href="http://www.mtu.edu/" target="_blank">Michigan Tech</a>&#8216;s (<a href="http://twitter.com/michigantech" target="_blank">@MichiganTech</a>) WPA2 Enterprise network. While it&#8217;s not a difficult task to enter the password once [or many times] a day, it nevertheless is painful. After some googling around and trial n&#8217; error, I have a solution &#8211; it worked for me and it might very well work for you. But as always, the instructions come with no guarantee and that you will use them at your very own discretion. More importantly, you will be solely responsible for any/all damage inflicted upon yourself by following this process, intellectual &#038;/or otherwise.</p>
<p><br clear="all"><br />

<a href='http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/fixingwpa2_00/' title='01. Open &#039;System Preferences&#039;; click on &#039;Network&#039;'><img width="150" height="150" src="http://sgowtham.net/blog/wp-content/uploads/2010/09/FixingWPA2_00-150x150.png" class="attachment-thumbnail" alt="01. Open &#039;System Preferences&#039;; click on &#039;Network&#039;" title="01. Open &#039;System Preferences&#039;; click on &#039;Network&#039;" /></a>
<a href='http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/fixingwpa2_01/' title='02. Select &#039;Aiport&#039; and click on &#039;Advanced&#039;'><img width="150" height="150" src="http://sgowtham.net/blog/wp-content/uploads/2010/09/FixingWPA2_01-150x150.png" class="attachment-thumbnail" alt="02. Select &#039;Aiport&#039; and click on &#039;Advanced&#039;" title="02. Select &#039;Aiport&#039; and click on &#039;Advanced&#039;" /></a>
<a href='http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/fixingwpa2_02/' title='03. Click on &#039;802.1X&#039; tab&#039;. If you see multiple entries for the same network under &#039;User Profiles&#039;, delete all but [the correct] one. Uncheck &#039;Always prompt for password&#039;'><img width="150" height="150" src="http://sgowtham.net/blog/wp-content/uploads/2010/09/FixingWPA2_02-150x150.png" class="attachment-thumbnail" alt="03. Click on &#039;802.1X&#039; tab&#039;. If you see multiple entries for the same network under &#039;User Profiles&#039;, delete all but [the correct] one. Uncheck &#039;Always prompt for password&#039;" title="03. Click on &#039;802.1X&#039; tab&#039;. If you see multiple entries for the same network under &#039;User Profiles&#039;, delete all but [the correct] one. Uncheck &#039;Always prompt for password&#039;" /></a>
<a href='http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/fixingwpa2_03/' title='04. Click on &#039;Apply&#039; followed by &#039;Connect&#039;'><img width="150" height="150" src="http://sgowtham.net/blog/wp-content/uploads/2010/09/FixingWPA2_03-150x150.png" class="attachment-thumbnail" alt="04. Click on &#039;Apply&#039; followed by &#039;Connect&#039;" title="04. Click on &#039;Apply&#039; followed by &#039;Connect&#039;" /></a>
</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2010%2F09%2F21%2Fmac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech%2F&amp;title=MAC%20%26%238211%3B%20Quick%20Fix%20For%20WPA2%20Password%20Prompt%20Issue%20%40%20Michigan%20Tech" id="wpa2a_10"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2010/09/21/mac-quick-fix-for-wpa2-password-prompt-issue-at-michigan-tech/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>[Another] Perfect Season In Review</title>
		<link>http://sgowtham.net/blog/2010/08/19/another-perfect-season-in-review/</link>
		<comments>http://sgowtham.net/blog/2010/08/19/another-perfect-season-in-review/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 23:30:28 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=2722</guid>
		<description><![CDATA[It was Thursday, 13th August 2009, the day we, as a team, played just well enough to keep our slates clean and win the Michigan Tech Graduate Softball League Championship. And in festivities that followed in The Downtowner Lounge in Downtown Houghton, a manager of our team [yes, we do have a few - each [...]]]></description>
			<content:encoded><![CDATA[<p>It was Thursday, 13th August 2009, the day we, as a team, played just well enough to keep our slates clean and <a href="http://sgowtham.net/blog/2009/08/14/a-perfect-season-in-review/" target="_blank">win the Michigan Tech Graduate Softball League Championship</a>. And in festivities that followed in <em>The Downtowner Lounge</em> in Downtown Houghton, a manager of our team [yes, we do have a few - each one, (un)beknownst to others - to manage a different aspect of the game] put forth a seemignly simple question &#8212; <em>of the three championships you have been part of so far, which is your favorite one?</em> The answer, albeit sounding cocky &#038; arrogant to those who don&#8217;t us/me very well, was a polite <em><strong>The Next One</strong></em>. </p>
<p><img src="http://sgowtham.net/blog/files/20100819/n21_108-9022.jpg" border="0" align="left" style="margin-right:10px;">And here we are little over a year later, sitting in the same general area in <em>The Downtowner Lounge</em>, celebrating that <em><strong>Next One</strong></em> &#8211; albeit for a short amount of time, thanks to numerous great souls that have helped us/me understand &#038; appreciate the value of the opportunity we have earned &#8211; our second successive perfect season.</p>
<p>The festivities in 2009 lasted about six hours and the following week saw us look for replacements &#8211; to fill in the void to be left later on by some good [and really smart &#038; committed as well, to say the least] players [<a href="http://www.facebook.com/profile.php?id=6608147" target="_blank">Leslie</a>, <a href="http://www.facebook.com/profile.php?id=6601480" target="_blank">Russ</a>, and so on] to graduation. </p>
<p>While we didn&#8217;t want to care any less about the rumors prevailing in the community that <em>our team is/was stacked with good players</em> and that <em>it was a fluke that we won the championship</em> and that<em> our success in championship games was only 50%</em> [the only non-rumor] and so on, it was [and still is] hard to ignore such preposterous remarks. There are few things in life that come close to matching the feeling of proving your detractors wrong, to do something that someone [or no one] thought you could do or didn&#8217;t give you the deserved credit for doing what you did. And it was 15th October 2009, about SIX months before the tentative start of 2010 season, that some of the core members of this wonderful team started our off-season work outs, almost in a religious fashion. Regiment [<em>as in its usage as a verb</em>] included runs, weights and attempts to be smarter, patient &#038; mature about things that needed to be done on the field in clutch situations. </p>
<p>With weather being unseasonably warm by middle of March of 2010 and much of snow having disappeared, we hit the fields for early practice sessions. Many countless hours of practice and <em>organized team activity</em> over next 20 some weeks or so brought us &#8211; with several new faces &#8211; closer and made us better, a lot better &#8211; to understand and appreciate what each one brought to the table and come up with a plan to best utilize those resources to win games, one at a time. Just like last season, I could write about what we did right and we did wrong in each of the 15 games but it would sound more like a broken record &#8211; as such, I will just tabulate the results and talk about reasons later.</p>
<p><br clear="all"></p>
<table border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td align="center" class="library"><b>#</b></td>
<td align="center" class="library"><b>Date</b></td>
<td align="center" class="library"><b>Opponent</b></td>
<td align="center" class="library"><b>Result</b></td>
<td align="center" class="library"><b>Score</b></td>
</tr>
<tr>
<td align="center" class="sresults">01</td>
<td align="center" class="sresults">2010.05.27</td>
<td align="left" class="sresults">Hu-Tang</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">21-10</td>
</tr>
<tr>
<td align="center" class="sresults">02</td>
<td align="center" class="sresults">2010.05.27</td>
<td align="left" class="sresults">Electrical Engg</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">7-0; By Forfeit (team did not show up)</td>
</tr>
<tr>
<td align="center" class="sresults">03</td>
<td align="center" class="sresults">2010.06.03</td>
<td align="left" class="sresults">Hu-Tang</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">20-3</td>
</tr>
<tr>
<td align="center" class="sresults">04</td>
<td align="center" class="sresults">2010.06.10</td>
<td align="left" class="sresults">LockJawed Zombies</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">23-2</td>
</tr>
<tr>
<td align="center" class="sresults">05</td>
<td align="center" class="sresults">2010.06.17</td>
<td align="left" class="sresults">ROFLCopter</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">12-3</td>
</tr>
<tr>
<td align="center" class="sresults">06</td>
<td align="center" class="sresults">2010.06.24</td>
<td align="left" class="sresults">Aaron Dayton</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">20-3</td>
</tr>
<tr>
<td align="center" class="sresults">07</td>
<td align="center" class="sresults">2010.06.24</td>
<td align="left" class="sresults">Justin Clark</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">15-4</td>
</tr>
<tr>
<td align="center" class="sresults">08</td>
<td align="center" class="sresults">2010.07.01</td>
<td align="left" class="sresults">Aaron Dayton</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">7-0; By Forfeit (team did not show up)</td>
</tr>
<tr>
<td align="center" class="sresults">09</td>
<td align="center" class="sresults">2010.07.08</td>
<td align="left" class="sresults">Information Technology Services</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">13-8</td>
</tr>
<tr>
<td align="center" class="sresults">10</td>
<td align="center" class="sresults">2010.07.15</td>
<td align="left" class="sresults">Physical Education</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">16-5</td>
</tr>
<tr>
<td align="center" class="sresults">11</td>
<td align="center" class="sresults">2010.07.22</td>
<td align="left" class="sresults">Business Sox</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">30-5</td>
</tr>
<tr>
<td align="center" class="sresults">12</td>
<td align="center" class="sresults">2010.07.29</td>
<td align="left" class="sresults">ROFLCopter</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">24-3</td>
</tr>
<tr>
<td align="center" class="sresults"><strong>13</strong></td>
<td align="center" class="sresults"><strong>2010.08.05</strong></td>
<td align="left" class="sresults"><strong>LockJawed Zombies (Round #1)</strong></td>
<td align="center" class="sresults"><strong>W</strong></td>
<td align="center" class="sresults"><strong>12-0</strong></td>
</tr>
<tr>
<td align="center" class="sresults"><strong>14</strong></td>
<td align="center" class="sresults"><strong>2010.08.12</strong></td>
<td align="left" class="sresults"><strong>Electrical Engg (Round #2)</strong></td>
<td align="center" class="sresults"><strong>W</strong></td>
<td align="center" class="sresults"><strong>14-6</strong></td>
</tr>
<tr>
<td align="center" class="sresults"><strong>15</strong></td>
<td align="center" class="sresults"><strong>2010.08.19</strong></td>
<td align="left" class="sresults"><strong>Electrical Engg (Finals)</strong></td>
<td align="center" class="sresults"><strong>W</strong></td>
<td align="center" class="sresults"><strong>17-3</strong></td>
</tr>
</table>
<p><br clear="all"><br />
<img src="http://sgowtham.net/blog/files/20100819/english_alphabets.png" alt="Team Fiziks 2010" title="Team Fiziks 2010" align="right" width="275" style="margin-top:15px;"><br />
We are the first ones to concede &#8211; concede the fact that not everything we did was perfect and there is plenty of room for improvement. But we did put up the best offense and best defense &#8211; with a league high of 251 (-27 compared to 2009) runs scored and allowing only 60 (+13 compared to 2009), for a league&#8217;s best run differential of +191 (-14 compared to 2009). More importantly, most of us had fun [it might not have seemed like it but trust me, fun is a very relative/subjective entity], we got better as an individual &#038; as a team, and even more importantly, most of the teams we played seemed to have fun too. And while there are many smaller reasons behind our success, the most notable ones have remained the <a href="http://sgowtham.net/blog/2009/08/14/a-perfect-season-in-review/" target="_blank">same as in 2009</a> and many a years before. It&#8217;s noteworthy to mention that continuing to stick with/use <em><a href="http://en.wikipedia.org/wiki/Lagrangian_mechanics" target="_blank" class="underline">Lagrangian</a> / <a href="http://en.wikipedia.org/wiki/Hamiltonian_mechanics" target="_blank" class="underline">Hamiltonian</a> Mechanics</em> has continued to yield (very) rich dividends.</p>
<p>While it&#8217;s not the first time that someone initiated the smack talk against this very proud team, we respect three of the four that did so, including the one that we played when all the marbles were at stake &#8211; for they showed up to defend their words by being physically present at the game and as such, shall remain nameless. However, there was one that does need a specific mention:</p>
<div class="pod">
<p>It was on 10th of June, about four weeks before we played what he claimed to be <em>his</em> team [later realization: he was a player off the bench, if that and, <em>his</em> team didn't even consider him to be a part of it], that I was watching <em>his</em> team play some other team and in all honesty, was cheering for <em>his</em> team &#8211; as it comprised of many a good friends of mine, who were an integral part of the famed <a href="http://www.michigantechhuskies.com/SportSelect.dbml?SPSID=90466&#038;SPID=10930&#038;DB_OEM_ID=18800&#038;KEY=&#038;Q_SEASON=2009" target="_blank">2009-2010 Michigan Tech Huskies Women&#8217;s Basketball Program</a>. </p>
<p>His claim [or I must say, the guarantee] was that <em>he</em> would kick our a$$, that <em>he knew</em> all the secrets to the way we played, that we were beatable [a fairly good and reasonable assessment] and that we would be sorry that we played <em>his</em> team. And as if this weren&#8217;t sufficient, he made his claim / guarantee abundantly public during every opportunity he had, in spite of numerous polite reminders that our team didn&#8217;t need any further motivation to be playing in this league and that we considered it to be our privilege, <em>not a right</em>, to be playing in this league.</p>
<p>Then comes 22nd of July, <em>the game day</em> &#8211; and the dude was a <em>NO SHOW</em>. It didn&#8217;t stop <em>his</em> team from being at the wrong end of our wrath and the final score, at the end of just five innings, read 30-5 [yeah, THIRTY-to-FIVE]; 4 of their 5 runs coming off of our mental errors. <em>His</em> team, without any knowledge of his mouthing off for over a month, felt like we were showing off and running up the score &#8211; we did feel sorry for the trouble that <em>his</em> team went through but felt immensely proud of the way our team responded to a situation &#8212; that we could raise our level when circumstance(s) demanded. Later in the day, we learned that he was busy sipping some glamorous drinks on yacht in Stillwater, Minnesota [<em>under the pretense of a dislocated shoulder</em> - I am more than 100% certain that I saw him within the confines of Michigan Tech's Student Development Complex the same day around 11am].</p>
<p>At a later (personal &#038; public) meeting at our Athletic Director&#8217;s Camp, he went on to further claim that the result of this aforementioned game would have been different had he been able to play and more importantly that we, Team FIZIKS, should pray not to face <em>his</em> team in the playoffs. It could just be he was [and still is] so full of himself and living comfortably within the confines of the fictitious Universe, that he didn&#8217;t realize that <em>his</em> team didn&#8217;t qualify for the upper tier playoffs like ours did.</p>
<p>Just the way our team is built and made to think, we did learn our lessons from this experience. Not that we would like to be the first ones to do so [I'm not claiming that some of us have never done it before], we learned the rules of talking smack:</p>
<ol>
<li>You are allowed to talk smack before a game, almost as much as you like, within acceptable and reasonable limits.</li>
<li>The least you can do when you have talked smack before a game is to show up, in person, to the game &#8211; either to play or to support your own team.</li>
<li>You lose all rights of talking smack when/once the team [or an individual on the opposing team] responds to your smack talk, not by retaliating smack talk but by an actual performance on the field.</li>
<li>Any further smack talk against the same team, in spite of them having performed successfully against you, will be considered an act of stupidity and being full of sh%% &#8211; to say the least.</li>
</ol>
<p>So, <em>THANK YOU</em> for teaching us these invaluable lessons. It&#8217;s only fair that we teach you something as well, to only partially return your kindness:</p>
<ol>
<li><strong>You are neither as good nor as important to your team as you think you are</strong> AND <strong>it&#8217;s not your team, most certainly not after you left them high and dry the way you did</strong> &#8211; we might be the first ones to bring you to this realization but trust us, you will find people like us more in your <em>real</em> life more frequently than the ones that tell you that <em>you are the greatest creation that the mankind has ever witnessed</em>; especially so when you miss the hidden meaning / interpretation of the soft phrasing of latter kind &#8211; that <em>you are good today but could be better</em>.</li>
<li><strong>Be humble</strong> &#8211; a very simple definition of humility is <em>just doing your job and letting it largely speak for itself</em> [we learned this from <a href="http://en.wikipedia.org/wiki/Todd_Christensen" target="_blank" class="underline">Todd Christensen</a>, a member of the <a href="http://en.wikipedia.org/wiki/Super_Bowl_XVIII" target="_blank" class="underline">Super Bowl Champions, 1983 Los Angeles Raiders</a>].</li>
<li>Taking a bunch of your friends, on one Friday night, to a bar for a drink or two DOES NOT mean you know how to build a team.</li>
<li>Keep your mouth shut when there is no need to open it.</li>
<li>When you talk the talk, be sure to walk the walk &#8211; claim that dislocated shoulder [or any other part of your body] is never an acceptable reason to be, at least, not cheering for your team.</li>
<li>Stop making [lame] excuses and take responsibility for your actions.</li>
<li>It&#8217;s not too difficult to say <em>I am sorry, I f#$%^ed up; I will try my best not to repeat my mistakes and to be better in my next attempt</em>. People around you are more than likely to forgive you and give you a second [or <em>n</em>th] chance at doing something.</li>
<li>In other words, since you are a soon-to-be an/a <a href="http://www.mtu.edu/business/" target="_blank" class="underline">MBA from Michigan Tech</a> and supposedly understand $$ better than rest of us do, <em>do not write a check that cannot be cashed or that your team is not willing to cash it for you</em>.</li>
</ol>
<p>If this is not easy enough to understand, please feel free to come back next season and apply for an internship with our team. If all goes well, we will approve your request and teach you these things, in a <em>hands on</em> fashion, that you have either ignored to learn &#038;/or effortlessly slept through when life was gracious enough to teach you in a friendly classroom-like environment.
</div>
<p><br clear="all"></p>
<p align="center"><img src="http://sgowtham.net/blog/files/20100819/n21_108-9024.png" alt="Team Fiziks 2010" title="Team Fiziks 2010"></p>
<p class="bpcaption">Not In Picture: Dr. Robert Weidman, Kelsey Cox, Laura Hess</strong></p>
<p><br clear="all"><br />
While there are teams [calling them a team, in the true sense of the word, is an atrocity in itself] and some individuals [local and non-local] have had [and will continue to have] issues with the success of our team [see one such assault via facebook below], we have very strong reasons to believe that the league is better off because we are a part of it. Like a team-mate phrased it effortlessly in so few words, <em>the rising tides lifts all ships; for now, we are the big ship</em>. And when a team that does come along to beat us <em>fair and square</em>, trust me, we will be happy for them &#8211; albeit a momentary disappointment. </p>
<p><br clear="all"><br />
<img src="http://sgowtham.net/blog/files/20100819/facebook_00.png" alt="Facebook Assault" title="Facebook Assault" width="600"></p>
<p><br clear="all"><br />
<img src="http://sgowtham.net/blog/files/20100819/facebook_01.png" alt="Facebook Assault" title="Facebook Assault" width="600"></p>
<p><br clear="all"><br />
<img src="http://sgowtham.net/blog/files/20100819/facebook_02.png" alt="Facebook Assault" title="Facebook Assault" width="600"></p>
<p><br clear="all"><br />
We take a lot of pride in the way we build in our team, train the players that have never played the game before [yours-truly was one of them, eight years ago] or haven&#8217;t played in quite a while, practice at least once a week, learn the rules and regulations and follow them religiously so that we keep the game safe for everyone involved, not be the first one to initiate any kind of smack talk against any team, be humble in victory and graceful in defeat [while it might not seem so from reading this post], get better and smarter with each week/season, put in an enviable performance week in &#038; week out and year in &#038; year out. As a by-product of all this, we are insanely proud of our 86-7-1 record over the last seven years. There is no magic to what we do &#038;/or achieve as a team but there sure as hell is plenty of hard work, dedication and sacrifice by everyone involved. </p>
<p>I believe what we do is a microcosm of progress and of what causes progress; to be not wanting to be better tomorrow than what we are today, to settle for something good instead of pursuing greatness, to hope that the competition gets lower so that we can look better and not having the ability to generalize this to almost every other aspect of our lives &#8230; is, according to us, a crime against ourselves, and making a mockery of all the wonderful opportunities that life has sent our way.</p>
<p>Along with <em>being just good enough is not good enough</em> (a Lake Superior Walk realization) and <em>failing to plan is planning to fail</em> (a friendly advice from undergraduate days), [<em>settling for</em>] <em>good is the enemy of great</em> is as invaluable a lesson as I have ever learned in my life &#8211; thanks to a book that a dear friend, <a href="http://www.facebook.com/profile.php?id=80402311" target="_blank">Ian Marks</a>, graciously let me borrow over Christmas 2009 break and it has come to be, sort of, mission statement / guiding light of our team &#038; lives. I&#8217;m pretty sure that the double play opportunities we missed in the championship game &#8212; 6-4-3 and 4-6-3, with latter having had the more serious impact had the game been closer &#8212; will haunt us [our Short Stop and yours truly] for times to come, at least until we get another opportunity to get it right. And just to remind ourselves of the consequences of missing out on opportunities, we imposed on ourselves an eight mile run as a <em>moderate punishment</em>.  And just like 2009, the festivities lasted about six hours or less and we are on the look out for replacements players to fill in the void that will be left by some good [and really smart &#038; committed as well, to say the least] players [<a href="http://www.facebook.com/profile.php?id=6606301" target="_blank">Josh Carlson</a>, <a href="http://www.facebook.com/emwinder" target="_blank">Eric Winder</a> and so on] to graduation.</p>
<p><em>Thus begins an earnest &#038; humble attempt to be better tomorrow, as an individual and as a team, than we are today.</em></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2010%2F08%2F19%2Fanother-perfect-season-in-review%2F&amp;title=%5BAnother%5D%20Perfect%20Season%20In%20Review" id="wpa2a_12"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2010/08/19/another-perfect-season-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Perfect Season In Review</title>
		<link>http://sgowtham.net/blog/2009/08/14/a-perfect-season-in-review/</link>
		<comments>http://sgowtham.net/blog/2009/08/14/a-perfect-season-in-review/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 23:01:19 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=2374</guid>
		<description><![CDATA[It was Saturday, 9th May 2009 &#8211; and the weatherman had predicted mostly cloudy weather with highs of around upper 40s and Sun was expected to make a guest appearance or two. About halfway through our first practice session, weather conditions made a fool of weatherman&#8217;s prediction and fairy tale like snow flakes gave our [...]]]></description>
			<content:encoded><![CDATA[<p>It was Saturday, 9th May 2009 &#8211; and the weatherman had predicted mostly cloudy weather with highs of around upper 40s and Sun was expected to make a guest appearance or two. About halfway through our first practice session, weather conditions made a fool of weatherman&#8217;s prediction and fairy tale like snow flakes gave our softball fields a venerable <em>Lambeau Field in Winter</em> look. While most others would have called it an end, our passion [or foolishness, you be the judge] kept us going and at the end of it all, I knew [seriously, I am not kidding or making this up] we would be the last team standing when season&#8217;s Sun headed towards horizon. And having nothing but softball [at least during Summer months] to claim as <em>life</em>, I spent part of the day after in making a sign &#8211; that we would be holding for the team picture.</p>
<p><br clear="all"></p>
<p align="center"><img src="http://sgowtham.net/blog/files/20090814/PhysEngg_2009.png" alt="Team Phys Engg, 2009" title="Team Phys Engg, 2009"></p>
<p><br clear="all"><br />
Many countless hours of practice and <em>organized team activity</em> over next 15+ weeks or so brought us closer and made us better, a lot better &#8211; to understand and appreciate what each one brought to the table and come up with a plan to best utilize those resources to win games, one at a time. I could write about what we did right and we did wrong in each of the 13 games but it would sound more like a broken record &#8211; as such, I will just tabulate the results and talk about reasons later.</p>
<p><br clear="all"></p>
<table border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td align="center" class="library"><b>#</b></td>
<td align="center" class="library"><b>Date</b></td>
<td align="center" class="library"><b>Opponent</b></td>
<td align="center" class="library"><b>Result</b></td>
<td align="center" class="library"><b>Score</b></td>
</tr>
<tr>
<td align="center" class="sresults">01</td>
<td align="center" class="sresults">2009.05.21</td>
<td align="left" class="sresults">Implants</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">21-0</td>
</tr>
<tr>
<td align="center" class="sresults">02</td>
<td align="center" class="sresults">2009.05.28</td>
<td align="left" class="sresults">Timmaay!</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">29-8</td>
</tr>
<tr>
<td align="center" class="sresults">03</td>
<td align="center" class="sresults">2009.06.04</td>
<td align="left" class="sresults">Hu-Tang</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">24-7</td>
</tr>
<tr>
<td align="center" class="sresults">04</td>
<td align="center" class="sresults">2009.06.11</td>
<td align="left" class="sresults">Student Affairs</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">31-5</td>
</tr>
<tr>
<td align="center" class="sresults">05</td>
<td align="center" class="sresults">2009.06.18</td>
<td align="left" class="sresults">Physical Education 2</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">21-0</td>
</tr>
<tr>
<td align="center" class="sresults">06</td>
<td align="center" class="sresults">2009.06.25</td>
<td align="left" class="sresults">Mechanical Engg</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">30-2</td>
</tr>
<tr>
<td align="center" class="sresults">07</td>
<td align="center" class="sresults">2009.07.02</td>
<td align="left" class="sresults">Spartans (Indian Students Assn)</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">By Forfeit (team did not show up)</td>
</tr>
<tr>
<td align="center" class="sresults">08</td>
<td align="center" class="sresults">2009.07.09</td>
<td align="left" class="sresults">Materials Sci &#038; Engg</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">18-5</td>
</tr>
<tr>
<td align="center" class="sresults">09</td>
<td align="center" class="sresults">2009.07.16</td>
<td align="left" class="sresults">Computer Science</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">26-6</td>
</tr>
<tr>
<td align="center" class="sresults">10</td>
<td align="center" class="sresults">2009.07.23</td>
<td align="left" class="sresults">Electrical Engg</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">18-14</td>
</tr>
<tr>
<td align="center" class="sresults">11</td>
<td align="center" class="sresults">2009.07.30</td>
<td align="left" class="sresults">Information Technology Services</td>
<td align="center" class="sresults">W</td>
<td align="center" class="sresults">25-12</td>
</tr>
<tr>
<td align="center" class="sresults"><strong>12</strong></td>
<td align="center" class="sresults"><strong>2009.08.06</strong></td>
<td align="left" class="sresults"><strong>Student Affairs (Semi Finals)</strong></td>
<td align="center" class="sresults"><strong>W</strong></td>
<td align="center" class="sresults"><strong>20-5</strong></td>
</tr>
<tr>
<td align="center" class="sresults"><strong>13</strong></td>
<td align="center" class="sresults"><strong>2009.08.13</strong></td>
<td align="left" class="sresults"><strong>Electrical Engg (Finals)</strong></td>
<td align="center" class="sresults"><strong>W</strong></td>
<td align="center" class="sresults"><strong>15-9</strong></td>
</tr>
</table>
<p><br clear="all"><br />
While not everything did was perfect, we did put up the best offense and best defense &#8211; with a league high of 278 runs scored and allowing only 73, for a league&#8217;s best run differential of +205. More importantly, most of us had fun [it might not have seemed like it but trust me, fun is a very relative/subjective entity] and even more importantly, most of the teams we played seemed to have fun too. And while there are many smaller reasons behind our success, following are probably the most notable ones [in no/some particular order]:</p>
<ol>
<li>A manager who knows how to run the show.</li>
<li>A clean and consistent roster of players.</li>
<li>A set of unselfish players who are committed to the concept of team and show up for practice.</li>
<li>Teach new players the rules and regulations of the game so that they play the game the right way, don&#8217;t get hurt and importantly, don&#8217;t hurt others.</li>
<li>Players who understand their role(s) and execute it &#8211; almost every time &#8211; to the best of their ability.</li>
<li>At least two practice sessions a week, irrespective of weather conditions, to hone individual &#038; team skills.</li>
<li>A unified understanding that <em>we are a work in progress</em> and that <em>we haven&#8217;t done anything worth talking about yet</em>.</li>
<li>A unified understanding that <em>we shall not speak of <strong>the L word</strong></em>.</li>
<li>A trash talker (or two).</li>
<li>An awesome set of supporters and die hard fans.</li>
<li>A designated driver.</li>
<li>A variety of characters to keep it fun and real.</li>
</ol>
<p>While these have been a constant fixture of our team for many years, we unanimously decided to add a thing or two to this routine:</p>
<ol>
<li>Team work outs three times a week [involved running and lifting a variety of weights - to help build strength/stamina and reduce fatigue during crunch game scenarios].</li>
<li>Our inability to properly resolve the forces involved into appropriate components &#038; confusion created as a result had cost us dearly in previous few championship games. As such, we abandoned the usage of <em>Newtonian Mechanics</em> completely and resorted to <em><a href="http://en.wikipedia.org/wiki/Lagrangian_mechanics" target="_blank" class="underline">Lagrangian</a>/<a href="http://en.wikipedia.org/wiki/Hamiltonian_mechanics" target="_blank" class="underline">Hamiltonian</a> Mechanics</em> &#8211; based on players&#8217; level of comfort. It seemed to pay (very) rich dividends as we only had to worry about the initial and final potentials of the system rather than zillion force components.</li>
</ol>
<p><br clear="all"></p>
<p align="center"><img src="http://sgowtham.net/blog/files/20090814/2009_PhysEngg.png" alt="Team Phys Engg, 2009" title="Team Phys Engg, 2009"></p>
<p class="bpcaption"></strong></p>
<p><br clear="all"><br />
Like a good [bad] old saying goes, <em>there are many ways of doing the same thing to get the same result</em>, and I am sure there are other ways of winning championships but trust me, I wouldn&#8217;t want to experience it any other team&#8217;s way.</p>
<p>The first 12 hours or so after the championship game had been pretty euphoric and celebratory [thanks in part to <em>Mr. League Commissioner</em>, Dave Fritz and <em>Mr. President</em>, Randy Harrison - for getting us the trophy the same day], the last 6 or so have been pretty disappointing and depressing &#8211; may be because the mind (and the body) knows that there are no more practices, no more games and that I wouldn&#8217;t get to see / hang out with my teammates as regularly as I had found myself doing so.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2009%2F08%2F14%2Fa-perfect-season-in-review%2F&amp;title=A%20Perfect%20Season%20In%20Review" id="wpa2a_14"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2009/08/14/a-perfect-season-in-review/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>THE JINX IS BROKEN &#8230; On National Television!!!</title>
		<link>http://sgowtham.net/blog/2008/09/18/the-jinx-is-broken-on-national-television/</link>
		<comments>http://sgowtham.net/blog/2008/09/18/the-jinx-is-broken-on-national-television/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 03:15:34 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=631</guid>
		<description><![CDATA[As weird as it might sound, none of the men&#8217;s team from my school, Michigan Tech, had ever beaten a men&#8217;s team from our arch rivals, Northern Michigan, when I was part of the audience. I thought it had to do with my physical presence in the gym but apparently watching them over the internet [...]]]></description>
			<content:encoded><![CDATA[<p>As weird as it might sound, none of the men&#8217;s team from my school, <a href="http://www.mtu.edu/" target="_blank">Michigan Tech</a>, had ever beaten a men&#8217;s team from our arch rivals, <a href="http://www.nmu.edu/" target="_blank">Northern Michigan</a>, when I was part of the audience. I thought it had to do with my physical presence in the gym but apparently watching them over the internet was jinxed too. As ashamed as I was about this, I was equally proud of the fact that none of our women&#8217;s team had ever lost to the arch rivals; but I must admit &#8211; shame over-weighed my pride by a few orders of magnitude, in spite of the concerned athletes trying to convince me that <em>it was them and not me</em>&#8230;</p>
<p>Huskies blew away Wildcats in Marquette&#8217;s Superior Dome (NMU&#8217;s home field) in a nationally televised <strong>Division II Football Game of the Week</strong> (thanks to CBS College Sports Network and FSN Detroit) to lay claim to the <strong>Miner&#8217;s Cup</strong>. During my recent trip up north, a bunch of these football players had promised to break my jinx and true to their words, that JINX is history now <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>God bless the internet and <a href="http://skype.com/" target="_blank">Skype</a>, I got to watch this with buddy <a href="http://photos.kyleschneider.net/" target="_blank">Kyle</a> in Alaska. Honestly, I don&#8217;t think I have ever watched a game on TV (or any other program for that matter), in which I could claim personal acquaintance to so many &#8211; athletes, coaching staff and fans included. In spite of being over a thousand miles away from the venue, I couldn&#8217;t forget my usual role in such events and as such, ended up shooting some pictures:</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080918_1/MinersCup.jpg" alt="Michigan Tech @ Northern Michigan" title="Michigan Tech @ Northern Michigan"></p>
<p><br clear="all"><br />
These and rest of the pictures from this game are <a href="http://sgowtham.net/gallery/20080918/" target="_blank">here</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2008%2F09%2F18%2Fthe-jinx-is-broken-on-national-television%2F&amp;title=THE%20JINX%20IS%20BROKEN%20%26%238230%3B%20On%20National%20Television%21%21%21" id="wpa2a_16"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2008/09/18/the-jinx-is-broken-on-national-television/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Few More Days In Paradise</title>
		<link>http://sgowtham.net/blog/2008/09/09/a-few-more-days-in-paradise/</link>
		<comments>http://sgowtham.net/blog/2008/09/09/a-few-more-days-in-paradise/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 04:21:02 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[Freda]]></category>
		<category><![CDATA[Houghton]]></category>
		<category><![CDATA[Michigan]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[USA]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=590</guid>
		<description><![CDATA[I might sound like a broken record but as happy and excited as I was about ten days ago to be going there, I was equally sad &#38; depressed to be going away from it &#8211; at least until the next time, whenever that may be&#8230; Looking back at these ten days while I awaited [...]]]></description>
			<content:encoded><![CDATA[<p>I might sound like a broken record but as happy and excited as I was about ten days ago to be going <a href="http://www.cityofhoughton.com/" target="_blank">there</a>, I was equally sad &amp; depressed to be going away from it &#8211; at least until the next time, whenever that may be&#8230; Looking back at these ten days while I awaited the boarding call for my next flight in Minneapolis/St. Paul Airport, I couldn&#8217;t help but feel that the trip was pretty eventful and relaxing &#8211; with the exclusion of an unforeseen circumstance that prevented me from meeting buddy <a href="http://photos.kyleschneider.net/" target="_blank">Kyle</a>&#8216;s parents and walking across the Mackinaw Bridge. In a nutshell, I did lot more work than I have in the last six months and if I said I had fun, it&#8217;s an understatement &#8211; interacted with many a (new) friends, met and hung out with almost all of those that have made a difference in my life in the 66 months that I lived here, worshiped the holy spirits at <a href="http://www.keweenawbrewing.com/" target="_blank">KBC</a>, cooked B<sup>3</sup> at a <a href="http://www.ladyascrafts.com/" target="_blank">friend</a>&#8216;s house, enjoyed great food served with home-like care, collected GPS coordinates for numerous pictures from my <a href="http://sgowtham.net/showcase/" target="_blank">showcase</a>, watched and shot (photographs of) two <a href="http://www.michigantechhuskies.com/" target="_blank">Huskies</a> football games played on a brand new turf (thanks to the <a href="http://www.michigantechhuskies.com/ViewArticle.dbml?DB_OEM_ID=18800&#038;KEY=&#038;ATCLID=1250002" target="_blank">Athletic Department</a>, I  got an up close and personal view of a Goal Line Stand, a Safety and a plethora of TDs), tried my hand at water sports (thanks to Liz, <a href="http://www.thisnorthernlife.com/" target="_blank">Amy</a> [thank you for lending me your tripod], Scotty, Julie, Bucky, Cheryl and Jenna), visited the industrial ruins at Freda (a small township where I had once had the best banana pie ever), took a tour of the <a href="http://www.quincymine.com/" target="_blank">Quincy Mine</a> and more. Things that I (re)learnt during my stay here:</p>
<p><br clear="all"></p>
<ul>
<li>The only way I could be considered to be <em>in shape</em> is if random shapes were also considered to be <em>shapes</em>.</li>
<li>New found respect for folks who do water sports and shoot pictures of water sports. Although not by much, I would like to think I am slightly better at shooting than participating in them.</li>
<li>New found respect for ROTC Officers and Cadets who do a cumulative number of push-ups every time Michigan Tech football team scores points. I suck at doing push-ups <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
<li>One of my <strong>New Year&#8217;s Resolution</strong> for the last two years was resolved, without my own knowledge, nearly a year ago. In a nutshell, it was to be a <strong>Bad A$$</strong> and the way to achieve it (as I had explained to my neighbors in NJ) was to be called that (or Jerk, or something to that effect &#8211; you get the idea) by a girl in public (prettier the better).  It didn&#8217;t take too long &#8211; the very first evening, some one I have known for a long time and admired, called me that near the Green House. Thank you, LJW, for stepping up and doing the honors <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>There is a difference between being <strong>Bad A$$</strong> and plain <strong>mean</strong> (thank you Robby).</li>
<li>Practice, Preparation, Planning, Patience and Perseverance are useful tools to have and more the better.</li>
</ul>
<p><br clear="all"><br />
If a picture&#8217;s worth a thousand words, the ones in the collage below should provide a bird&#8217;s eye view of my stay:</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20080909/20080909.jpg" alt="Michigan Tech 2008.08.31 - 2008.09.09" title="Michigan Tech 2008.08.31 - 2008.09.09"></p>
<p><br clear="all"><br />
These and other pictures from this trip are here:</p>
<p>NCAA DII Football <a href="http://sgowtham.net/gallery/20080830/" target="_blank">Winona State Warriors @ Michigan Tech Huskies</a> :: <a href="http://sgowtham.net/gallery/20080906/" target="_blank">Hillsdale Chargers @ Michigan Tech Huskies</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2008%2F09%2F09%2Fa-few-more-days-in-paradise%2F&amp;title=A%20Few%20More%20Days%20In%20Paradise" id="wpa2a_18"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2008/09/09/a-few-more-days-in-paradise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storing And Querying Information with PERL-MySQL</title>
		<link>http://sgowtham.net/blog/2008/07/25/storing-and-querying-information-with-perl-mysql/</link>
		<comments>http://sgowtham.net/blog/2008/07/25/storing-and-querying-information-with-perl-mysql/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 04:01:27 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[CGI]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PERL]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=359</guid>
		<description><![CDATA[Disclaimer These instructions/steps worked for me and it may very well work for you on Sun OS / linux distributions. Please note that if you decide to use these instructions on your machine (either for this particular application and/or for other kind of information), you are doing so entirely at your very own discretion and [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>These instructions/steps worked for me and it may very well work for you on Sun OS / linux distributions. Please note that if you decide to use these instructions on your machine (either for this particular application and/or for other kind of information), you are doing so entirely at your very own discretion and that neither this site, <a href="http://sgowtham.net/" target="_blank">sgowtham.net</a>, nor its author is responsible for any/all damage &#8211; intellectual or otherwise.</p>
<p><br clear="all"><br />
During the Christmas break of 2005-06 (while I was a graduate student in <a href="http://www.mtu.edu/" target="_blank">Michigan Technological University</a>), I thought it would be nice to have a tool to store details pertaining to our <a href="http://www.phy.mtu.edu/pandey/" target="_blank">research group</a> publications in a MySQL database (instead of a flat HTML file). Some underlying motives were as follows:</p>
<ol>
<li>List all publications in a year &#8211; helps when generating annual progress reports</li>
<li>List all publications by any given author(s)</li>
<li>A combination of the above two possibilities</li>
</ol>
<p>The server which served our research group website used Sun OS 5.6 and for security-related reasons, it did not have PHP. As such, it became necessary (a good thing!) that this utility had to be written using PERL CGI (<a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface" target="_blank">Common Gateway Interface</a>). List of required features (implemented over a period of time) included:</p>
<ol>
<li><strong>User Side</strong>
<ol>
<li>Display all publications when no query is submitted (default display) &#8211; include a search form</li>
<li>Searchable by year of publication</li>
<li>Searchable by two authors</li>
<li>Searchable by a combination of #2 and #3</li>
<li>When displaying queried results, include Abstract</li>
</ol>
</li>
<li><strong>Admin Side:</strong>
<ol>
<li>Adding a new publication to the database, with PDF upload option (GUI)</li>
<li>Updating details for an entry that already exists in a database (GUI)</li>
<li>Deleting an entry from the database (GUI)</li>
<li>Restricted access</li>
</ol>
</li>
</ol>
<p>Starting with MySQL database/table structure, these requirements are described one by one in following subsections.</p>
<p><br clear="all"></p>
<h3 class="blog">#0. Preliminary Settings</h3>
<p>Let us assume that:</p>
<ol>
<li>The web documents are stored under <strong>/var/www/html</strong> and will henceforth be referred to as <strong>$DocumentRoot</strong> (if you are trying to implement this in your research group in a university/academic institution, please check with your systems administrator for the appropriate value of <strong>$DocumentRoot</strong>).</li>
<li>The page (with search form) which users will interact is called <strong>publications.cgi</strong> and is stored under <strong>$DocumentRoot</strong>.</li>
<li>The folder that contains PDF version of publications is called <strong>pdf</strong> and is located under <strong>$DocumentRoot</strong>. Make sure this folder has <strong>777</strong> permission.</li>
<li>The folder that contains administrative CGI scripts is called <strong>admin</strong> and is located under <strong>$DocumentRoot</strong>. This folder must have restricted access.</li>
</ol>
<p><br clear="all"></p>
<h3 class="blog">#1. MySQL Database</h3>
<ol>
<li>Create a database. If <strong>einstein</strong> is userid of the group&#8217;s principal investigator, then <strong>einstein_research</strong> would be just fine a name for the database. </li>
<li>Create a dummy user (within MySQL), <strong>einstein_webuser</strong>, with at least <strong>INSERT</strong>, <strong>UPDATE</strong>, <strong>SELECT</strong> and <strong>DELETE</strong> previliges on <strong>einstein_research</strong> database.</li>
<li>Set a (strong enough) password for this dummy user.</li>
<li>Create a table within <strong>einstein_research</strong> database, <strong>publications</strong>, with following structure:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #ff0000;">`publications`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`PubID`</span>    <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">11</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`BibID`</span>    <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">15</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #66cc66;">,</span> 
  <span style="color: #ff0000;">`Title`</span>    <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">255</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`Authors`</span>  <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">150</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`JName`</span>    <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">30</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`JVolume`</span>  <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">8</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`JYear`</span>    <span style="color: #993333; font-weight: bold;">YEAR</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">4</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`JPage`</span>    <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">11</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`Abstract`</span> text<span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">UNIQUE</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`BibID`</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">`BibID`</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #ff0000;">`PubID`</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">`PubID`</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE <span style="color: #66cc66;">=</span> MYISAM <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET <span style="color: #66cc66;">=</span> latin1;</pre></td></tr></table></div>

</li>
</ol>
<p>It is generally a good idea to back up these databases on a regular basis &#8211; to save oneself from the pain of re-entering everything if something were to go wrong. You may refer to one of my previous posts that discusses <a href="http://sgowtham.net/blog/2008/04/04/backing-up-and-restoring-mysql-databases/" target="_blank">backing up and restoring MySQL databases</a> in detail.</p>
<p><br clear="all"></p>
<h3 class="blog">#2. User Side: <strong>publications.cgi</strong></h3>
<p>Following one of the requirements as mentioned before, this page must display all publications when no query is submitted (default view) and display only those publications (with abstract) when a query is submitted. The part below is the code for default view.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># publications.cgi (PART #1)</span>
<span style="color: #666666; font-style: italic;"># CGI script to search the database</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modules being used</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a CGI object and retrieve information from the form</span>
<span style="color: #0000ff;">$inputform</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Get values from the form</span>
<span style="color: #0000ff;">$year</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;year&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$title</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$author1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;author1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$author2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;author2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$bo1</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;BO1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$bo2</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;BO2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$bo3</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;BO3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ffill</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ffill&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If the variable 'ffill' is empty, then display the form</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ffill</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications&lt;/h2&gt;
&nbsp;
&lt;!-- FORM --&gt;
&lt;form method=&quot;POST&quot; action=&quot;/publications.cgi&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;center&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Year&lt;/b&gt; &amp;nbsp; &amp;nbsp;&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;year&quot;&gt;
    &lt;option value='%'&gt;Any&lt;/option&gt;
    &lt;option value='2008'&gt;2008&lt;/option&gt;
    &lt;option value='2007'&gt;2007&lt;/option&gt;
    &lt;option value='2006'&gt;2006&lt;/option&gt;
    &lt;option value='2005'&gt;2005&lt;/option&gt;
    &lt;option value='2004'&gt;2004&lt;/option&gt;
    &lt;option value='2003'&gt;2003&lt;/option&gt;
    &lt;option value='2002'&gt;2002&lt;/option&gt;
    &lt;option value='2001'&gt;2001&lt;/option&gt;
    &lt;option value='2000'&gt;2000&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO1&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;title&quot; size=&quot;15&quot;&gt; &amp;nbsp; &amp;nbsp;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO2&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Author&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;author1&quot; size=&quot;15&quot;&gt;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO3&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Author&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;author2&quot; size=&quot;15&quot;&gt;
&lt;/td&gt;
&lt;td&gt;
&amp;nbsp;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;ffill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Search&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
&lt;br&gt;** All fields are optional
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$dbh</span>      <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql1</span>     <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT * FROM publications ORDER BY JYear DESC, &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>      <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql1</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;JName ASC, JVolume DESC, JPage DESC, Title&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$query</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$nresults</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">rows</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Display the results</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$nresults</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;table width=&quot;100%&quot; cellpadding=&quot;5&quot; cellspacing=&quot;5&quot; border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;#&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;BibID / Title / Authors / Citation&lt;/b&gt; 
	(Last-to-first, with Journals alphabetically sorted)&lt;/td&gt;
&lt;/tr&gt;
EOF</span>
&nbsp;
<span style="color: #0000ff;">$id</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$PubID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$BibID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Title</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Authors</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JName</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JVolume</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JYear</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JPage</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Abstract</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
  &lt;tr&gt;
  &lt;td valign=&quot;top&quot;&gt;
  $id
  &lt;/td&gt;
  &lt;td valign=&quot;top&quot;&gt;
  $BibID | 
  &lt;a href=&quot;/pdf/$BibID.pdf&quot; target=&quot;_blank&quot;&gt;PDF&lt;/a&gt;&lt;br&gt;
  $Title&lt;br&gt;
  $Authors&lt;br&gt;
  &lt;i&gt;$JName&lt;/i&gt;, &lt;b&gt;$JVolume&lt;/b&gt;, $JPage ($JYear)
  &lt;/td&gt;
  &lt;/tr&gt;
EOF</span>
  <span style="color: #0000ff;">$id</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;/table&gt;
EOF</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;&lt;h3&gt;Search Results&lt;/h3&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;&lt;font color=red&gt;Sorry, no records were found!&lt;/font&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The part below contains the code that takes care of search-results part.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># publications.cgi (PART #2)</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If the variable 'ffill' is not empty, then query the database</span>
<span style="color: #666666; font-style: italic;"># and display results</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications&lt;/h2&gt;
&nbsp;
&lt;!-- FORM --&gt;
&lt;form method=&quot;POST&quot; action=&quot;/publications.cgi&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;center&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Year&lt;/b&gt; &amp;nbsp; &amp;nbsp;&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;year&quot;&gt;
    &lt;option value='%'&gt;Any&lt;/option&gt;
    &lt;option value='2008'&gt;2008&lt;/option&gt;
    &lt;option value='2007'&gt;2007&lt;/option&gt;
    &lt;option value='2006'&gt;2006&lt;/option&gt;
    &lt;option value='2005'&gt;2005&lt;/option&gt;
    &lt;option value='2004'&gt;2004&lt;/option&gt;
    &lt;option value='2003'&gt;2003&lt;/option&gt;
    &lt;option value='2002'&gt;2002&lt;/option&gt;
    &lt;option value='2001'&gt;2001&lt;/option&gt;
    &lt;option value='2000'&gt;2000&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO1&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;title&quot; size=&quot;15&quot;&gt; &amp;nbsp; &amp;nbsp;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO2&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Author&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;author1&quot; size=&quot;15&quot;&gt;
&lt;/td&gt;
&lt;td&gt;
  &lt;select name=&quot;BO3&quot;&gt;
    &lt;option value='AND'&gt;AND&lt;/option&gt;
    &lt;option value='OR'&gt;OR&lt;/option&gt;
  &lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;b&gt;Author&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
  &lt;input type=&quot;text&quot; name=&quot;author2&quot; size=&quot;15&quot;&gt;
&lt;/td&gt;
&lt;td&gt;
&amp;nbsp;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;ffill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Search&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
&lt;br&gt;** All fields are optional
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If the variable 'ffill' is not empty, display the search results</span>
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$dbh</span>      <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql1</span>     <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT * FROM publications WHERE JYear LIKE <span style="color: #000099; font-weight: bold;">\&quot;</span>$year<span style="color: #000099; font-weight: bold;">\&quot;</span> $bo1 &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql2</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql1</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;Title LIKE <span style="color: #000099; font-weight: bold;">\&quot;</span>%$title%<span style="color: #000099; font-weight: bold;">\&quot;</span> $bo2 Authors LIKE <span style="color: #000099; font-weight: bold;">\&quot;</span>%$author1%<span style="color: #000099; font-weight: bold;">\&quot;</span> $bo3 &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql3</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql2</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;Authors LIKE <span style="color: #000099; font-weight: bold;">\&quot;</span>%$author2%<span style="color: #000099; font-weight: bold;">\&quot;</span> ORDER BY JYear DESC, JName ASC, &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>      <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql3</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;JVolume DESC, JPage DESC, Title&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$query</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$nresults</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">rows</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Display the results</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$nresults</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;h3&gt;Search Results&lt;/h3&gt;
Your query matched &lt;b&gt;$nresults&lt;/b&gt; result(s)&lt;br&gt;&lt;br&gt;
&lt;table width=&quot;100%&quot; cellpadding=&quot;5&quot; cellspacing=&quot;5&quot; border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;#&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;b&gt;BibID / Title / Authors / Citation / Abstract&lt;/b&gt; 
	(Last-to-first, with Journals alphabetically sorted)&lt;/td&gt;
&lt;/tr&gt;
EOF</span>
&nbsp;
<span style="color: #0000ff;">$id</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$PubID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$BibID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Title</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Authors</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JName</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JVolume</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JYear</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JPage</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Abstract</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
  &lt;tr&gt;
  &lt;td valign=&quot;top&quot;&gt;
  $id
  &lt;/td&gt;
  &lt;td valign=&quot;top&quot;&gt;
  $BibID |
  &lt;a href=&quot;/pdf/$BibID.pdf&quot; target=&quot;_blank&quot;&gt;PDF&lt;/a&gt;&lt;br&gt;
  $Title&lt;br&gt;
  $Authors&lt;br&gt;
  &lt;i&gt;$JName&lt;/i&gt;, &lt;b&gt;$JVolume&lt;/b&gt;, $JPage ($JYear)
  &lt;br&gt;&lt;br&gt;
  &lt;p align=&quot;justify&quot;&gt;
  $Abstract
  &lt;/p&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
EOF</span>
  <span style="color: #0000ff;">$id</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;/table&gt;
EOF</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;&lt;h3&gt;Search Results&lt;/h3&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;&lt;font color=red&gt;Sorry, no records were found!&lt;/font&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close database connection</span>
<span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">#3. Admin Side: <strong>pub_entry.cgi</strong></h3>
<p>Guidelines for using this are as follows:</p>
<ol>
<li>
  <b>BibID</b></p>
<ol>
<li>Cannot be empty</li>
<li>Maximum of 15 characters</li>
<li>Must be UNIQUE</li>
<li>Cannot be changed later</li>
<li>Good way to compose this is by using first letters of authors&#8217; last names along with year<br />
      (i.e., if R. J. Smith, A. S. Young and B. L. Spring published an article in 2006, BibID would be SYS2006.<br />
      <br />
      In case of single author, use Smith2006)
    </li>
<li>If you expect to have more than one publication in a year by the same set of authors,<br />
      use SYS2006_0, SYS2006_1, and so on OR Smith2006_0, Smith2006_1, etc.</li>
<li>Required to delete/update an entry, if such a need arises</li>
</ol>
</li>
<li>
  <b>Title</b></p>
<ol>
<li>Cannot be empty</li>
<li>Maximum of 255 characters</li>
<li>Can contain some HTML tags (&lt;b&gt;, &lt;em&gt;, &lt;sup&gt;, &lt;sub&gt;, etc)</li>
<li>Use backslash ( &#92; ) to escape single-quotes ( &#8216; )</li>
</ol>
</li>
<li>
  <b>Authors</b></p>
<ol>
<li>Cannot be empty</li>
<li>Maximum of 150 characters</li>
<li>Separate authors by using &#8216;,&#8217; (comma)</li>
<li>Do not use &#8216;and&#8217;</li>
</ol>
</li>
<li>
  <b>Journal :: Name</b></p>
<ol>
<li>Cannot be empty</li>
<li>Maximum of 30 characters</li>
<li>Can contain some HTML tags (&lt;sup&gt;, &lt;sub&gt;, etc)</li>
</ol>
</li>
<li>
  <b>Journal :: Volume</b></p>
<ol>
<li>Cannot be empty</li>
<li>Must be an integer</li>
</ol>
</li>
<li>
  <b>Journal :: Year</b></p>
<ol>
<li>Cannot be empty</li>
<li>Must be an integer</li>
<li>Use all four digits to specify (like &#8217;2006&#8242; instead of &#8217;06&#8242;)</li>
</ol>
</li>
<li>
  <b>Journal :: Starting Page</b></p>
<ol>
<li>Cannot be empty</li>
<li>Must be an integer</li>
</ol>
</li>
<li>
  <b>Abstract</b></p>
<ol>
<li>Can be empty</li>
<li>Maximum of 255 characters</li>
<li>Can contain some HTML tags<br />
    (&lt;b&gt;, &lt;em&gt;, &lt;sup&gt;, &lt;sub&gt;, etc)</li>
<li>Use backslash ( &#92; ) to escape single-quotes ( &#8216; )</li>
</ol>
</li>
<li>
  <b>Journal :: PDF Version</b></p>
<ol>
<li>Cannot be empty</li>
<li>PDF document MUST have the SAME name as BibID</li>
<li>MUST be PDF (not just the filename extension)</li>
<li>Process DOES NOT check to make sure it is PDF</li>
</ol>
</li>
</ol>
<p>The code is split into two parts &#8211; default view is to just display a form. When properly submitted, it makes an entry into the database. Code for default view is below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pub_entry.cgi (PART #1)</span>
<span style="color: #666666; font-style: italic;"># CGI script to make an entry into publication</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modules being used</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">::</span><span style="color: #006600;">Carp</span> <span style="color: #000066;">qw</span> <span style="color: #009900;">&#40;</span> fatalsToBrowser <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> File<span style="color: #339933;">::</span><span style="color: #006600;">Basename</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a CGI object and retrieve information from the form</span>
<span style="color: #0000ff;">$inputform</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Assign form-values to local variables</span>
<span style="color: #0000ff;">$bibid</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;bibid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$title</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$authors</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;authors&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jname</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jname&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jvolume</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jvolume&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jyear</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jyear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jpage</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jpage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$abstract</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;abstract&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jpdfdoc</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jpdfdoc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$efill</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;efill&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'efill' is empty, then display the form</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$efill</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Entry&lt;/h2&gt;
&nbsp;
&lt;!-- Database Entry Form --&gt;
&lt;form method=&quot;POST&quot; action=&quot;./pub_entry.cgi&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;left&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;BibID&lt;/b&gt;&lt;/td&gt;
&nbsp;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;bibid&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; size=&quot;35&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Authors&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;authors&quot; size=&quot;35&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Name&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jname&quot; size=&quot;35&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Volume&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jvolume&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Year&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jyear&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Starting Page&lt;/b&gt; &amp;nbsp; &lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jpage&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Abstract&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
&lt;textarea name=&quot;abstract&quot; rows=&quot;5&quot; cols=&quot;40&quot;&gt;&lt;/textarea&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: PDF Version&lt;/b&gt; &amp;nbsp; &lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;file&quot; name=&quot;jpdfdoc&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;efill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Make An Entry&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear Values&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
&nbsp;
&lt;br clear=&quot;all&quot;&gt;
&lt;hr&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
&nbsp;
EOF</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The details regarding <a href="http://sgowtham.net/blog/2008/07/24/file-uploads-via-perl-and-cgi/" target="_blank">uploading a document via PERL &amp; CGI</a> are contained in one of my previous posts. Code for entering the above information into the database follows below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># pub_entry.cgi (PART #2)</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'efill' is not empty, then insert the data</span>
<span style="color: #666666; font-style: italic;"># into the database</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Entry&lt;/h2&gt;
&lt;hr&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$db</span>    <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql1</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;INSERT INTO publications VALUES ('', '$bibid', '$title', &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql2</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql1</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;'$authors', '$jname', '$jvolume', '$jyear', '$jpage', &quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql2</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;'$abstract')&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># PDF upload part</span>
<span style="color: #666666; font-style: italic;"># 5MB limit on the size of the document</span>
<span style="color: #0000ff;">$CGI</span><span style="color: #339933;">::</span><span style="color: #006600;">POST_MAX</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1024</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">1024</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Characters that are allowed to be part of the filename</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$safe_characters</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;a-zA-Z0-9_.-&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Update location</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$upload_location</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/var/www/html/pdf&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jpdfdoc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #0000ff;">$filename</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
 &lt;p align=&quot;justify&quot;&gt;
 There was a problem uploading the PDF
 &lt;/p&gt;
EOF</span>
 <span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Clean up the filename - remove any 'path' and split the filename into</span>
<span style="color: #666666; font-style: italic;"># basename and extension</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$name</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$path</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$extension</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> fileparse <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$filename</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'\..*'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">$extension</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Replace blank space in filename with 'underscore'</span>
<span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">tr/ /_/</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Remove any 'not safe' characters</span>
<span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/[^$safe_characters]//g</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Untaint the filename</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^([$safe_characters]+)$/</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #0000ff;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Filename contains invalid characters&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$upload_filehandle</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">upload</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jpdfdoc&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span> UPLOADFILE<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$upload_location/$filename&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">binmode</span> UPLOADFILE<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">&lt;</span><span style="color: #0000ff;">$upload_filehandle</span><span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000066;">print</span> UPLOADFILE<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">close</span> UPLOADFILE<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;p align=&quot;justify&quot;&gt;
Data was successfully entered into the database. Click
&lt;a href=&quot;./pub_entry.cgi&quot;&gt;here&lt;/a&gt; to make another entry.
&lt;/p&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close Database Connection</span>
<span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">#4. Admin Side: <strong>pub_update.cgi</strong> and <strong>pub_updated.cgi</strong></h3>
<p>Often times, it becomes necessary to update an entry (author names, citation, abstract, etc.) and to do so, the appropriate entry must be retrieved from the database. Code for <strong>pub_update.cgi</strong> follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pub_update.cgi</span>
<span style="color: #666666; font-style: italic;"># CGI script to retrieve a publication from the database</span>
<span style="color: #666666; font-style: italic;"># for update</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modules being used</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a CGI object and retrieve information from the form</span>
<span style="color: #0000ff;">$inputform</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Assign form-values to local variables</span>
<span style="color: #0000ff;">$bibid</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;bibid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$rfill</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rfill&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'rfill' is empty, then display the form</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rfill</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Retrieve&lt;/h2&gt;
&lt;hr&gt;
&nbsp;
&lt;!-- Retrieval For Update Form --&gt;
&lt;form method=&quot;POST&quot; action=&quot;./dbretrieve.cgi&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;left&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;BibID&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;bibid&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;rfill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Retrieve An Entry&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
&nbsp;
&lt;br clear=&quot;all&quot;&gt;
&lt;hr&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'rfill' is not empty, retrieve data from the database</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Retrieve&lt;/h2&gt;
&lt;hr&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$db</span>    <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>   <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT * FROM publications WHERE BibID='$bibid' LIMIT 1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$PubID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$BibID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Title</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Authors</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JName</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JVolume</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JYear</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$JPage</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$Abstract</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&nbsp;
&lt;!-- Database Entry Form --&gt;
&lt;form method=&quot;POST&quot; action=&quot;./pub_updated.cgi&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;left&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25%&quot;&gt;&lt;b&gt;BibID&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;$BibID&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; size=&quot;35&quot; value='$Title'&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Authors&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;authors&quot; size=&quot;35&quot; value='$Authors'&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Name&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jname&quot; size=&quot;35&quot; value='$JName'&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Volume&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jvolume&quot; size=&quot;15&quot; value='$JVolume'&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Year&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jyear&quot; size=&quot;15&quot; value='$JYear'&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Starting Page&lt;/b&gt; &amp;nbsp; &lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;jpage&quot; size=&quot;15&quot; value='$JPage'&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Journal :: Abstract&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;
&lt;blockquote&gt;
$Abstract
&lt;/blockquote&gt;
&lt;textarea name=&quot;abstract&quot; rows=&quot;5&quot; cols=&quot;40&quot; value='$Abstract'&gt;
Type in new abstract OR copy the existing one from above&lt;/textarea&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;bibid&quot; value='$bibid'&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;rfill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Update An Entry&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear Values&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
EOF</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close Database Connection</span>
<span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><strong>pub_update.cgi</strong> takes all the information and passes it over to <strong>pub_updated.cgi</strong>, which updates the record. Code for <strong>pub_updated.cgi</strong> follows below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pub_updated.cgi</span>
<span style="color: #666666; font-style: italic;"># CGI script to update an entry in the database</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modules being used</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a CGI object and retrieve information from the form</span>
<span style="color: #0000ff;">$inputform</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Assign form-values to local variables</span>
<span style="color: #0000ff;">$bibid</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;bibid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$title</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$authors</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;authors&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jname</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jname&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jvolume</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jvolume&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jyear</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jyear&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$jpage</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;jpage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$abstract</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;abstract&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Retrieve&lt;/h2&gt;
&lt;hr&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$db</span>    <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql1</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;UPDATE publications SET Title='$title',Authors='$authors',&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql2</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql1</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;JName='$jname',JVolume='$jvolume',JYear='$jyear',&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sql2</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot;JPage='$jpage',Abstract='$abstract' WHERE BibID='$bibid' &quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;p align=&quot;justify&quot;&gt;
Data was successfully updated in the database. Click
&lt;a href=&quot;./pub_update.cgi&quot;&gt;here&lt;/a&gt; to update another entry.
&lt;/p&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close Database Connection</span>
<span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">#5. Admin Side: <strong>pub_delete.cgi</strong></h3>
<p>Seldom it becomes necessary to delete an entry from the database (a reference article entered in by mistake as a publication, etc.) and the code for <strong>pub_delete.cgi</strong> follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pub_delete.cgi</span>
<span style="color: #666666; font-style: italic;"># CGI script to delete an entry from the database</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modules being used</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make a CGI object and retrieve information from the form</span>
<span style="color: #0000ff;">$inputform</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">header</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Assign form-values to local variables</span>
<span style="color: #0000ff;">$bibid</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;bibid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$dfill</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$inputform</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;dfill&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'dfill' is empty, then display the form</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$dfill</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Delete&lt;/h2&gt;
&lt;hr&gt;
&nbsp;
&lt;!-- Database Deletion Form --&gt;
&lt;form method=&quot;POST&quot; action=&quot;./pub_delete.cgi&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;3&quot; align=&quot;left&quot;&gt;
&nbsp;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;BibID&lt;/b&gt;&lt;/td&gt;
&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;bibid&quot; size=&quot;15&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;tr&gt;
&lt;td colspan=&quot;6&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;dfill&quot; value=&quot;filled&quot; size=&quot;15&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Delete An Entry&quot;&gt;
  &lt;input type=&quot;reset&quot;  value=&quot;Clear&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&nbsp;
&lt;/table&gt;
&lt;/form&gt;
&nbsp;
&lt;br clear=&quot;all&quot;&gt;
&lt;hr&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If variable 'dfill' is not empty, then delete an entry</span>
<span style="color: #666666; font-style: italic;"># from the database</span>
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;!-- www.w3c.org standard --&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&nbsp;
&lt;!-- HTML begins --&gt;
&lt;html&gt;
&nbsp;
&lt;!-- HEAD section --&gt;
&lt;head&gt;
&nbsp;
&lt;!-- TITLE section --&gt;
&lt;title&gt;
Your Research Group, Your Academic Institution
&lt;/title&gt;
&nbsp;
&lt;/head&gt;
&nbsp;
&lt;!-- BODY section --&gt;
&lt;body&gt;
&nbsp;
&lt;!-- Group Header --&gt;
&lt;h1&gt;YOUR GROUP NAME&lt;/h1&gt;
&nbsp;
&lt;h2&gt;Publications :: Database Management :: Delete&lt;/h2&gt;
&lt;hr&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Connect to the database and perform the SQL query</span>
<span style="color: #0000ff;">$db</span>    <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:mysql:einstein_research:localhost'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'einstein_web'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'PASSWORD'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sql</span>   <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;DELETE FROM publications WHERE BibID='$bibid' LIMIT 1&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Error&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt; &quot;EOF&quot;;
&lt;p align=&quot;justify&quot;&gt;
Entry was successfully deleted from the database. Click
&lt;a href=&quot;./pub_delete.cgi&quot;&gt;here&lt;/a&gt; to delete another entry.
&lt;/p&gt;
&nbsp;
&lt;!-- Body ends --&gt;
&lt;/body&gt;
&nbsp;
&lt;!-- HTML ends --&gt;
&lt;/html&gt;
EOF</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close Database Connection</span>
<span style="color: #0000ff;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">#6. Admin Side: Restricting Access To Admin Interface</h3>
<p>There are some ways of achieving this &#8211; to prevent unauthorized personnel from messing with databases and files. </p>
<ol>
<li>Password protect the admin folder &#8211; allow only a certain user from any machine</li>
<li>IP address/Hostname based restriction &#8211; allow any user (preferably a group member) to access the admin interface from certain machine(s).</li>
<li>Combination of #1 &amp; #2 &#8211; allow only certain users from certain machines.</li>
</ol>
<p>A simple Google!ing for <strong>password protection .htaccess .htpasswd</strong> should result in a good number of decent documents. But do check/discuss your approach with your systems administrator(s) &#8211; to make sure that it can be applied, is feasible and less mis-usable under existing circumstances.</p>
<p><br clear="all"></p>
<h3 class="blog">Screenshots</h3>
<p>The screenshots below were generated after incorporating the style sheets (<a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" target="_blank">CSS</a>) that are in-line with Michigan Tech theme. The code in the above sections, however, results in very plain, bare-bone HTML pages.  With a basic, working knowledge of CSS, it should not be too difficult to spice up the appearance:</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/publication_0.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0"></p>
<p class="bpcaption">Publications &#8211; Default View</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/publication_1.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0"></p>
<p class="bpcaption">Publications &#8211; When a query is performed</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/pub_entry.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0"></p>
<p class="bpcaption">Making a new entry</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/pub_delete.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0"></p>
<p class="bpcaption">Deleting an entry</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/pub_update_0.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0"></p>
<p class="bpcaption">Retrieval for update</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080725/pub_update_1.png" alt="Storing And Querying Information with PERL-MySQL" title="Storing And Querying Information with PERL-MySQL" border="0" align="center"></p>
<p class="bpcaption">Updating an entry</p>
<p><br clear="all"></p>
<h3 class="blog">Demonstration</h3>
<p>Live demo of this code, only the <strong>publications.cgi</strong>, is <a href="http://www.phy.mtu.edu/pandey/publications.cgi" target="_blank">here</a>. Others, as can be expected, are hidden in a secure folder.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2008%2F07%2F25%2Fstoring-and-querying-information-with-perl-mysql%2F&amp;title=Storing%20And%20Querying%20Information%20with%20PERL-MySQL" id="wpa2a_20"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2008/07/25/storing-and-querying-information-with-perl-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Few Days In Paradise</title>
		<link>http://sgowtham.net/blog/2008/05/05/a-few-days-in-paradise/</link>
		<comments>http://sgowtham.net/blog/2008/05/05/a-few-days-in-paradise/#comments</comments>
		<pubDate>Tue, 06 May 2008 04:41:29 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[AuTrain]]></category>
		<category><![CDATA[Houghton]]></category>
		<category><![CDATA[Michigan]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Munising]]></category>
		<category><![CDATA[USA]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=309</guid>
		<description><![CDATA[It&#8217;s hard to believe &#8211; at least for me &#8211; that it has already been THREE months since I moved to New Jersey, and more importantly, it has been an equally long time since I last tasted beer! With many of my friends graduating (or should I say gradumatating?) from Michigan Tech this Spring, plans [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe &#8211; at least for me &#8211; that it has already been THREE months since I moved to New Jersey, and more importantly, it has been an equally long time since I last tasted beer! With many of my friends graduating (or should I say <em>gradumatating</em>?) from Michigan Tech this Spring, plans were made (about three months ago) to visit Houghton &#8211; probably to see them all in one place at one time for the last time.</p>
<p><br clear="all"></p>
<h3 class="blog">Red Bank, NJ &rarr; Houghton, MI</h3>
<p>It would be an understatement if I said I was excited for this trip &#8211; so much so that I could not sleep the entire previous night. Also, I had to abandon any thoughts of driving up amidst such excitement &#8211; to keep myself (and other fellas on road) safe. Cutting the long story short, both segments of the journey, Newark &rarr; Minneapolis/St. Paul and Minneapolis/St. Paul &rarr; Houghton, were pretty smooth and on time. Fellow travelers and the flight attendants probably felt the brunt of much my yapping but they seemed to understand my excitement &#8211; so, it was all ok <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><br clear="all"></p>
<h3 class="blog">The Paradise</h3>
<p>I can&#8217;t seem to express nor find words to express the excitement of just being here, amidst so many people &#8211; that have helped make my graduate student days very very memorable. Naming each one of them is beyond the scope this post but trust me, I appreciate anything and everything they have done for me. To sum up this trip (thanks to my buddy <a href="http://photos.kyleschneider.net/" target="_blank">Kyle</a> for putting me up and lending his tripod):</p>
<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20080505/Paradise.jpg" title="Paradise" alt="Paradise" border="0"></p>
<p><br clear="all"><br />
Rest of the pictures are here: <a href="http://sgowtham.net/gallery/20080503_0/" target="_blank">ROTC Commissioning</a> | <a href="http://sgowtham.net/gallery/20080503_1/" target="_blank">Commencement</a></p>
<p>As much as I enjoyed being there, hanging out with friends, and as much as I might have painted a picture of myself (in recent years) as the cold-hearted, emotionless animal, leaving the town (I don&#8217;t yet know when I will return next) was probably the toughest to deal with. I was under the impression that it wouldn&#8217;t be as difficult as it was the first time but believe me, my impression was completely wrong. And I am not alone on this boat either &#8211; quite many of my friends are experiencing the same inexplicable torturous feeling that surfaces while leave this town.</p>
<p><br clear="all"></p>
<h3 class="blog">Houghton, MI &rarr; Red Bank, NJ</h3>
<p>Amidst the aforementioned feeling, it wasn&#8217;t easy coming back but the flights were pretty smooth and on time. I feel pretty relaxed and my batteries are well charged up for the daily grind of next few months <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2008%2F05%2F05%2Fa-few-days-in-paradise%2F&amp;title=A%20Few%20Days%20In%20Paradise" id="wpa2a_22"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2008/05/05/a-few-days-in-paradise/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PINE Is Just Fine!</title>
		<link>http://sgowtham.net/blog/2007/02/26/pine-is-just-fine/</link>
		<comments>http://sgowtham.net/blog/2007/02/26/pine-is-just-fine/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 03:07:38 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[PINE]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2007/02/26/pine-is-just-fine/</guid>
		<description><![CDATA[Disclaimer Instructions given in this page are what I used to configure my Sony Vaio VGN-S360 notebook and DELL Dimension 3000 desktop. These may very well be applicable to your computer, of other brand/model. However, note that you are using these instructions at your very own risk and this website, sgowtham.net, is not responsible for [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">Disclaimer</h3>
<p>Instructions given in this page are what I used to configure my <b>Sony Vaio VGN-S360</b> notebook and <b>DELL Dimension 3000</b> desktop. These may very well be applicable to your computer, of other brand/model. However, note that you are using these instructions at your very own risk and this website, <a href="http://sgowtham.net/">sgowtham.net</a>, is not responsible for any/all damage caused to your property, intellectual or otherwise. Additionally, using PINE to access MTU Email and certain features (like accessing LDAP) automatically binds you to Internet/Email usage policies of Michigan Technological University. You are advised to read this <a href="http://email.mtu.edu/docs/public/info/emailabuse.html" target="_blank">document</a>.</p>
<p><br clear="all"></p>
<h3 class="blog">What is PINE, etc.</h3>
<p><b>PINE</b>&#174; &#8211; a <b>P</b>rogram for <b>I</b>nternet <b>N</b>ews &amp; <b>E</b>mail &#8211; is a tool for reading, sending, and managing electronic messages. PINE was developed by Computing &amp; Communications at the <a href="http://www.washington.edu/" target="_blank">University of Washington</a>. Though originally designed for inexperienced email users, PINE has evolved to support many advanced features, and an ever-growing number of configuration and personal-preference options. PINE is available for Unix as well as for personal computers running a Microsoft operating system (PC-PINE). General User Guide is <a href="http://www.washington.edu/pine/user-guide"  target="_blank">here</a> and this article discusses the following :</p>
<ol>
<li class="manual">Getting PINE and installing it (<b>Linux</b>)</li>
<li class="manual">Configuring it :
<ol>
<li class="manual">Making it work from off-campus, especially with Charter Communications connection</li>
<li class="manual">Adding MTU Address Book (LDAP) search feature</li>
</ol>
</li>
<li class="manual">Generating a GPG Public-Private Key pair (<font color="#ff0000" size="1">Not in detail</font>)</li>
<li class="manual">Embedding Digital Signature/Message Encryption feature</li>
<li class="manual">Setting up multiple roles (different <tt>From</tt> addresses; <font color="#ff0000" size="1">Not in detail</font>)</li>
<li class="manual">Using it from commandline (<font color="#ff0000" size="1">Not in detail</font>)</li>
<li class="manual">Entry without password? (<font color="#ff0000" size="1">Not in detail</font>)</li>
</ol>
<p><br clear="all"></p>
<h3 class="blog">1. Installation</h3>
<ol>
<li class="manual">Visit <a href="http://www.washington.edu/pine/getpine/linux.html" target="_blank">PINE for Linux</a> site and download the latest version of appropriate package. I recommend getting the source package and compiling it yourself. Moreover, pre-compiled <b>rpm</b> does not have the <b>ssl</b> feature which is <font color="red">required</font> for accessing MTU mail from off-campus.</li>
<li class="manual">Compile the source (as <font color="red">root</font>) by executing the command

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpmbuild <span style="color: #660033;">--rebuild</span> pine-4.6x-<span style="color: #000000;">1</span>.i386.src.rpm <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> pine-4.6x-<span style="color: #000000;">1</span>.rpmbuild.log</pre></div></div>

</li>
<li class="manual">Get into <b>/usr/src/redhat/RPMS/i386/</b> and run

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-ivh</span> pine4.6x-<span style="color: #000000;">1</span>.i386.rpm</pre></div></div>

<p>   and</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rpm <span style="color: #660033;">-ivh</span> pine-debuginfo-4.6x-<span style="color: #000000;">1</span>.i386.rpm</pre></div></div>

<p>   to install PINE.</li>
</ol>
<p><br clear="all"></p>
<h3 class="blog">2 Configuring PINE</h3>
<h4>2.1 Making it work from off-campus</h4>
<p>Tips and tricks suggested by <a href="http://www.cec.mtu.edu" target="_blank">CEC</a> personnel in MTU, have been of great help in this step (especially PORT 2525 stuff) when I dealt with PINE 4.61 &#8211; I have used them again and included some more in this version. You can configure either by choosing <b>(M) MAIN MENU</b>  &raquo; <b>(S) SETUP</b> &raquo; <b>(C) Config</b>, or edit <b>.pinerc</b> file,  located probably in your <b>$HOME</b> directory. If you choose to use the second option, here is my <a href="http://sgowtham.net/tools/scripts/pinerc" target="_blank">.pinerc</a> file. Use it as reference, if you like.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="dot" style="font-family:monospace;">personal<span style="color: #66cc66;">-</span>name<span style="color: #66cc66;">=</span>Your Name
&nbsp;
user<span style="color: #66cc66;">-</span>domain<span style="color: #66cc66;">=</span>mtu.edu
&nbsp;
smtp<span style="color: #66cc66;">-</span>server<span style="color: #66cc66;">=</span>email.mtu.edu:<span style="color: #cc66cc;">2525</span><span style="color: #66cc66;">/</span>tls<span style="color: #66cc66;">/</span>user<span style="color: #66cc66;">=</span>your<span style="color: #66cc66;">-</span>user<span style="color: #66cc66;">-</span><span style="color: #000066;">id</span>
<span style="color: #339933;"># use Port 2525 for outgoing mails since Charter blocks Port 25</span>
&nbsp;
inbox<span style="color: #66cc66;">-</span>path<span style="color: #66cc66;">=</span><span style="color: #66cc66;">&#123;</span>email.mtu.edu<span style="color: #66cc66;">/</span>ssl<span style="color: #66cc66;">/</span>user<span style="color: #66cc66;">=</span>your<span style="color: #66cc66;">-</span>user<span style="color: #66cc66;">-</span><span style="color: #000066;">id</span><span style="color: #66cc66;">&#125;</span>INBOX
&nbsp;
folder<span style="color: #66cc66;">-</span>collections<span style="color: #66cc66;">=</span><span style="color: #66cc66;">&#123;</span>email.mtu.edu<span style="color: #66cc66;">/</span>ssl<span style="color: #66cc66;">/</span>user<span style="color: #66cc66;">=</span>your<span style="color: #66cc66;">-</span>user<span style="color: #66cc66;">-</span><span style="color: #000066;">id</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #339933;"># This is to prevent messages from being stored locally on your computer</span></pre></td></tr></table></div>

<p>That&#8217;s it! However, PINE will prompt for your password before sending the first message but it will won&#8217;t prompt again during the rest of the session.  Messages read/sent out will <font color="red">not</font> be saved on your local machine.</p>
<h4>2.2 Adding MTU Address Book (LDAP) search feature</h4>
<p>Thanks again to CEC personnel, I could configure PINE to look-up the  MTU Address Book while composing messages. Procedure is quite simple and is as follows :</p>
<ol>
<li class="manual">Start PINE and <b>(M) MAIN MENU</b> &raquo; <b>(S) SETUP</b> &raquo; <b>SETUP</b> &raquo; <b>(D) Directory</b> &raquo; <b>(A) Add Dir</b> to add a new directory server.</li>
<li class="manual">The cursor should be on the first option, <tt>ldap-server</tt>. Press <b>Enter</b> and enter the following :
<p>   <tt>ldap.mtu.edu</tt></li>
<li class="manual">For the next option, <tt>search-base</tt>, enter
<p>   <tt>dc=mtu,dc=edu</tt></li>
<li class="manual">Leave the third option as it is and for the last option, <tt>nickname</tt>, choose a name by which you want to recognize this directory server. I chose <tt>MTU Address Look Up</tt></li>
<li class="manual">Under the <tt>Features</tt> option,  check <tt>use-implicitly-from-composer</tt> so that PINE will look-up the MTU Address Book when you type just a <b>user-id</b> while composing a message.</li>
<li class="manual">Under the <tt>search-type</tt> option, you may choose to go with the default option or choose something that suits you. With the default option (<tt>sur-or-given-or-name-or-email</tt>), PINE will return all the results that matches the surname associated with the <b>user-id</b> and gives you the option to choose the one you want.</li>
</ol>
<p>If you wish to save the search results to your local <b>.addressbook</b>, you may do so by selecting <tt>ldap-result-to-addrbook-add</tt> under <tt>Address Book Preferences</tt> in <b>(M) MAIN MENU</b> &raquo; <b>SETUP</b> &raquo; <b>(C) Config</b> </p>
<p>Steps (1)-(5) used to add MTU Address Book Search feature to PINE can also be achieved by editing your <b>$HOME/.pinerc</b> file. Search for the string <tt class="preinline">ldap-servers</tt> in my <a href="http://sgowtham.net/blog/files/20070226/pinerc" target="_blank">.pinerc</a> file and observe that line.</p>
<p><br clear="all"></p>
<h3 class="blog">3. Generating GPG Public-Private Key pair</h3>
<p>There are several methods (built-in <tt>gpg</tt> command is one of them) to generate Public-Private Key pair and lot of online documents to help you out. Generate a pair for yourself using a method that&#8217;s convenient to you.</p>
<p><br clear="all"></p>
<h3 class="blog">4. Embedding Digital Signature / Message Encryption feature into PINE</h3>
<h4>Method One</h4>
<ol>
<li class="manual">Download these scripts to <b>$HOME/.gnupg</b> folder
<p>   <a href="http://sgowtham.net/blog/files/20070226/verify" target="_blank">verify</a> | <a href="http://sgowtham.net/blog/files/20070226/sign" target="_blank">sign</a> | <a href="http://sgowtham.net/blog/files/20070226/encrypt" target="_blank">encrypt</a></p>
<p>   These are just <tt>gpg</tt> command with different options.</li>
<li class="manual">In the <b>.pinerc</b>, search for <tt class="preinline">display-filters</tt> and make that line look as follows:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="dot" style="font-family:monospace;">display<span style="color: #66cc66;">-</span>filters<span style="color: #66cc66;">=</span>_LEADING<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;-----BEGIN PGP&quot;</span><span style="color: #66cc66;">&#41;</span>_ $HOME<span style="color: #66cc66;">/</span>.gnupg<span style="color: #66cc66;">/</span>verify</pre></td></tr></table></div>

</li>
<li class="manual">In the <b>.pinerc</b>, search for <tt class="preinline">sending-filters</tt> and make that line look as follows:
<pre lang="dot line="1">
sending-filters=$HOME/.gnupg/sign
$HOME/.gnupg/encrypt
</pre>
</li>
</ol>
<h4>Method Two (One which I am currently using)</h4>
<ol>
<li class="manual">Find out where <tt>gpg</tt> command is stored and create the following symbolic links in <b>$HOME/.gnupg</b> folder.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gpg ~<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gverify
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gpg ~<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gsign
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gpg ~<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gencrypt</pre></div></div>

</li>
<li class="manual">In the <b>.pinerc</b>, search for <tt class="preinline">display-filters</tt> and make that line look as follows:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="dot" style="font-family:monospace;">display<span style="color: #66cc66;">-</span>filters<span style="color: #66cc66;">=</span>_LEADING<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;-----BEGIN &quot;</span><span style="color: #66cc66;">&#41;</span>_ <span style="color: #66cc66;">~/</span>.gnupg<span style="color: #66cc66;">/</span>gverify</pre></td></tr></table></div>

</li>
<li class="manual">In the <b>.pinerc</b>, search for <tt class="preinline">sending-filters</tt> and make that line look as follows:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="dot" style="font-family:monospace;">sending<span style="color: #66cc66;">-</span>filters<span style="color: #66cc66;">=~/</span>.gnupg<span style="color: #66cc66;">/</span>gsign <span style="color: #66cc66;">--</span>clearsign,
<span style="color: #66cc66;">~/</span>.gnupg<span style="color: #66cc66;">/</span>gencrypt <span style="color: #66cc66;">-</span>eas <span style="color: #66cc66;">-</span>r _RECIPIENTS_</pre></td></tr></table></div>

</li>
</ol>
<p>You are all set &#8211; when you are done writing a message and press <tt>Ctrl+X</tt> to send it, PINE offers options to send it <b>unfiltered</b> or <b>sign</b> and/or <b>encrypt</b>. You can switch between these options using <tt>Ctrl+N</tt> and <tt>Ctrl+P</tt>. If you choose not to send it as  <b>unfiltered</b>, you will be prompted to enter the <b>passphrase</b>. When you receive a message encrypted using your Public Key, PINE will automatically decrypt it for you.</p>
<p><br clear="all"></p>
<h3 class="blog">5. Multiple Roles (Different From Addresses)</h3>
<p>You can read/learn about it <a href="http://staff.washington.edu/chappa/pine/pine-info/roles/" target="_blank">here</a>. I have used the instructions give there to setup four different <tt>From</tt> addresses with just one instance of PINE.</p>
<p><br clear="all"></p>
<h3 class="blog">6. Using PINE from command-line</h3>
<p>You can read/learn about it <a href="http://staff.washington.edu/chappa/pine/info/outgoing.html" target="_blank">here</a>. I use this feature, every once in a while, when <tt>mail</tt> command decides to trouble me.</p>
<p><br clear="all"></p>
<h3 class="blog">7. Entry without password</h3>
<p>Needless to say that this feature should be enabled (preferably) iff (iff = if and only if, a mathematical notation) PINE is being used in a single user environment and as to how to do it, instructions are <a href="http://staff.washington.edu/chappa/pine/pine-info/build/" target="_blank">here</a> (under <em>Defining a Password File</em> section).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2007%2F02%2F26%2Fpine-is-just-fine%2F&amp;title=PINE%20Is%20Just%20Fine%21" id="wpa2a_24"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2007/02/26/pine-is-just-fine/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Winter In Yooper Land</title>
		<link>http://sgowtham.net/blog/2006/12/23/winter-in-yooper-land/</link>
		<comments>http://sgowtham.net/blog/2006/12/23/winter-in-yooper-land/#comments</comments>
		<pubDate>Sat, 23 Dec 2006 23:01:39 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[EagleRiver]]></category>
		<category><![CDATA[Hancock]]></category>
		<category><![CDATA[Houghton]]></category>
		<category><![CDATA[Michigan]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[USA]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2006/12/23/winter-in-yooper-land/</guid>
		<description><![CDATA[I am not so sure if you read my previous entry. If you did, you know where I have been. If you did not, please be notified that I have been lost in compilation&#8230; Colloquially speaking, I did not see any light anywhere in the tunnel and instead of resorting to some bar (and alcohol), [...]]]></description>
			<content:encoded><![CDATA[<p>I am not so sure if you read my <a href="http://sgowtham.net/blog/2006/12/23/lost-in-compilation/" target="_blank">previous entry</a>. If you did, you know where I have been. If you did not, please be notified that I have been <em>lost in compilation</em>&#8230; Colloquially speaking, I did not see any light anywhere in the tunnel and instead of resorting to some bar (and alcohol), /me decided to get <em>high</em> on a semester ending warm winter Friday evening. NOOOO, I am not into drugs &#8211; reference here is to the <em>high</em> one gets by watching a good game (or two). Watching these live sports events (mostly basketball, sometimes football too) has become a nice addition to my lifestyle and hopefully it will stick with me for times to come. Both our teams (women and men) played very well to beat U Minnesota (Duluth) last night and presented us (the fans) with a very delightful Christmas gift. Couple pictures, one from each game, are below.</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_4682.jpg" title="Michigan Tech Basketball" alt="Michigan Tech Basketball" border="0"></p>
<p class="bpcaption">#2 making a jump shot for a 2-pointer.</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_4916.jpg" title="Michigan Tech Basketball" alt="Michigan Tech Basketball" border="0"></p>
<p class="bpcaption">#4 had the game of his career at Tech</p>
<p><br clear="all"><br />
Sometime between I went into the Michigan Tech Gym (not to work out, but to watch these games) and came out of it, somebody had gone out and had convinced winter &#8211; to come into the <a href="http://en.wikipedia.org/wiki/Upper_Peninsula_of_Michigan" target="_blank">Yooper</a> land. And by the time I woke up this morning, there was white stuff everywhere. I still wasn&#8217;t getting anywhere with the compilation process and so, after a short stop at <em>Victoria&#8217;s Kitchen</em>, I headed off to the northern <a href="http://en.wikipedia.org/wiki/Keweenaw_Peninsula" target="_blank">Keweenaw Peninsula</a> to check out the frest stock of snow <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5009.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Somewhere in the vicinity of mining relics on Quincy Hill</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5014.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">In the vicinity of mining relics on Quincy Hill</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5023.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">In the vicinity of mining relics on Quincy Hill</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5028.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Snow covered trees along US-41</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5052.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Camp Ground along 7 Mile Point Road &#8211; locked entrance didn&#8217;t stop me from getting in&#8230;</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5049.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Wavy L. Superior on a windy day &#8230; 7 Mile Point Road</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5063.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">In the sideyard of Sand Hills Light House &#8230; 5 Mile Point Road</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5081.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Eagle River Falls &#8211; off of M26</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5089.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Eagle River Community Center &#8211; shot from Lake Shore Drive Bridge</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061223/dsc_5109.jpg" title="Winter In Michigan's UP" alt="Winter In Michigan's UP" border="0"></p>
<p class="bpcaption">Semi-frozen Eagle River with L. Superior in the background</p>
<p>Apparently, weather got warmer as time went by but like you have seen in the above pics (rest of them are <a href="http://sgowtham.net/gallery/USA/NorthCentral/2006/Michigan/Winter/" target="_blank">here</a>), things were still quite pretty. This is the second time this season it has snowed so much in such a short time &#8211; but unlike <a href="http://sgowtham.net/blog/2006/10/12/people-its-here/" target="_blank">first time</a>, we only hope this one will stay for a while&#8230;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2006%2F12%2F23%2Fwinter-in-yooper-land%2F&amp;title=Winter%20In%20Yooper%20Land" id="wpa2a_26"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2006/12/23/winter-in-yooper-land/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Coming Home</title>
		<link>http://sgowtham.net/blog/2006/10/04/coming-home/</link>
		<comments>http://sgowtham.net/blog/2006/10/04/coming-home/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 02:41:13 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2006/10/04/coming-home/</guid>
		<description><![CDATA[Well, for about a week since I arrived in Houghton, my body continued to be in some weird timezone but having returned in the Home Coming week and Fall foliage about to peak, I had quite many stuff to entertain myself. After properly unpacking my stuff (&#38; other related work) and taking care of some [...]]]></description>
			<content:encoded><![CDATA[<p>Well, for about a week since I arrived in Houghton, my body continued to be in some weird timezone but having returned in the <em>Home Coming</em> week and <em>Fall</em> foliage about to peak, I had quite many stuff to entertain myself. After properly unpacking my stuff (&amp; other related work) and taking care of some pending-research-related work (about a manuscript we had submitted to <em>Chem. Phys. Lett.</em>, etc),  I went to the Western part of Upper Michigan with Dr. Orlando. The drive/ride had its anxious moments (no, not accidents) as rain &amp; Sunshine continued their <em>Hide n&#8217; Seek</em> along our trip to Porcupine Mountains&#8230;. Well, colors are quite pretty and the range of colors makes photography very hard to resist&#8230; Without further ado, here are some pictures I shot (many with Nikon 70-200mm VR lens):</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_9998.jpg" title="M26" alt="M26" border="0"></p>
<p class="bpcaption">Fall foliage along M26</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0053.jpg" title="Porcupine Mountains" alt="Porcupine Mountains" border="0"></p>
<p class="bpcaption">Porcupine Mountains</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0041.jpg" title="Porcupine Mountains" alt="Porcupine Mountains" border="0"></p>
<p class="bpcaption"><em>Lake of Clouds</em>, Porcupine Mountains</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0100.jpg" title="Porcupine Mountains" alt="Porcupine Mountains" border="0"></p>
<p class="bpcaption">M107, near Porcupine Mountains</p>
<p>Contrary to my last visit, Lake Superior was its quietest &#8211; nearly optically-flat surface all along the shore and the weather was a bit too chilly (guess it&#8217;s a trade off: need colors? get cold weather too&#8230;) Colors, needless to mention &#8211; as far as my eyesight could take. Overall, it was quite a nice trip &#8211; though I would have loved to do the <em>Lake Superior Circle Tour</em> &#8211; may be some day, hopefully&#8230;.</p>
<p>After a good-night&#8217;s rest, I woke to the day after Houghton&#8217;s <em>Hobo Parade</em> &#8211; for the fourth successive year, I missed it, but Kyle shot some nicer <a href="http://blog.aragirn.net/2006/10/05/michigan-tech-hobo-parade/" target="_blank">pictures</a>&#8230;I wandered about a bit and managed to get some left-over shots of that parade&#8230; </p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0436.jpg" title="Remnants of Hobo Parade" alt="Remnants of Hobo Parade" border="0"></p>
<p class="bpcaption">Remnants of Hobo Parade</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0438.jpg" title="Remnants of Hobo Parade" alt="Remnants of Hobo Parade" border="0"></p>
<p class="bpcaption">Remnants of Hobo Parade</p>
<p>It was <em>Home Coming Weekend</em> and Tech was facing off Hillsdale in GLIAC Football. /me went to the game, met lot of friends and I fought hard (no, no&#8230; I *shot* hard with my camera) to make sure that Tech won its first game of the season &#8211; a pretty close one at that. If only I was allowed to shoot from the sidelines, I would have gotten better pictures. And this makes me seriously think about getting a *fake press ID* for myself&#8230;</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0106.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Sherman Field, Michigan Tech</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0135.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Michigan Tech Pep Band in Hobo Outlook</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0152.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Die Hard Tech Fans</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0163.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Michigan Tech Huskies</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0266.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Huskies In Action against Hillsdale Chargers</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0217.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Huskies In Action against Hillsdale Chargers</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0291.jpg" title="Home Coming Game" alt="Home Coming Game" border="0"></p>
<p class="bpcaption">Huskies In Action against Hillsdale Chargers</p>
<p>Someday during the first part the new week, I squeezed sometime to shoot some more pictures &#8211; Houghton&#8217;s Cemetery, Sunset in McLain State Park, and such.</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0432.jpg" title="Houghton Cemetery" alt="Houghton Cemetery" border="0"></p>
<p class="bpcaption">Houghton Cemetery</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0496.jpg" title="Light House near Breakers" alt="Light House near Breakers" border="0"></p>
<p class="bpcaption">Light House near Breakers</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0610.jpg" title="McLain State Park" alt="McLain State Park" border="0"></p>
<p class="bpcaption">McLain State Park</p>
<p><img class="framed" src="http://sgowtham.net/blog/files/20061004/dsc_0501.jpg" title="McLain State Park" alt="McLain State Park" border="0"></p>
<p class="bpcaption">Sunset @ McLain State Park</p>
<p>Guess, we have just handful of days left before <em>Fall</em> ends and the <em>looooooooong</em> season starts &#8211; few of my friends have been planning something for the upcoming weekend. And if snow decides to make an early appearance, you can expect a variety of pictures in my next entry&#8230;.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2006%2F10%2F04%2Fcoming-home%2F&amp;title=Coming%20Home" id="wpa2a_28"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2006/10/04/coming-home/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>DAPCEP IT @ Michigan Tech</title>
		<link>http://sgowtham.net/blog/2006/06/24/dapcep-it-michigan-tech/</link>
		<comments>http://sgowtham.net/blog/2006/06/24/dapcep-it-michigan-tech/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 14:00:35 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[Houghton]]></category>
		<category><![CDATA[Michigan]]></category>
		<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[USA]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2006/06/24/dapcep-it-michigan-tech/</guid>
		<description><![CDATA[As many of my friends have been asking me recently, How did I get involved this thing?. Cutting the long story short, couple of people who organized this workshop are very good friends of mine and we happened to have similar interests. Karen S and Eli had spent numerous hours/days in designing the syllabus, and [...]]]></description>
			<content:encoded><![CDATA[<p>As many of my friends have been asking me recently, <em>How did I get involved this thing?</em>. Cutting the long story short, couple of people who organized this workshop are very good friends of mine and we happened to have similar interests. <a href="http://www.hu.mtu.edu/~klspring/" target="_blank">Karen S</a> and <a href="http://phy.mtu.edu/~ekochsho" target="_blank">Eli</a> had spent numerous hours/days in designing the syllabus, and we had few hour-long meetings discussing how to present what we wanted to present. After (and amidst) some anticipation and anxiety, this <a href="http://www.dapcep.org" target="_blank">DAPCEP</a> IT (Detroit Area Pre-College Engineering Program) workshop started off last Sunday with a brief orientation for the participants (10 high-schoolers and their teachers). Slide shows shown during this orientation showed them the layout of the university as well as an insight into local history.</p>
<p>Week started off on a rather slow note but since we knew it would, we started off the workshop by surveying the kids &#8211; something to get them talking. First it was a survey of what they knew (turning a computer on &amp; off, using the internet, downloading from the internet, checking emails, word-processing, excel, powerpoint, etc.) and how much they knew of it &#8211; in order to get an idea of the knowledge-spectrum of the class and more importantly, to know about those kids who needed extra attention. Then, they listed what they like about computers and what they don&#8217;t (annoyances) &#8211; and needless to mention, the latter list was much bigger. Some amount of time was dedicated to show them methods of graphing the data (by hand) and later in the afternoon, kids spent time at the SDC &#8211; shooting baskets. It was nice of some Tech Basketball players (and friends of mine &#8211; Bob Evans, Radayl Richardson, Robby Springborn and Josh) to give some shooting tips and watch while they were shooting. I am quite sure kids loved it. The act of shooting the basketball also served the purpose of collecting useful data &#8211; which they used to plot using Excel the next day.</p>
<p>So, the next few days rolled on with participants learning about different aspects of computers as well as science &#8211; methods of data collection, analysis and presentation. Syllabus also included combined sessions, often hands-on, where students shared their knowledge with their teachers. What impressed me the most was the dedication of teachers &#8211; they often came in early, sometimes skipped lunch and did everything possible to learn the material; and once students warmed-up, they had lot of fun too. Short field trips, techniques in digital photography, post-processing with Photoshop, making movies, principles of software design, etc&#8230; &#8211; gave the participants wide range of things to chew on. Some of the photos I shot during these days are <a href="http://sgowtham.net/gallery/20060623/" target="_blank">here</a>.</p>
<p><em>What did I learn, you ask?</em> &#8212; lot of things to be honest. Importantly, I re-realized the fact that teaching can be lot of fun. Following is the excerpt from <em>Surely You&#8217;re Joking, Mr. Feynman</em> (<b>Dignified Professor</b> chapter) &#8211;  a book that one should read, if haven&#8217;t already. But don&#8217;t get me wrong, I have my highest respect for those who do research all the time as they expand the frontiers of knowledge by pushing the barriers far and wide than we ever imagined &#8211; society also needs some who can teach the pass such knowledge onto students. </p>
<blockquote><p>
I don&#8217;t believe I can really do without teaching. The reason is, I have to  have something so that when I don&#8217;t have any  ideas and  I&#8217;m not getting anywhere I  can  say to  myself, &#8220;At  least I&#8217;m living;  at  least I&#8217;m doing something; I&#8217;m making some contribution&#8221; &#8212; it&#8217;s just psychological.<br />
<br />When I was at Princeton in the 1940s I could see what happened to those great minds  at the Institute  for Advanced  Study,  who had been specially selected for their tremendous brains and were now given this opportunity  to sit in this  lovely house by the woods there, with no classes to teach, with no obligations whatsoever. These  poor  bastards  could  now  sit and  think clearly all by themselves, OK? So they don&#8217;t get any ideas for a while: they have every opportunity to do something, and they&#8217;re not getting any ideas. I believe  that in a situation like this a kind of guilt  or  depression  forms inside of you, and  you  begin to worry about  not getting  any  ideas.  And nothing happens. Still no ideas come.<br />
<br />Nothing happens because there&#8217;s not enough real activity and challenge: You&#8217;re  not  in contact  with the experimental guys. You don&#8217;t have to think how to answer questions from the students. Nothing!<br />
<br />In any thinking process there are moments when everything is going good and you&#8217;ve got wonderful ideas. Teaching is an interruption, and so it&#8217;s the greatest  pain  in  the neck  in the world. And  then there are  the  longer periods of  time when not  much  is coming  to  you. You&#8217;re not  getting any ideas,  and if you&#8217;re  doing  nothing at all,  it drives you nuts! You can&#8217;t even say &#8220;I&#8217;m teaching my class.&#8221;<br />
<br />If you&#8217;re teaching a class, you  can  think about the elementary things that you know very  well. These  things  are kind of  fun and delightful. It doesn&#8217;t do  any harm to think  them  over again. Is there  a  better way  to present them? Are there any new problems associated with them? Are there any new thoughts you  can make  about  them? The elementary things  are easy  to think  about; if you can&#8217;t think of  a  new thought, no harm done; what you thought about  it before is good enough  for the class.  If you  do think of something new, you&#8217;re rather pleased  that you  have a new way of  looking at it.<br />
<br />The  questions  of  the  students are often the source of new research. They often ask  profound questions that I&#8217;ve thought about at times and then given up on,  so to speak, for a while. It wouldn&#8217;t do  me any harm to think about them  again and see  if I can go any further now. The students may not be able to see the thing I want to answer, or the subtleties I want to think about,  but  they  remind  me  of  a  problem  by  asking  questions in  the neighborhood of that problem. It&#8217;s not so easy to remind  yourself  of these things.<br />
<br />So I find that teaching and the students  keep life going, and I  would never accept any position in which  somebody  has invented a happy situation for me where I don&#8217;t have to teach. Never.
</p></blockquote>
<p>Thanks to Dr. P, our department (esp. Beth who did all the required paper-work), organizers and fellow instructors, I was very fortunate to have had this opportunity to work with kids for a week. I got to know of fellow instructors (Erin K and Karen K), many more known/previously-unknown people in the Humanities (Matt Hill, Jim Oliver, Michael, &#8230;) and 23 people from down-state. I have kinda started liking the CCLI (a.k.a computer lab) in Humanities &#8211; for one, it&#8217;s air-conditioned (or at least, it feels like it is) and second, it has a separate Mac section, which is really very cool. I am glad that kids got to use Macs too &#8211; as many of them later admitted that they would never want to use a Windows machine again. With the help of Erin and Karens (S and K), I will probably learn more about Photoshop, get tips to improve my manual-writing skills, and enhance my website. Wish I was part of something like this long time ago &#8211; I would have known these people for long, would have shared (and gained) information, written better manuals (which our users actually READ), &#8230; </p>
<p>But such is life &#8211; nothing ever happens before its time and beyond one&#8217;s destiny. I am just glad that it was finally my turn <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Here&#8217;s a template (sample) of the certificates (designed by Erin) kids got at the end of this 5-day workshop. Pretty cool, heh?</p>
<p align="center">
<a href="http://sgowtham.net/blog/files/DAPCEP-Certificate.png" target="_blank" rel="lightbox[199]"><img src="http://sgowtham.net/blog/files/DAPCEP-Certificate.png" alt="DAPCEP Certificate Designed By Erin" title="DAPCEP Certificate Designed By Erin" width="500" class="framed"></a>
</p>
<p>There are some things that I don&#8217;t like about such short-duration workshops. It usually takes about 2-3 days for participants to get warmed up &amp; get used to the new environment &amp; instructors. By the time we really start to jell together as a team, it&#8217;s about time for them to leave. To see participants call their instructors <em>not-so-entertaining</em> on day one and regard them as <em>cool</em> by day five can and does bring about lot of satisfaction, and hints at a job well done. To me, like every other instructor, it was very heart-warming to be hugged by almost every participant and to be asked to sign in their books. </p>
<p>But again, such is life &#8211; things happen, people come and go, but memories just (sometimes) stay forever&#8230;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2006%2F06%2F24%2Fdapcep-it-michigan-tech%2F&amp;title=DAPCEP%20IT%20%40%20Michigan%20Tech" id="wpa2a_30"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2006/06/24/dapcep-it-michigan-tech/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Busy Times</title>
		<link>http://sgowtham.net/blog/2006/03/05/busy-times/</link>
		<comments>http://sgowtham.net/blog/2006/03/05/busy-times/#comments</comments>
		<pubDate>Mon, 06 Mar 2006 00:12:34 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2006/03/05/busy-times/</guid>
		<description><![CDATA[Last seven days or so have been quite busy and most of the busyness had to do with school/research work. After exchanging few emails and reading few manuals, I finally managed to run Atomistix Tool Kit (v2.0) on our beowulf cluster. It wasn&#8217;t easy by any means and I still have some work to do [...]]]></description>
			<content:encoded><![CDATA[<p>Last seven days or so have been quite busy and most of the <i>busy</i>ness had to do with school/research work. After exchanging few emails and reading few manuals, I finally managed to run <b>Atomistix Tool Kit</b> (v2.0) on our beowulf cluster. It wasn&#8217;t easy by any means and I still have some work to do &#8211; in <i>common</i>ising the <b>FlexLM</b> thing. Currently, the cluster has three products whose license is managed via <b>FlexLM</b> and there needs to be just one <tt>lmgrd</tt> running. More importantly, <tt>lmgrd</tt> must start automatically after every reboot. I will work with our SysAdmins early next week to get his done. A graphical interface from <b>atomistix</b>, called <b>Virtual Nano Lab</b>, also gave me its share of troubles. Similar to <b>Accelrys&#8217; MS Visualizer</b>, it can be installed on any number of machines but only one can be used at any given time. Another bugging issue with ATK is the following: when run in parallel, output is written N times and worse, there is no difference in CPU time for a single processor &amp; multi-processor job. Could be improper parallelization or I may be missing something very obvious&#8230;</p>
<p>Couple of fellow graduate students did their prelims and our Department, as it has been the tradition, hosted <i>Spring Feedback Pizza Party</i>. Many of the new students complained about weather conditions and qualifiers, while yours truly, as usual, brought up <i>physerver</i> disk usage and aging issues. During this meeting, it was also mentioned that some old machines in the Physics Grad Lab would be replaced with new ones. Upon hearing this, after the meeting, I proposed to the department about using them to set up a <b>Cluster Work Bench</b>. When built, this cluster work bench will serve as good instructional resource, and other reasons for this proposal are as follows:</p>
<ol>
<li>CPU cylces can be used instead of the machines sitting idle in some closet</li>
<li>People (faculty and students alike) who would like to learn building a clusters (a.k.a. getting their hands dirty), can do so</li>
<li>Research groups planning to have a cluster of their own, can learn proper usage techniques</li>
<li>Research groups that have a cluster already, may use it as a not-so-risky platform to test new compilations</li>
<li>Some others, who may not be in a position to afford a cluster, can get their research done</li>
<li>This set up can also be used for small Summer projects, course-work projects, etc</li>
<li>Since we (dept) need to pay for disposal, part of that disposal money can be used to pay for network connection</li>
</ol>
<p>For the last few days, I have been somewhat occupied with preparing slides for the upcoming APS meeting in Baltimore, and we have couple of practice talks scheduled in the next week. Almost all preparations from my side are done &#8211; request for leave of absence, transportaion (air and local), list of talks to attend, list of other (non-research) things  to do, complete mailing address of all people I am planning to visit (I still have to print driving directions though), &#8230; Hopefully, everything will go according to the plan. Preparations are also underway (thanks to Kyle Schneider) for attending the <b>PenguiCon 4.0</b>, in Livonia, just the weekend before Tech finals. I have nothing to worry about as I have no finals to take <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I am about to complete planning for the conference in Cochin (India), later this year &#8211; should be fun times, to meet my teachers and friends&#8230;.</p>
<p>Coming to other things, Tech basketball teams (both men and women) lost in the GLIAC quarter-finals. <a href="http://www.otokpa.com" target="_blank">David Otokpa</a> has promised me to send his comments/suggestions about my photos and I am eagerly looking forward to that. I have also been planning to find a new place to live &#8211; not that there is anything wrong with the current place, but with quite a few friends planning to visit me in the next three semesters or so, it will be a good idea to have a separate place. I had signed a contract too, for a place in Hancock, but have requested them to cancel it as a result of some unforeseen circumstances. Over the last few days, I was informed about this website, <a href="http://kalyanvarma.net" target="_blank"><i>kalyanvarma.net</i></a> and the wildlife photos (in and around Karnataka, India) are just too good. I modified certain parts of my website, mostly related to photo gallery, to make them more user-friendly. After some struggle, searching around and LUG members&#8217; help, I have managed to get Kannada fonts in Mozilla Firefox under Linux (Red Hat Enterprise). This means that I no longer have to boot my laptop in Windows just to read some of my friends&#8217; blogs. A fellow graduate student told me the best computer-related joke ever&#8230;.</p>
<blockquote><p>When Microsoft finally makes a product that doesn&#8217;t suck, it will be a Vacuum Cleaner!</p></blockquote>
<p>Until next time, have fun <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2006%2F03%2F05%2Fbusy-times%2F&amp;title=Busy%20Times" id="wpa2a_32"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2006/03/05/busy-times/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VASP, MPICH, Intel Compilers And NPACI Rocks</title>
		<link>http://sgowtham.net/blog/2005/12/22/vasp-mpich-intel-compilers-and-npaci-rocks/</link>
		<comments>http://sgowtham.net/blog/2005/12/22/vasp-mpich-intel-compilers-and-npaci-rocks/#comments</comments>
		<pubDate>Thu, 22 Dec 2005 18:44:41 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[VASP]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=6</guid>
		<description><![CDATA[Much of the weekend was spent in some relaxation, shoveling snow (I have come to realize that this is a very good exercise &#8211; it can make one sweat even when it’s 10 F outside!) and trying to debug the errors associated with execution of parallel version of VASP 4.6.28. However, same errors persisted and [...]]]></description>
			<content:encoded><![CDATA[<p>Much of the weekend was spent in some relaxation, shoveling snow (I have come to realize that this is a very good exercise &#8211; it can make one sweat even when it’s 10 F outside!) and trying to debug the errors associated with execution of parallel version of VASP 4.6.28. However, same errors persisted and I didn’t go too far ahead with it. </p>
<p>I got in touch with few of Intel’s authorized resellers (one in Bloomington, MN &#8211; who transferred the call to someone else in Boston, MA) to see if I can get a copy of version 8.x of FORTRAN and C compilers. Though the latter person promised to get back to me with some favorable information soon, I got directly in touch with an Intel Support Technician &#8211; hoping that he/she wouldn’t be from a call center in some <em>other</em> country. Fortunately, it was somebody in California and unfortunately, he redirected me back to their re-sellers. Last call, pretty much out of desperation, did what I wanted : I just had to register the non-commercially downloaded products for <em>Premier Support</em> and I would be entitled for previous versions too. If only Intel explicitly mentioned what <em>Premier Support</em> actually is, my worries would have ended a long time ago. By the way, if you are now wondering what the error message was (running on 2 processors), here it is:</p>
<p><br clear="all"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;">running <span style="color: #25BB4D;">on</span>    <span style="color: #000000; font-weight:bold;">2</span> nodes
distr<span style="color: #000000;">:</span>  one band <span style="color: #25BB4D;">on</span>    <span style="color: #000000; font-weight:bold;">1</span> nodes,    <span style="color: #000000; font-weight:bold;">2</span> groups
vasp<span style="color: #000000;">.</span>4<span style="color: #000000;">.</span>6<span style="color: #000000;">.</span>28 25Jul05 complex
POSCAR found <span style="color: #000000;">:</span>  <span style="color: #000000; font-weight:bold;">4</span> types and   <span style="color: #000000; font-weight:bold;">18</span> ions
LDA part<span style="color: #000000;">:</span> xc<span style="color: #000000;">-</span>table <span style="color: #804040;">for</span> Ceperly<span style="color: #000000;">-</span>Alder, standard interpolation
found WAVECAR, reading the header
POSCAR, INCAR and KPOINTS ok, starting setup
WARNING<span style="color: #000000;">:</span> <span style="color: #668080;">wrap</span> around errors must be expected
FFT<span style="color: #000000;">:</span> planning <span style="color: #000000;">...</span>           <span style="color: #000000; font-weight:bold;">1</span>
reading WAVECAR
the WAVECAR file was read sucessfully
LAPACK<span style="color: #000000;">:</span> Routine ZPOTRF failed<span style="color: #000000;">!</span>           <span style="color: #000000; font-weight:bold;">8</span>
LAPACK<span style="color: #000000;">:</span> Routine ZPOTRF failed<span style="color: #000000;">!</span>           <span style="color: #000000; font-weight:bold;">8</span></pre></td></tr></table></div>

<p>Having managed to get version 8.x and 7.x of Intel compilers, situation only got worse as the error message remained the same <img alt="(" src="http://sgowtham.net/blog/wp-images/smilies/icon_sad.gif" />  At this point,  I must thank the help offered by VASP Tech Support and <a href="mailto:andriNOSPAM@u.washington.edu">Andri Arnaldsson</a> (from University of Washington) &#8211; they have been pretty quick in their responses, sent their copies of Makefiles along with several tips and tricks. Changing compiler versions, using a previous version of MPICH (1.2.7p1 to be precise), repeating compilation many times with different BLAS, LAPACK libraries … nothing helped. </p>
<p>Taking a break for an hour and watching an episode of South Park seemed to have helped. A modification in the key words used for Google! search and reading some discussion forum lot more carefully, I found that adding three lines at the end of VASP Makefile (what this does is to reduce the level of optimization for <tt>mpi.F</tt>), the error vanished and the calculations started running smoothly. I repeated the same calculation using 2, 4, 6 and 8 processors and noticed a slightly strange behavior &#8211; when the number of processors was 2, 4 or 8, energy optimization is exactly same as in a serial calculation but when the number of processors is 2*N (N=3 in this case), energy optimization route is different &#8211; final result is still exactly the same. Though I have to do more trials (say 3, 5, 7, 9, 10 processors) to completely convince myself, it appears to me that using 2<sup>N</sup> processors does the trick. Like Dave Kraus mentioned once before &#8211; <em>knowing what trick works is certainly important, but knowing why that trick works is even more important</em>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2005%2F12%2F22%2Fvasp-mpich-intel-compilers-and-npaci-rocks%2F&amp;title=VASP%2C%20MPICH%2C%20Intel%20Compilers%20And%20NPACI%20Rocks" id="wpa2a_34"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2005/12/22/vasp-mpich-intel-compilers-and-npaci-rocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>strike out</title>
		<link>http://sgowtham.net/blog/2005/06/10/strike-out/</link>
		<comments>http://sgowtham.net/blog/2005/06/10/strike-out/#comments</comments>
		<pubDate>Fri, 10 Jun 2005 09:59:45 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=57</guid>
		<description><![CDATA[This is something that I had never experienced since I started playing softball, thanks mostly due to the people who introduced me to this wonderful, democratic game and taught me to be patient. While I still was bragging about my in-field home-run, this strike-out, in my 100th plate appearance, against a not-so-powerful team brought me [...]]]></description>
			<content:encoded><![CDATA[<p>This is something that I had never experienced since I started playing softball, thanks mostly due to the people who introduced me to this wonderful, democratic game and taught me to be patient. While I still was bragging about my in-field home-run, this strike-out, in my 100th plate appearance, against a not-so-powerful team brought me down to earth. I do not know what I was thinking when I swung at that pitch &#8230; yakkkk It not only spoiled my 1.000 batting average but triggered series of mocking events off the field. Fortunately, it did not cost us anything, and we drubbed (brutally murdered, to be precise) the other team. Now that I have nothing to maintain (I mean 1.000 figure), the monkey is off the back and I should play with a relaxed state of mind. More importantly, a perfect figure wouldn&#8217;t mean anything if we don&#8217;t win the championship &#8211; it&#8217;s not worth if it doesn&#8217;t help the team <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ;</p>
<p>As if my strike-out wasn&#8217;t enough to put me down, Pistons lost their first game in the NBA finals too, to completely turn me off&#8230; Well, this is definitely a good day to forget.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2005%2F06%2F10%2Fstrike-out%2F&amp;title=strike%20out" id="wpa2a_36"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2005/06/10/strike-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>home run, Atlast</title>
		<link>http://sgowtham.net/blog/2005/06/08/home-run-atlast/</link>
		<comments>http://sgowtham.net/blog/2005/06/08/home-run-atlast/#comments</comments>
		<pubDate>Wed, 08 Jun 2005 08:15:59 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=58</guid>
		<description><![CDATA[I have been trying to hit a home-run (in-field, not over the fence) for last three seasons and I did it at last. It was one of the Church League games and I charged towards third-base (while my base-coach was shouting to stop at second). Throw from outfield was wild, helping me get an extra [...]]]></description>
			<content:encoded><![CDATA[<p>I have been trying to hit a home-run (in-field, not over the fence) for last three seasons and I did it at last. It was one of the Church League games and I charged towards third-base (while my base-coach was shouting to stop at second). Throw from outfield was wild, helping me get an extra base and get a home-run. Though I got lucky this time, it still is a very good thing to listen to your base-coach, and blindly follow his/her orders.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2005%2F06%2F08%2Fhome-run-atlast%2F&amp;title=home%20run%2C%20Atlast" id="wpa2a_38"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2005/06/08/home-run-atlast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qual Results</title>
		<link>http://sgowtham.net/blog/2005/01/17/qual-results/</link>
		<comments>http://sgowtham.net/blog/2005/01/17/qual-results/#comments</comments>
		<pubDate>Tue, 18 Jan 2005 03:11:52 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2005/01/17/qual-results/</guid>
		<description><![CDATA[I came to school early as we had a meeting planned, but it had to be postponed since the Qual-Committee was meeting in the same room. My nervousness had no upper bound and I grew very restless with time. It was just around 12.30 pm that Dr. P put all my nervousness to rest &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>I came to school early as we had a meeting planned, but it had to be postponed since the Qual-Committee was meeting in the same room. My nervousness had no upper bound and I grew very restless with time. It was just around 12.30 pm that Dr. P put all my nervousness to rest &#8211; he informed me that I had passed both the papers <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I sent emails to quite a few people, thanking them for their support, and spent most of the afternoon in working on the group home page, working with Ravish on his company&#8217;s home page, etc. All of a sudden, the same old food started tasting better <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I also got the old computer (which I had got from School of Business) working. It was kind of blessing in  disguise that I was not able to do this earlier &#8211; thus saving me lot of time&#8230;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2005%2F01%2F17%2Fqual-results%2F&amp;title=Qual%20Results" id="wpa2a_40"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2005/01/17/qual-results/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2004 Play Offs</title>
		<link>http://sgowtham.net/blog/2004/07/29/2004-play-offs/</link>
		<comments>http://sgowtham.net/blog/2004/07/29/2004-play-offs/#comments</comments>
		<pubDate>Fri, 30 Jul 2004 04:39:44 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2004/07/29/2004-play-offs/</guid>
		<description><![CDATA[Semi-Finals, against MSE : Lots of people, players and supporters alike, showed up at the ball-park and my throwing arm felt lot better. After a brief warm-up session, the much awaited semi-finals started off, with Metallurgy scoring 4 in the first innings. We replied equally well, scoring 8, with 7 coming after we were two-down! [...]]]></description>
			<content:encoded><![CDATA[<p>Semi-Finals, against MSE : Lots of people, players and supporters alike, showed up at the ball-park and my throwing arm felt lot better. After a brief warm-up session, the much awaited semi-finals started off, with Metallurgy scoring 4 in the first innings. We replied equally well, scoring 8, with 7 coming after we were two-down! The innings came to a halt as a result of a poor shot selection from me. It was great to see each of our player getting into top gear at the same time. We just kept scoring more and more every innings while holding them just for a run or two every innings from then on. The game finally ended at the top of seventh innings and we won 23 &#8211; 11. Same Semi-Finals lineup and same result <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finals, against IT : I was, from the match against the same team last week, under the impression that EE would be a our opponent in this game. But as things had turned out on Field #2, IT had beaten EE with home-team advantage . The poster was about half ready and I guess being home-team gave us some advantage. After holding IT for zero, we scored 8 in the first and again, 7 of these came after we were two down and the innings came to a halt as a result of my poor shot. This IT was not the same which had beaten us 18 &#8211; 31 in the first game. If batting was at it&#8217;s brutal best and base running lightning fast, defence was at its greatest. Hardly anything that went up in air reached ground and IT running was no match for our solid defence. We made plenty of plays at the first and second bases and effected a double play too, to make it spicy. Home runs flowed and with everybody (Patrick, Mary, Tilvi, Haiying, Marg, Daniel and many more) cheering us all along, we beat IT 20 &#8211; 5 (yes, twenty to five) by the bottom of sixth (call this the sweetest revenge!) and celebrations began soon &#8211; on the field and carried over to the Downtowner for rest of the evening&#8230; All the hard work we had put in under scorching Sun on Sundays had paid off.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2004%2F07%2F29%2F2004-play-offs%2F&amp;title=2004%20Play%20Offs" id="wpa2a_42"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2004/07/29/2004-play-offs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sigma Xi Multi-disciplinary Research Colloquium</title>
		<link>http://sgowtham.net/blog/2004/04/17/sigma-xi-multi-disciplinary-research-colloquium/</link>
		<comments>http://sgowtham.net/blog/2004/04/17/sigma-xi-multi-disciplinary-research-colloquium/#comments</comments>
		<pubDate>Sat, 17 Apr 2004 20:22:03 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[MichiganTech]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/2004/04/17/sigma-xi-multi-disciplinary-research-colloquium/</guid>
		<description><![CDATA[It has been a long time since I got up really early on a Saturday morning and today, I had to because of the Sigma Xi Multi-disciplinary Research Colloquium. It started off early, around 8.30 am and went on till about 1 pm. Almost all presentations were clear, crisp, well thought out and pertained to [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since I got up really early on a Saturday morning and today, I had to because of the Sigma Xi Multi-disciplinary Research Colloquium. It started off early, around 8.30 am and went on till about 1 pm. Almost all presentations were clear, crisp, well thought out and pertained to engineering / technological applications relevant to every day life. I was glad that one of the judges at least, Dr. Perger, knew the significance of my numbers. There could be several reasons why I did not win a prize -</p>
<ul class="general">
<li><strong>Dress</strong> &#8211; probably the event required very smart turn out, like a blazer and a tie or so.</li>
<li><strong>Topic of research and presentation</strong> &#8211; it&#8217;s a theory and more of computationally oriented; not many will appreciate the significance of my numbers. OR my inability to make general audience understand what these numbers mean.</li>
<li>General audience can picturise, understand and appreciate the technological applications more easily than it does of some set of numbers and pretty looking molecules.</li>
<li>My way (posture, etc) of presenting my research.</li>
<li><strong>Time constraint</strong> &#8211; choosing what to present and what not to present; how to present and how not to present &#8211; I<br />
will have to work on it.</li>
</ul>
<p>I did learn some very important lessons from this colloquium and I am glad that the organizers will send us judges&#8217; comments.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fsgowtham.net%2Fblog%2F2004%2F04%2F17%2Fsigma-xi-multi-disciplinary-research-colloquium%2F&amp;title=Sigma%20Xi%20Multi-disciplinary%20Research%20Colloquium" id="wpa2a_44"><img src="http://sgowtham.net/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://sgowtham.net/blog/2004/04/17/sigma-xi-multi-disciplinary-research-colloquium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

