Giter VIP home page Giter VIP logo

Comments (5)

ggouaillardet avatar ggouaillardet commented on July 18, 2024

Thanks Jeff for the report, I will have a look.

I am able to reproduce the issue (with GNU compilers fwiw)
Fun fact: no error if i run in singleton mode and/or use romio

$ mpirun -np 1 ./d
 I am            0  of            1  of WORLD
 filename = "a        "
 open failed
 why? MPI_ERR_OTHER: known error not in list
 close failed
 why? MPI_ERR_FILE: invalid file
 delete failed
 why? MPI_ERR_FILE: invalid file
 filename = "aa       "
 done

$ mpirun -np 1 --mca io ^ompio ./d
 I am            0  of            1  of WORLD
 filename = "a        "
 filename = "aa       "
 done

$ ./d
 I am            0  of            1  of WORLD
 filename = "a        "
 filename = "aa       "
 done

from ompi.

ggouaillardet avatar ggouaillardet commented on July 18, 2024

singleton vs mpirun was fun but unrelated to the root cause.

here is a patch (opal_basename() does not correctly handle single character filename !), I will issue a PR later

diff --git a/opal/util/basename.c b/opal/util/basename.c
index 0a57b07078..ad873f2c7c 100644
--- a/opal/util/basename.c
+++ b/opal/util/basename.c
@@ -77,16 +77,18 @@ char *opal_basename(const char *filename)
 
     /* Remove trailing sep's (note that we already know that strlen > 0) */
     tmp = strdup(filename);
-    for (i = strlen(tmp) - 1; i > 0; --i) {
-        if (sep == tmp[i]) {
-            tmp[i] = '\0';
-        } else {
-            break;
+    if (1 < strlen(tmp)) {
+        for (i = strlen(tmp) - 1; i > 0; --i) {
+            if (sep == tmp[i]) {
+                tmp[i] = '\0';
+            } else {
+                break;
+            }
+        }
+        if (0 == i) {
+            tmp[0] = sep;
+            return tmp;
         }
-    }
-    if (0 == i) {
-        tmp[0] = sep;
-        return tmp;
     }
 
     /* Look for the final sep */

from ompi.

edgargabriel avatar edgargabriel commented on July 18, 2024

@ggouaillardet thank you for identifying the issue, can you file a PR with the fix?

from ompi.

ggouaillardet avatar ggouaillardet commented on July 18, 2024

Sorry for the delay, I just issued #12632

from ompi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.