<?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>chys&#039;s random notes &#187; MPI</title>
	<atom:link href="http://en.chys.info/tag/mpi/feed/" rel="self" type="application/rss+xml" />
	<link>http://en.chys.info</link>
	<description>Study more problems; Talk less of isms.</description>
	<lastBuildDate>Tue, 27 Dec 2011 11:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SEEK_* Problem with MPICH2</title>
		<link>http://en.chys.info/2008/10/seek_-problem-with-mpich2/</link>
		<comments>http://en.chys.info/2008/10/seek_-problem-with-mpich2/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 21:29:00 +0000</pubDate>
		<dc:creator>chys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[MPI]]></category>

		<guid isPermaLink="false">http://blog.chys.info/2008/10/seek_-problem-with-mpich2/</guid>
		<description><![CDATA[This is a frequently encountered error when writing MPI programs in C++. /usr/include/mpicxx.h:26:2: error: #error &#8220;SEEK_SET is #defined but must not be for the C++ binding of MPI&#8221; /usr/include/mpicxx.h:30:2: error: #error &#8220;SEEK_CUR is #defined but must not be for the C++ binding of MPI&#8221; /usr/include/mpicxx.h:35:2: error: #error &#8220;SEEK_END is #defined but must not be for [...]<hr/>
Related posts:<ol>
<li><a href='http://en.chys.info/2008/10/another-vmware-problem/' rel='bookmark' title='Another VMware problem'>Another VMware problem</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a frequently encountered error when writing MPI programs in C++.</p>
<blockquote style="font-family: &quot;Courier New&quot;,Courier,monospace;"><p>/usr/include/mpicxx.h:26:2: error: #error &#8220;SEEK_SET is #defined but must not be for the C++ binding of MPI&#8221;<br />
/usr/include/mpicxx.h:30:2: error: #error &#8220;SEEK_CUR is #defined but must not be for the C++ binding of MPI&#8221;<br />
/usr/include/mpicxx.h:35:2: error: #error &#8220;SEEK_END is #defined but must not be for the C++ binding of MPI&#8221;</p></blockquote>
<p>
I remember (not very sure) it was MPICH2 that introduced this problem. It was not present in MPICH1.</p>
<p>This happens if <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&lt;mpi.h&gt;</span> is inlcuded AFTER some system headers like <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&lt;stdio.h&gt;</span> and <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&lt;iostream&gt;</span>. The workaround is simple: always include <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&lt;mpi.h&gt;</span> first in any C/C++ source that uses MPI APIs. (Another workaround is to pass <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">-DMPICH_IGNORE_CXX_SEEK</span> to mpicxx, but it seems this has other drawbacks. Do this only if you are unable to modify the sources.)</p>
<p>This certainly should be considered a bug of MPICH2: <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">SEEK_SET</span>, <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">SEEK_CUR</span>, and <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">SEEK_END</span> are constant symbols required by the ANSI C standard, but MPICH2 has global variables with exactly the same names. MPICH2 has not changed this, though they apparently have realized this problem for long. (Otherwise they could not have introduced <span style="font-family: &quot;Courier New&quot;,Courier,monospace;">MPICH_IGNORE_CXX_SEEK</span>. Probably they have binary compatibility concerns?)
<div class="blogger-post-footer">
<hr />
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.</div>
<hr/><p>Related posts:<ol>
<li><a href='http://en.chys.info/2008/10/another-vmware-problem/' rel='bookmark' title='Another VMware problem'>Another VMware problem</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://en.chys.info/2008/10/seek_-problem-with-mpich2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

