Wednesday, January 26, 2022

[devel/openmpi]: documenting I/O issue in readme

Hello!

I've been having some issues with OpenMPI io capabilities for a while.
It seems that the default io component used (ompio) is still not working
with
OpenBSD (but it is not segfaulting anymore).

This can be resolved by changing to romio321 component as was
discussed here:
https://www.mail-archive.com/misc@openbsd.org/msg177085.html

Tested this with:
kern.version=OpenBSD 7.0-current (GENERIC.MP) #288
/usr/src/sys/arch/amd64/compile/GENERIC.MP

Do you think it would be useful to add a note in the openmpi README
(devel/openmpi/pkg/README) with the following changes (or with some
other more explicit / better comments of yours) + adding one C example?

Thanks!

Diff below:

--- README.orig Thu Jan 27 07:37:22 2022
+++ README Thu Jan 27 07:37:34 2022
@@ -29,6 +29,9 @@
PMIX_MCA_gds=hash
This is the one gds (general data service) that works on OpenBSD.

+ OMPI_MCA_io=romio321
+ This is the only IO component that seems to work on OpenBSD
+
**Example code taken from:
https://hpcc.usc.edu/support/documentation/examples-of-mpi-programs/

@@ -57,4 +60,48 @@
MPI_Finalize();

return 0;
+}
+
+
+** Example code taken from OpenBSD ML:
+ """ OpenMPI 4.0.5 segfault with mpi_file_open() """
+/*
+ * MPI test: creating a file
+ *
+ * Compile with:
+ * $ mpicc -o mpitest mpitest.c
+ *
+ * Run with:
+ * $ mpiexec --mca io romio321 ./mpitest
+ */
+
+#include <mpi.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ MPI_File fh;
+ int rank, sze;
+
+ MPI_Init(NULL,NULL);
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &sze);
+
+ printf("This is process %d / %d\n", rank+1, sze);
+
+ if(MPI_File_open(MPI_COMM_WORLD, "test.txt",
+ MPI_MODE_CREATE|MPI_MODE_WRONLY,
+ MPI_INFO_NULL, &fh))
+ {
+ printf("From process %d: Unable to create file"
+ "\"test.txt\" ...\n", rank);
+ fflush(stdout);
+ }
+ else
+ {
+ MPI_File_close(&fh);
+ }
+ MPI_Finalize();
+ return 0;
}

No comments:

Post a Comment