<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffcc" text="#000066">
<tt>Tristan,<br>
<br>
You're right on 2. It all looks good to me.<br>
<br>
Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com"><Marcos.Matsunaga@oracle.com></a><br>
</tt>
<pre class="moz-signature" cols="72">Regards,
Marcos Eduardo Matsunaga
Oracle USA
Linux Engineering
“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
<br>
Tristan Ye wrote:
<blockquote
cite="mid:1221641330-31705-4-git-send-email-tristan.ye@oracle.com"
type="cite">
<pre wrap="">1.Truncate strcmp operation in the beginning of parse_opts,otherwise it
will cause a segmentation fault error under openmpi environment when we
leave all arguments empty.
2.Make the filename as a constant one.if it was postfixed with the
node's hostname,will definitely hit a bug when we only got 2 banks among
2 nodes:the created file will never be deleted!
For this test,we have rank0 do the file creation,and the rest
ranks take a race to delete,am I making a wrong understanding?
3.Adjust the error print to show us the real error string and ret code.
Signed-off-by: Tristan Ye <a class="moz-txt-link-rfc2396E" href="mailto:tristan.ye@oracle.com"><tristan.ye@oracle.com></a>
---
programs/open_delete/open_delete.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/programs/open_delete/open_delete.c b/programs/open_delete/open_delete.c
index e89a2a8..8bf98eb 100644
--- a/programs/open_delete/open_delete.c
+++ b/programs/open_delete/open_delete.c
@@ -76,8 +76,6 @@ static int parse_opts(int argc, char **argv)
{
        int c;
-        if (strcmp(argv[1],"-h") == 0)
-                return EINVAL;
        while (1) {
                c = getopt(argc, argv, "i:");
                if (c == -1)
@@ -127,6 +125,7 @@ open_after:
        ret = unlink(filename);
        if ( ret ) {
+                ret = errno;
                printf("%s (rank %d): ", hostname, rank);
                printf("Error %d deleteing file \"%s\": %s\n",
                         ret, filename, strerror(ret));
@@ -175,7 +174,7 @@ int main(int argc, char *argv[])
        }
        strcat(filename, "_");
-        strcat(filename, hostname);
+        strcat(filename, "open_and_delete-test-file");
        ret = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (ret != MPI_SUCCESS)
</pre>
</blockquote>
</body>
</html>