Hello all -
I am running into an issue with OpenMPI 5.0.6, 5.0.9 (latest) that looks
like a bug in the MPI_File_open API.
If I try to open a file where the provided filename is very long (on my
system it looks like anything above 262ish characters has the issue) the
MPI_File_open call just segfaults immediately.
A small reproducer code is here:
> #include <mpi.h>
> #include <stdio.h>
> #include <string>
>
>
> int main (int argc, char** argv)
> {
>
> MPI_Init(&argc, &argv);
> MPI_File shortfile;
> MPI_File longfile;
> std::string long_filename =
> "longfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilenamelongfilename";
> std::string short_filename = "testfile.txt";
> printf("OPENING SHORT FILE\n");
> int fopen_short_error = MPI_File_open(MPI_COMM_WORLD,
> short_filename.c_str(), MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL,
> &shortfile);
> printf("SHORT FILE OPENED\n");
> MPI_File_close(&shortfile);
>
> printf("OPENING LONG FILE\n");
> int fopen_long_error = MPI_File_open(MPI_COMM_WORLD,
> long_filename.c_str(), MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL,
> &longfile);
> printf("LONG FILE OPENED\n");
> MPI_File_close(&longfile);
>
> MPI_Finalize();
> }
>
The output of this program is:
OPENING SHORT FILE
SHORT FILE OPENED
> OPENING LONG FILE
> [localhost:155795] *** Process received signal ***
> [localhost:155795] Signal: Segmentation fault (11)
> [localhost:155795] Signal code: (128)
> [localhost:155795] Failing at address: (nil)
> Segmentation fault (core dumped)
Has anyone seen this error before? As far as I can tell this is not an
issue with OpenMPI versions 4.x.x, and it is not a problem on MPICH,
IntelMPI, or HPCX (which is based on OpenMPI 4.x.x). I have not tried any
other MPI implementations.
Thanks,
Cooper
--
*Cooper Burns*
Team Lead - HPC
Convergent Science, 6400 Enterprise Lane, Madison, WI 53719
<https://maps.google.com/?q=6400+Enterprise+Lane,+Madison,+WI+53719&entry=gmail&source=g>
*Phone*: (608) 230-1551 <(608)%2301551>
Web <https://convergecfd.com/> | Linkedin
<https://www.linkedin.com/company/convergent-science-inc> | Facebook
<https://www.facebook.com/ConvergentScience/> | YouTube
<https://www.youtube.com/convergecfd>
--
*Join us at the 2025 CONVERGE CFD Conference–Global!*
CONFERENCE INFORMATION + REGISTRATION
<https://events.ringcentral.com/events/cfd25/registration>
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].