<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 12/30/09 12:36 AM, Burak ISIKLI wrote:
<blockquote cite="mid:194807.28812.qm@web63108.mail.re1.yahoo.com"
type="cite"><span class="Apple-style-span"
style="font-family: verdana,arial,helvetica; font-size: 12px;">
<p><span class="Apple-style-span"
style="font-family: verdana,helvetica,sans-serif; font-size: x-small;"><span
class="Apple-style-span"
style="font-family: verdana,arial,helvetica; font-size: 12px;">The
mistake is not in your application per se. MPI I/O is not </span></span></p>
</span><span class="Apple-style-span"
style="font-family: verdana,arial,helvetica; font-size: 12px;">intended
to read in general text files - it is intended for reading <br>
files written by the MPI I/O interface. It definitely doesn't do the <br>
string to integer conversion necessary to read in your input file. </span>
<div><font class="Apple-style-span" face="verdana, arial, helvetica"
size="3"><span class="Apple-style-span" style="font-size: 12px;"><br>
</span></font></div>
</blockquote>
<br>
The MPI I/O specifies function for *binary* input/output. The problem
with your application is not that you read a file which wasn't written
with an MPI application but rather that you try to read an ASCII file.<br>
<br>
You can parse the input you read using e.g. sscanf() much like you
would read from a file stream. The problem with ASCII files (in many
situations I came across) however is that you don't know which part of
the file should be read by which process as the number of bytes e.g.
for representing a 32 bit integer depends on its value (for example the
"1" needs only one byte whereas "10" requires two bytes). Therefore
typically you can't say: Read the first xxx bytes on proc 0, the next
yyy bytes on proc 1 and so forth.<br>
If all your files have the same line length (padded by widespaces) you
can read them easily but it is easy to mess up your input...<br>
<br>
Regards,<br>
Dorian<br>
<br>
<br>
<br>
</body>
</html>