Hello everyone,
I'm all new to the OpenBSD world and decided to go full OpenBSD on my
thinkpad (T480). Yesterday, I installed devel/openmpi from packages
but it is not
working as expected (I'm surely doing something wrong as my tests are
extremely basic and are working on a linux live image).
Those are the steps I did after installing OpenBSD 6.8 - AMD64
(RELEASE or CURRENT) with default disk layout:
$> pkg_add gcc g95 openmpi gdb
$> mpirun --version
mpirun (Open MPI) 4.0.5
$> mpicc --version
egcc (GCC) 8.4.0
## Program I'm trying to run: mpitest.c ##
/* MPI test creating file */
#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("Unable to create file \"test.txt\" ...");
fflush(stdout);
}
else
{
MPI_File_close(&fh);
}
MPI_Finalize();
return 0;
}
## RUN PROGRAM:
According to /usr/local/share/doc/pkg-readmes/openmpi:
$> export OMPI_MCA_btl=self,tcp,vader
$> export OMPI_MCA_mpi_yield_when_idle=1
$> export PMIX_MCA_gds=hash
$> mpicc -o mpitest mpitest.c
$> mpirun -np 1 -H localhost:1 ./mpitest
This is process 1/1
[test:31721] *** Process received signal ***
[test:31721] Signal: Segmentation fault (11)
[test:31721] Signal code: Address not mapped (1)
[test:31721] Failing at address: 0x130
-------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job hase beed aborted.
-------------------------------------------------
-------------------------------------------------
mpirun noticed that process rank 0 with PID 0 on node test exited on
signal 11 (Segmentation fault)
## END RUN PROGRAM
## RESULT OF GDB BACKTRACE ##
$> egdb ./mpitest
(...)
(gdb) run
Starting program: /home/test/mpitest
[New process 47898]
This is process 1/1
[New thread 123113]
[New thread 580170]
Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000a58bd673c3 in mca_common_ompio_file_close() from
/usr/local/lib/libmca_common_ompio.so.2.0
(gdb) backtrace
#0 0x000000a58bd673c3 in mca_common_ompio_file_close () from
/usr/local/lib/libmca_common_ompio.so.2.0
#1 0x000000a5ba9f15dc in mca_io_ompio_file_close () from
/usr/local/lib/openmpi/mca_io_ompio.so
#2 0x000000a5268c572c in file_destructor () from
/usr/local/lib/libmpi.so.5.0
#3 0x000000a5268c5cb9 in ompi_file_open () from
/usr/local/lib/libmpi.so.5.0
#4 0x000000a5268ef055 in PMPI_File_open () from
/usr/local/lib/libmpi.so.5.0
#5 0x000000a2c7864e5c in main ()
## END GDB RESULT ##
## FORTRAN TEST
I tried the same example using fortran (Fortran program not shown):
$> mpifort --version
GNU Fortran (GCC) 8.4.0
$> mpifort -o fmpitest fmpitest.f90
$> mpirun -np 1 -H localhost:1 ./fmpitest
fmpitest:/usr/local/lib/libmpi.so.5.0: ./fmpitest : WARNING:
symbol(mpi_fortran_statuses_ignore_) size mismatch,
relink your program
fmpitest:/usr/local/lib/libmpi.so.5.0: ./fmpitest : WARNING:
symbol(mpi_fortran_status_ignore_) size mismatch,
relink your program
Program received signal SIGSEGV: Segmentation fault -
invalid memory reference
(...)
## END OF FORTRAN TEST
## QUESTIONS
** Could anyone tell me what I'm doing wrong as those codes are compiling
fine on linux liveUSB ?
** Are those warnings from openmpi-fortran safe to ignore?
Thank you very much!
Martin
$> uname -a
OpenBSD test.localhost 6.8 GENERIC.MP#98 amd64
PS: These errors appear in OpenBSD 6.8 Release OR Current
(1 snapshot per day tested for the last 5 days) on my thinkpad.