FS#73775 - [med] Open MPI support

Attached to Project: Community Packages
Opened by Gustavo Alvarez (sl1pkn07) - Sunday, 13 February 2022, 17:22 GMT
Last edited by Alexander F. Rødseth (xyproto) - Saturday, 06 August 2022, 19:30 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi

is possible add support openmpi? (-DMEDFILE_USE_MPI=ON)

greetings
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Saturday, 06 August 2022, 19:30 GMT
Reason for closing:  Implemented
Comment by Alexander F. Rødseth (xyproto) - Monday, 21 February 2022, 13:55 GMT
Thanks for the feature request.

When compiling med with `-DMEDFILE_USE_MPI=ON`, I got a couple of errors. This might not be related to hdf5, but I believe it would be an advantage that both hdf5 and med would support OpenMPI.


FAILED: src/CMakeFiles/medC.dir/MEDiterators.c.o
/usr/bin/cc -DH5_USE_16_API -DMPICH_IGNORE_CXX_SEEK -DNOGDI -DOMPI_IGNORE_CXX_SEEK -DmedC_EXPORTS -I/build/med/src/build/include -I/buic
In file included from /build/med/src/med-4.1.0/include/med_proto.h:33,
from /build/med/src/build/include/med.h:416,
from /build/med/src/med-4.1.0/src/MEDiterators.c:19:
/build/med/src/med-4.1.0/include/medfile.h:51:22: error: unknown type name ‘MPI_Comm’
51 | const MPI_Comm comm, const MPI_Info info);
| ^~~~~~~~
/build/med/src/med-4.1.0/include/medfile.h:51:43: error: unknown type name ‘MPI_Info’
51 | const MPI_Comm comm, const MPI_Info info);
| ^~~~~~~~
[3/1360] Building C object src/2.3.6/CMakeFiles/_med236.dir/MEDaffiche.c.o
[4/1360] Building C object src/2.3.6/cfi/CMakeFiles/_cfi236.dir/famcf231.c.o
[5/1360] Building C object src/2.3.6/cfi/CMakeFiles/_cfi236.dir/exitcf.c.o
[6/1360] Building C object src/2.3.6/cfi/CMakeFiles/_cfi236.dir/procf.c.o
[7/1360] Building C object src/CMakeFiles/med.dir/MEDiterators.c.o
FAILED: src/CMakeFiles/med.dir/MEDiterators.c.o
/usr/bin/cc -DH5_USE_16_API -DMPICH_IGNORE_CXX_SEEK -DOMPI_IGNORE_CXX_SEEK -Dmed_EXPORTS -I/build/med/src/build/include -I/build/med/src
In file included from /build/med/src/med-4.1.0/include/med_proto.h:33,
from /build/med/src/build/include/med.h:416,
from /build/med/src/med-4.1.0/src/MEDiterators.c:19:
/build/med/src/med-4.1.0/include/medfile.h:51:22: error: unknown type name ‘MPI_Comm’
51 | const MPI_Comm comm, const MPI_Info info);
| ^~~~~~~~
/build/med/src/med-4.1.0/include/medfile.h:51:43: error: unknown type name ‘MPI_Info’
51 | const MPI_Comm comm, const MPI_Info info);
|

Comment by Gustavo Alvarez (sl1pkn07) - Tuesday, 22 February 2022, 15:38 GMT
for me, i get this when try to build with hdf5-openmpi

[348/1360] Building C object src/hdfi/CMakeFiles/_hdfi.dir/_MEDattributeNumWrByName.c.o
FAILED: src/hdfi/CMakeFiles/_hdfi.dir/_MEDattributeNumWrByName.c.o
/usr/bin/mpicc -DH5_USE_16_API -DMPICH_IGNORE_CXX_SEEK -DOMPI_IGNORE_CXX_SEEK -I/tmp/makepkg/med-openmpi/src/build/include -I/tmp/makepkg/med-openmpi/src/med-4.1.0/include -march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -O3 -DNDEBUG -fPIC -MD -MT src/hdfi/CMakeFiles/_hdfi.dir/_MEDattributeNumWrByName.c.o -MF src/hdfi/CMakeFiles/_hdfi.dir/_MEDattributeNumWrByName.c.o.d -o src/hdfi/CMakeFiles/_hdfi.dir/_MEDattributeNumWrByName.c.o -c /tmp/makepkg/med-openmpi/src/med-4.1.0/src/hdfi/_MEDattributeNumWrByName.c
In file included from /usr/include/H5public.h:32,
from /usr/include/hdf5.h:22,
from /tmp/makepkg/med-openmpi/src/build/include/med.h:22,
from /tmp/makepkg/med-openmpi/src/med-4.1.0/src/hdfi/_MEDattributeNumWrByName.c:20:
/tmp/makepkg/med-openmpi/src/med-4.1.0/src/hdfi/_MEDattributeNumWrByName.c: In function '_MEDattributeNumWrByName':
/tmp/makepkg/med-openmpi/src/med-4.1.0/src/hdfi/_MEDattributeNumWrByName.c:71:10: error: too few arguments to function 'H5Oget_info3'
71 | if ( H5Oget_info( pid, &_oinfo ) <0) {
| ^~~~~~~~~~~
In file included from /usr/include/H5Apublic.h:22,
from /usr/include/hdf5.h:23,
from /tmp/makepkg/med-openmpi/src/build/include/med.h:22,
from /tmp/makepkg/med-openmpi/src/med-4.1.0/src/hdfi/_MEDattributeNumWrByName.c:20:
/usr/include/H5Opublic.h:497:15: note: declared here
497 | H5_DLL herr_t H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo, unsigned fields);
| ^~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Comment by Gustavo Alvarez (sl1pkn07) - Thursday, 24 February 2022, 23:22 GMT
ok. seems add this in the pkgbuild

CXX="mpicxx" \
CC="mpicc" \
FC="mpif90" \
F9X="mpif90" \
CFLAGS+=" -DH5_USE_18_API" \

and apply this patch: https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/med/files/med-4.1.0-0003-build-against-hdf5-1.12.patch?id=350ea3e89d0e87e35a3a4b5f2ce92b55aae9d226

do the trick.i'm able to build med with openmpi enabled, and using hdf5-openmpi package

can you try?

EDIT: https://aur.archlinux.org/pkgbase/med-openmpi (adopted and pushes my changes)
Comment by Alexander F. Rødseth (xyproto) - Friday, 05 August 2022, 23:33 GMT
Thanks for reporting. I'll look into adding med-openmpi to [community], either as a split or as a separate package.
Comment by Alexander F. Rødseth (xyproto) - Saturday, 06 August 2022, 17:44 GMT
I added med-openmpi to [community]. Please let me know if there are any particular improvements that can be made to it, or if there are issues with it. Thanks for creating and maintaining the med-openmpi package in AUR.

I should remove med-openmpi from AUR, since there is a name collision with the one in [community], but I see that it contains potentially useful documentation.

Do you wish to split out the documentation package before I remove it from AUR?

I'm also trying to build FreeCAD so that it uses med-openmpi and I'm hopeful that it'll work out.

Cheers!
Comment by Gustavo Alvarez (sl1pkn07) - Saturday, 06 August 2022, 18:13 GMT
yes, please, you can remove the package in aur. i have splitted the package in local

greetings

EDIT: you miss the sed for change the cmake files path. now if anyone want to make a 32-bits version of the package, gets a file collisions because the files is stored in architecture agnostic path (usr/shared/cmake)

please chage it like i do in the package in aur, for store the files in /usr/lib/cmake
Comment by Alexander F. Rødseth (xyproto) - Saturday, 06 August 2022, 19:30 GMT
Only 64-bit x86 is supported by official Arch Linux packages, but I'll make the change nevertheless. Thanks for testing!

Loading...