Opened 9 years ago

Closed 9 years ago

#48473 closed enhancement (fixed)

py-h5py @2.5.0_1: add parallel support

Reported by: petrrr Owned by: eborisch (Eric A. Borisch)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: seanfarley (Sean Farley), petrrr
Port: py-h5py

Description

This ticket requests the addition of parallel support (i.e. MPI mode).

See here for more details: http://docs.h5py.org/en/latest/build.html#building-against-parallel-hdf5

CAUTION:
The parallel build as documented on http://docs.h5py.org/en/latest/mpi.html#parallel talks about python setup.py build --mpi but this seems not to work.

Attachments (1)

Portfile.diff (2.6 KB) - added by petrrr 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by eborisch (Eric A. Borisch)

This should work, but I won't have time to dig into it for over a week.

You will need to have hdf5 +{some mpi flavor} installed. If anyone wants to test this out further and commit it, feel free.

Index: Portfile
===================================================================
--- Portfile	(revision 139023)
+++ Portfile	(working copy)
@@ -3,6 +3,7 @@

 PortSystem          1.0
 PortGroup           python 1.0
+PortGroup           mpi 1.0
 name                py-h5py

 version             2.5.0
@@ -53,10 +54,18 @@
     conflicts           py${python.version}-h5py-devel
 }

+if {[mpi_variant_isset]} {
+    pre-build {
+        system -W ${worksrcpath} "${python.bin} setup.py configure --mpi"
+    }
+    depends_lib-append      port:py${python.version}-mpi4py
+}
+
 python.default_version 27
 distname            h5py-${version}

 if {${name} ne ${subport}} {
+    mpi.setup
     depends_lib-append      port:py${python.version}-numpy \
                             port:py${python.version}-six \
                             port:py${python.version}-pkgconfig \

comment:2 Changed 9 years ago by petrrr

Hi eborisch, I am looking into it.

comment:3 Changed 9 years ago by petrrr

BTW: I missed to mention that this is related to ticket #45911.

I do not consider it however identical, as you might want to install py-h4py without MPI support enabled, but be still able to build (EDIT) even if a parallel HDF5 is already installed.

Last edited 9 years ago by petrrr (previous) (diff)

comment:4 Changed 9 years ago by eborisch (Eric A. Borisch)

Cc: petr@… added

You can still install py-h5py without MPI support; just don't select one of the MPI variants.

Updated version with variant checks for hdf5 and py-mpi4py (matching MPI implementations.)

Index: Portfile
===================================================================
--- Portfile	(revision 139072)
+++ Portfile	(working copy)
@@ -3,6 +3,7 @@
 
 PortSystem          1.0
 PortGroup           python 1.0
+PortGroup           mpi 1.0
 name                py-h5py
 
 version             2.5.0
@@ -57,6 +58,7 @@
 distname            h5py-${version}
 
 if {${name} ne ${subport}} {
+    mpi.setup
     depends_lib-append      port:py${python.version}-numpy \
                             port:py${python.version}-six \
                             port:py${python.version}-pkgconfig \
@@ -68,6 +70,15 @@
         copy ${worksrcpath}/lzf/LICENSE.txt \
             ${destroot}${prefix}/share/doc/${subport}
     }
+
+    if {[mpi_variant_isset]} {
+      mpi.enforce_variant   hdf5 \
+                            py${python.version}-mpi4py
+      pre-build {
+          system -W ${worksrcpath} "${python.bin} setup.py configure --mpi"
+      }
+      depends_lib-append    port:py${python.version}-mpi4py
+    }
 }
 
 livecheck.type      regex
Last edited 9 years ago by eborisch (Eric A. Borisch) (previous) (diff)

Changed 9 years ago by petrrr

Attachment: Portfile.diff added

comment:5 Changed 9 years ago by petrrr

I came up with a different solution using the configure phase and propose it in the provided diff. Anyway, the result should be equivalent. This already, solve a relevant issue for me, so if you are fine, I would like to commit this.

BTW: Just to clarify on the comments, I understand that installing h5py without variant will result in an installation without MPI support, if you are on clear ground. However, #45911 is about a failure to build h5py against a already installed parallel h5py. I tried to edit the comment above to become clearer. However, have no idea how this could be easily solved.

comment:6 Changed 9 years ago by petrrr

Resolution: fixed
Status: newclosed

I committed this in r139726.

Note: See TracTickets for help on using tickets.