Closed jeffhammond closed 1 day ago
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
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 */
@ggouaillardet thank you for identifying the issue, can you file a PR with the fix?
Sorry for the delay, I just issued #12632
Should be fixed in 5.0.4 scheduled in 7/2024
I have a trivial MPI_F08 program that opens, closes and deletes a file. When the filename is "a", this fails. When the filename is "aa", it succeeds. When I create files "a" and "aa" using
touch
, the program still fails, but Open MPI deletes both files, despite saying thatMPI_File_delete
on "a" has failed.Background information
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
See above.
If you are building/installing from a git clone, please copy-n-paste the output from
git submodule status
.Please describe the system on which you are running
Details of the problem