<?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; Rocks</title>
	<atom:link href="http://sgowtham.net/blog/category/technology/rocks/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>HPCC 1.4.1 Benchmark With GCC 4.1.2 On Rocks 5.4.2</title>
		<link>http://sgowtham.net/blog/2012/02/28/hpcc-1-4-1-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/</link>
		<comments>http://sgowtham.net/blog/2012/02/28/hpcc-1-4-1-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 18:27:14 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Clusters]]></category>
		<category><![CDATA[HPCC]]></category>
		<category><![CDATA[HPL]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=3411</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 HPCC</h3>
<p>Citing <a href="http://icl.cs.utk.edu/hpcc/" target="_blank" clas="underline">HPCC website</a>,</p>
<blockquote><p>
HPCC benchmark suite has been released by <a href="http://www.darpa.mil/Our_Work/MTO/Programs/High_Productivity_Computing_Systems_%28HPCS%29.aspx" target="_blank" class="underline">DARPA High Productivity Computing Systems (HPCS)</a> program to help define the performance boundaries of future Petascale computing systems. HPCC is a suite of tests that examine the performance of HPC architectures using kernels with memory access patterns more challenging than those of the HPL benchmark used in <a href="http://www.top500.org/" target="_blank" class="underline">Top500</a>. This suite is designed to augment the list, providing benchmarks that bound the performance of many real applications as a function of memory access characteristics. For e.g., spatial and temporal locality, and providing a framework for including additional tests. HPCC consists of seven tests that attempt to span high and low spatial and temporal locality space. </p>
<p>By design, the HPCC tests are scalable with the size of data sets being a function of the largest HPL matrix tested for the system. Since HPCC kernels consist of simple mathematical operations, it provides a unique opportunity to look at language and parallel programming issues. To characterize the architecture of the system, the following three scenarios are considered:</p>
<ol>
<li><strong>Local</strong> &#8211; only a single processor is performing the computations</li>
<li><strong><a href="http://en.wikipedia.org/wiki/Embarrassingly_parallel" target="_blank" class="underline">Embarrassingly Parallel</a></strong> &#8211; each processor in the entire system is performing the computations but without explicit communication with each other</li>
<li><strong>Global</strong> &#8211; all processors in the system are performing the computations with explicit communication with each other</li>
</ol>
<p>The seven tests that make up HPCC benchmark are as follows:</p>
<ol>
<li><strong><a href="http://www.netlib.org/benchmark/hpl/" target="_blank" class="underline">HPL</a></strong> &#8211; the Linpack TPP benchmark which measures the floating point rate of execution for solving a linear system of equations</li>
<li><strong><a href="http://en.wikipedia.org/wiki/General_Matrix_Multiply" target="_blank" class="underline">DGEMM</a></strong> &#8211; measures the floating point rate of execution of double precision real matrix-matrix multiplication</li>
<li><strong><a href="http://www.cs.virginia.edu/stream/" target="_blank" class="underline">STREAM</a></strong> &#8211; a simple synthetic benchmark program that measures sustainable memory bandwidth (in GB/s) and the corresponding computation rate for simple vector kernel</li>
<li><strong><a href="http://www.netlib.org/parkbench/html/matrix-kernels.html" target="_blank" class="underline">PTRANS</a> (parallel matrix transpose)</strong> &#8211; exercises the communications where pairs of processors communicate with each other simultaneously. It is a useful test of the total communications capacity of the network</li>
<li><strong><a href="http://icl.cs.utk.edu/projectsfiles/hpcc/RandomAccess/" target="_blank" class="underline">RandomAccess</a></strong> &#8211; measures the rate of integer random updates of memory (GUPS)</li>
<li><strong><a href="http://www.ffte.jp/" target="_blank" class="underline">FFT</a></strong> &#8211; measures the floating point rate of execution of double precision complex one-dimensional Discrete Fourier Transform (DFT)</li>
<li><strong><a href="https://fs.hlrs.de/projects/par/mpi/b_eff/" target="_blank" class="underline">Communication bandwidth and latency</a></strong> &#8211; a set of tests to measure latency and bandwidth of a number of simultaneous communication patterns; based on b<sub>eff</sub> (effective bandwidth benchmark)</li>
</ol>
</blockquote>
<p><br clear="all"></p>
<h3 class="blog">Pre-requisites: MPI &#038; Goto BLAS</h3>
<p>Please refer to the corresponding sections in <a href="http://sgowtham.net/blog/2012/02/27/hpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/" class="underline" target="_blank">HPL 2.0 Benchmark With GCC 4.1.2 On Rocks 5.4.2</a> to learn more about required pre-requisites as well as instructions for installing/compiling them. Following Rocks recommendations, 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"></p>
<h3 class="blog">HPCC Installation/Compilation</h3>
<p>With MPICH2 and Goto BLAS2 in place, HPCC 1.4.1 will be installed under</p>
<p class="bpcaption"><code>/share/apps/hpcc/1.4.1/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 HPCC 1.4.1 from <a href="http://icl.cs.utk.edu/hpcc/software/" target="_blank" class="underline">here</a> &#038; the necessary <code>Make.MPICH2141p1_GCC412.HPCC</code> (listed below; it does look identical to the one used when compiling HPL 2.0 &#8211; the only difference is in the definition of <code>TOPdir</code> variable) 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 HPCC </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>
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
</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_hpcc.sh</span>
<span style="color: #666666; font-style: italic;"># BASH script to install HPCC 1.4.1 (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;">HPCC_VERSION</span>=<span style="color: #ff0000;">&quot;1.4.1&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;">HPCC_INSTALL</span>=<span style="color: #ff0000;">&quot;/share/apps/hpcc/<span style="color: #007800;">${HPCC_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 HPCC-${HPCC_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/hpcc-<span style="color: #007800;">${HPCC_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>hpcc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${HPCC_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>hpcc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${HPCC_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>hpcc-<span style="color: #800000;">${HPCC_VERSION}</span>.tar.gz
    <span style="color: #c20cb9; font-weight: bold;">mv</span> hpcc-<span style="color: #800000;">${HPCC_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;">${HPCC_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>.HPCC .<span style="color: #000000; font-weight: bold;">/</span>hpl<span style="color: #000000; font-weight: bold;">/</span>Make.<span style="color: #800000;">${MAKEFILE_ARCH}</span>
&nbsp;
    <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: #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;
  # HPCC (${HPCC_VERSION}) settings
  export HPCC=&quot;${HPCC_INSTALL}&quot;
  export PATH=&quot;\${PATH}:\${HPCC}/bin/${MAKEFILE_ARCH}&quot;
  export LD_LIBRARY_PATH=&quot;\${LD_LIBRARY_PATH}:\${HPCC}/${MAKEFILE_ARCH}&quot;
&nbsp;
EOF</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># End hpcc-${HPCC_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 HPCC Benchmark</h3>
<p>Please refer to the corresponding sections in <a href="http://sgowtham.net/blog/2012/02/27/hpl-2-0-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/" class="underline" target="_blank">HPL 2.0 Benchmark With GCC 4.1.2 On Rocks 5.4.2</a> to learn how to get a fix on <code>N</code>, <code>NB</code>, etc., given the hardware configuration of compute nodes. Running HPCC benchmark is very similar to running HPL 2.0 benchmark.</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%2F28%2Fhpcc-1-4-1-benchmark-with-gcc-4-1-2-on-rocks-5-4-2%2F&amp;title=HPCC%201.4.1%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/28/hpcc-1-4-1-benchmark-with-gcc-4-1-2-on-rocks-5-4-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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_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/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_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/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>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>BASH &#8211; Wrappers For qstat In NPACI ROCKS 5.2.2</title>
		<link>http://sgowtham.net/blog/2009/12/10/bash-wrappers-for-qstat-in-npaci-rocks-5-2-2/</link>
		<comments>http://sgowtham.net/blog/2009/12/10/bash-wrappers-for-qstat-in-npaci-rocks-5-2-2/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 20:51:33 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[AWK]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=2536</guid>
		<description><![CDATA[What is ROCKS? Rocks Cluster Distribution (originally called NPACI Rocks) is a Linux distribution intended for high-performance computing clusters. It was started by NPACI and the SDSC in 2000, and was initially funded in part by an NSF grant (2000-2007) but is currently funded by the followup NSF grant. Rocks was initially based on the [...]]]></description>
			<content:encoded><![CDATA[<h3 class="blog">What is ROCKS?</h3>
<p>Rocks Cluster Distribution (originally called NPACI Rocks) is a Linux distribution intended for high-performance computing clusters. It was started by NPACI and the SDSC in 2000, and was initially funded in part by an NSF grant (2000-2007)  but is currently funded by the followup NSF grant. Rocks was initially based on the Red Hat Linux distribution, however modern versions of Rocks are now based on CentOS, with a modified Anaconda installer that simplifies mass installation onto many computers. Rocks includes many tools (such as MPI) which are not part of CentOS but are integral components that make a group of computers into a cluster. Installations can be customized with additional software packages at install-time by using special user-supplied CDs (called <em>Roll CDs</em>). The Rolls extend the system by integrating seamlessly and automatically into the management and packaging mechanisms used by base software, greatly simplifying installation and configuration of large numbers of computers. Over a dozen Rolls have been created, including the SGE roll, the Condor roll, the Lustre roll, the Java roll, and the ganglia roll.</p>
<p><br clear="all"></p>
<h3 class="blog">Why wrappers?</h3>
<p>Functionality of <code>qstat</code> [part of the <strong>SGE Roll</strong>] changed in ROCKS 5.2.2 [it might have changed earlier than that, but that's when I first noticed]. To keep cluster users, supervisors and systems-administrators happy, I ended up writing these two wrappers:</p>
<p><br clear="all"></p>
<h3 class="blog">General Wrapper for <strong>qstat</strong></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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># A wrapper for 'qstat' command to show </span>
<span style="color: #666666; font-style: italic;"># the total number processors used/in use.</span>
<span style="color: #666666; font-style: italic;"># ROCKS 5.2.2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Thu, 10 Dec 2009 12:27:59 -0500</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_TOTAL</span>=<span style="color: #ff0000;">&quot;142&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">USERS_LIST</span>=<span style="color: #ff0000;">&quot;
  user0
  user1
  user2
  user3
  user4&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_INUSE</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$USERS_LIST</span> <span style="color: #000000; font-weight: bold;">|</span> \
                  <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print} (NR&gt;2) {used_procs+=\$9} END {print used_procs}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
                  <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_AVAIL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$PROC_TOTAL</span> - <span style="color: #007800;">$PROC_INUSE</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$USERS_LIST</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$PROC_TOTAL</span> total processors :: <span style="color: #007800;">$PROC_INUSE</span> is/are in use :: <span style="color: #007800;">$PROC_AVAIL</span> is/are available&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span></pre></td></tr></table></div>

<p><br clear="all"></p>
<h3 class="blog">User Specific Wrapper for <strong>qstat</strong></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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># A wrapper for 'qstat' command to show only the jobs</span>
<span style="color: #666666; font-style: italic;"># submitted by a given user but show the total number</span>
<span style="color: #666666; font-style: italic;"># processors used/in use.</span>
<span style="color: #666666; font-style: italic;"># ROCKS 5.2.2</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Usage:</span>
<span style="color: #666666; font-style: italic;"># qu [USERNAME]</span>
<span style="color: #666666; font-style: italic;"># In the absence of any jobs submitted by USERNAME, or if</span>
<span style="color: #666666; font-style: italic;"># USERNAME is not specified at all, it just displays the jobs, </span>
<span style="color: #666666; font-style: italic;"># if any, by the currently logged in user.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Thu, 10 Dec 2009 12:27:59 -0500</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EXPECTED_ARGS</span>=<span style="color: #ff0000;">&quot;1&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_TOTAL</span>=<span style="color: #ff0000;">&quot;142&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">USERS_LIST</span>=<span style="color: #ff0000;">&quot;
  user0
  user1
  user2
  user3
  user4&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ne</span> <span style="color: #007800;">$EXPECTED_ARGS</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;">export</span> <span style="color: #007800;">MYUSER</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$USER</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
  <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MYUSER</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_USER</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$MYUSER</span> <span style="color: #000000; font-weight: bold;">|</span> \
                 <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print} (NR&gt;2) {used_procs+=\$9} END {print used_procs}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
                 <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_INUSE</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$USERS_LIST</span> <span style="color: #000000; font-weight: bold;">|</span> \
                  <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print} (NR&gt;2) {used_procs+=\$9} END {print used_procs}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
                  <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_AVAIL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$PROC_TOTAL</span> - <span style="color: #007800;">$PROC_INUSE</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$PROC_USER</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</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: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
  <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$MYUSER</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; <span style="color: #007800;">$PROC_TOTAL</span> total processors :: <span style="color: #007800;">$PROC_INUSE</span> is/are in use :: <span style="color: #007800;">$PROC_USER</span> is/are use by <span style="color: #007800;">$MYUSER</span> :: <span style="color: #007800;">$PROC_AVAIL</span> is/are available &quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span>
  <span style="color: #7a0874; font-weight: bold;">echo</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;  <span style="color: #780078;">`hostname`</span> @ <span style="color: #780078;">`date -R`</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  <span style="color: #007800;">$PROC_TOTAL</span> total processors&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  <span style="color: #007800;">$PROC_INUSE</span> is/are in use &quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  0 is/are use by <span style="color: #007800;">$MYUSER</span>&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  <span style="color: #007800;">$PROC_AVAIL</span> is/are available &quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #000000; font-weight: bold;">fi</span></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%2F2009%2F12%2F10%2Fbash-wrappers-for-qstat-in-npaci-rocks-5-2-2%2F&amp;title=BASH%20%26%238211%3B%20Wrappers%20For%20qstat%20In%20NPACI%20ROCKS%205.2.2" 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/2009/12/10/bash-wrappers-for-qstat-in-npaci-rocks-5-2-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BASH &#8211; Wrappers For qstat In NPACI ROCKS</title>
		<link>http://sgowtham.net/blog/2008/10/13/bash-wrappers-for-qstat-in-npaci-rocks/</link>
		<comments>http://sgowtham.net/blog/2008/10/13/bash-wrappers-for-qstat-in-npaci-rocks/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 22:34:07 +0000</pubDate>
		<dc:creator>Gowtham</dc:creator>
				<category><![CDATA[AWK]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rocks]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://sgowtham.net/blog/?p=975</guid>
		<description><![CDATA[BASH is a free software UNIX shell written for the GNU Project. Its name is an acronym which stands for Bourne-again shell. The name is a pun on the name of the Bourne shell (sh), an early and important UNIX shell written by Stephen Bourne and distributed with Version 7 UNIX circa 1978, and the [...]]]></description>
			<content:encoded><![CDATA[<p>BASH is a free software UNIX shell written for the GNU Project. Its name is an acronym which stands for <em>Bourne-again shell</em>. The name is a pun on the name of the Bourne shell (<strong>sh</strong>), an early and important UNIX shell written by Stephen Bourne and distributed with Version 7 UNIX circa 1978, and the concept of being <em>born again</em>. BASH was created in 1987 by Brian Fox. In 1990 Chet Ramey became the primary maintainer. BASH is the default shell on most GNU/Linux systems as well as on Mac OS X and it can be run on most UNIX-like operating systems. It has also been ported to Microsoft Windows using the POSIX emulation provided by Cygwin, to MS-DOS by the DJGPP project and to Novell NetWare.</p>
<p>AWK is a general purpose programming language that is designed for processing text-based data, either in files or data streams, and was created at Bell Labs in the 1970s. The name AWK is derived from the family names of its authors — Alfred <strong>A</strong>ho, Peter <strong>W</strong>einberger, and Brian <strong>K</strong>ernighan; however, it is not commonly pronounced as a string of separate letters but rather to sound the same as the name of the bird, <strong>auk</strong>. <em>awk</em>, when written in all lowercase letters, refers to the UNIX or Plan 9 program that runs other programs written in the AWK programming language. AWK is an example of a programming language that extensively uses the string data type, associative arrays (that is, arrays indexed by key strings), and regular expressions. The power, terseness, and limitations of AWK programs and <strong>sed</strong> scripts inspired Larry Wall to write PERL. Because of their dense notation, all these languages are often used for writing one-liner programs. AWK is one of the early tools to appear in Version 7 UNIX and gained popularity as a way to add computational features to a UNIX pipeline. A version of the AWK language is a standard feature of nearly every modern UNIX-like operating system.</p>
<p><br clear="all"></p>
<h3 class="blog">What is ROCKS?</h3>
<p>Rocks Cluster Distribution (originally called NPACI Rocks) is a Linux distribution intended for high-performance computing clusters. It was started by NPACI and the SDSC in 2000, and was initially funded in part by an NSF grant (2000-2007)  but is currently funded by the followup NSF grant. Rocks was initially based on the Red Hat Linux distribution, however modern versions of Rocks are now based on CentOS, with a modified Anaconda installer that simplifies mass installation onto many computers. Rocks includes many tools (such as MPI) which are not part of CentOS but are integral components that make a group of computers into a cluster. Installations can be customized with additional software packages at install-time by using special user-supplied CDs (called <em>Roll CDs</em>). The Rolls extend the system by integrating seamlessly and automatically into the management and packaging mechanisms used by base software, greatly simplifying installation and configuration of large numbers of computers. Over a dozen Rolls have been created, including the SGE roll, the Condor roll, the Lustre roll, the Java roll, and the ganglia roll.</p>
<p><br clear="all"></p>
<h3 class="blog">General Wrapper for <strong>qstat</strong></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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Save this as /home/local/bin/qstat</span>
<span style="color: #666666; font-style: italic;"># A wrapper for 'qstat' command to show all currently submitted jobs along</span>
<span style="color: #666666; font-style: italic;"># with the total number processors used/in use</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Check the path to 'qstat'</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Thu, 02 Oct 2008 21:06:05 -0400</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Modify this variable to meet the cluster's requirements</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_TOTAL</span>=<span style="color: #ff0000;">&quot;128&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_INUSE</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print} (NR&gt;2) {used_procs+=\$9} END {print used_procs}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_AVAIL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$PROC_TOTAL</span> - <span style="color: #007800;">$PROC_INUSE</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JOBS_LIST</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$JOBS_LIST</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$PROC_TOTAL</span> total processors :: <span style="color: #007800;">$PROC_INUSE</span> are in use :: <span style="color: #007800;">$PROC_AVAIL</span> are available&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span></pre></td></tr></table></div>

<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20081013/qstat.png" alt="qstat General Wrapper" title="qstat General Wrapper"></p>
<p><br clear="all"></p>
<h3 class="blog">User Specific Wrapper for <strong>qstat</strong></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
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Save this as /home/local/bin/qu</span>
<span style="color: #666666; font-style: italic;"># A wrapper for 'qstat' command to show all currently submitted jobs by a given </span>
<span style="color: #666666; font-style: italic;"># user ($USER) along with the total number processors used/in use</span>
<span style="color: #666666; font-style: italic;"># If the $USER has no jobs, displays all currently submitted jobs.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Check the path to 'qstat'</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Thu, 02 Oct 2008 21:35:04 -0400</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Modify this variable to meet the cluster's requirements</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_TOTAL</span>=<span style="color: #ff0000;">&quot;128&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_INUSE</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print} (NR&gt;2) {used_procs+=\$9} END {print used_procs}'</span> <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> \
       <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PROC_AVAIL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$PROC_TOTAL</span> - <span style="color: #007800;">$PROC_INUSE</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JOBS_LIST</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat <span style="color: #660033;">-u</span> <span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">`</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;">$JOBS_LIST</span>&quot;</span> == <span style="color: #ff0000;">&quot;&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;">export</span> <span style="color: #007800;">JOBS_LIST</span>=<span style="color: #000000; font-weight: bold;">`/</span>opt<span style="color: #000000; font-weight: bold;">/</span>gridengine<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>lx26-amd64<span style="color: #000000; font-weight: bold;">/</span>qstat<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$JOBS_LIST</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span> 
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;   <span style="color: #007800;">$PROC_TOTAL</span> total processors :: <span style="color: #007800;">$PROC_INUSE</span> are in use :: <span style="color: #007800;">$PROC_AVAIL</span> are available&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'-----------------------------------------------------------------------------------------------------------------'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span></pre></td></tr></table></div>

<p><br clear="all"><br />
<img class="framed" src="http://sgowtham.net/blog/files/20081013/qu.png" alt="qstat User Specific Wrapper" title="qstat User Specific Wrapper"></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%2F10%2F13%2Fbash-wrappers-for-qstat-in-npaci-rocks%2F&amp;title=BASH%20%26%238211%3B%20Wrappers%20For%20qstat%20In%20NPACI%20ROCKS" 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/2008/10/13/bash-wrappers-for-qstat-in-npaci-rocks/feed/</wfw:commentRss>
		<slash:comments>0</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_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/2005/12/22/vasp-mpich-intel-compilers-and-npaci-rocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

