1 |
commit: e234874cf1d691f83ba3cd3755226b8a9e53a367 |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 30 16:27:30 2011 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 16:27:30 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=e234874c |
7 |
|
8 |
[sys-cluster/mvapich2] Move and version bump for mvapich2 |
9 |
|
10 |
(Portage version: 2.2.0_alpha41/git/Linux x86_64, signed Manifest commit with key F82F92E6) |
11 |
|
12 |
--- |
13 |
sys-cluster/mvapich2/files/eselect.mpi.mvapich2 | 8 ++ |
14 |
sys-cluster/mvapich2/metadata.xml | 14 ++ |
15 |
sys-cluster/mvapich2/mvapich2-1.6.ebuild | 155 +++++++++++++++++++++++ |
16 |
3 files changed, 177 insertions(+), 0 deletions(-) |
17 |
|
18 |
diff --git a/sys-cluster/mvapich2/files/eselect.mpi.mvapich2 b/sys-cluster/mvapich2/files/eselect.mpi.mvapich2 |
19 |
new file mode 100644 |
20 |
index 0000000..d1d2131 |
21 |
--- /dev/null |
22 |
+++ b/sys-cluster/mvapich2/files/eselect.mpi.mvapich2 |
23 |
@@ -0,0 +1,8 @@ |
24 |
+MPI_CC=@ROOT@/usr/bin/mpicc |
25 |
+MPI_CXX=@ROOT@/usr/bin/mpic++ |
26 |
+MPI_F77=@ROOT@/usr/bin/mpif77 |
27 |
+MPI_F90=@ROOT@/usr/bin/mpif90 |
28 |
+MPI_BUILT_WITH=@BUILT_WITH@ |
29 |
+PATH=@ROOT@/usr/bin |
30 |
+MANPATH=@ROOT@/usr/share/man |
31 |
+LD_LIBRARY_PATH=@ROOT@/usr/@LIBDIR@ |
32 |
|
33 |
diff --git a/sys-cluster/mvapich2/metadata.xml b/sys-cluster/mvapich2/metadata.xml |
34 |
new file mode 100644 |
35 |
index 0000000..a5a0043 |
36 |
--- /dev/null |
37 |
+++ b/sys-cluster/mvapich2/metadata.xml |
38 |
@@ -0,0 +1,14 @@ |
39 |
+<?xml version="1.0" encoding="UTF-8"?> |
40 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
41 |
+<pkgmetadata> |
42 |
+ <herd>cluster</herd> |
43 |
+ <longdescription> |
44 |
+MVAPICH2 MPI-over-infiniband package auto-configured for OpenIB. |
45 |
+</longdescription> |
46 |
+ <use> |
47 |
+ <flag name="large-cluster">Automatically generated description for large-cluster</flag> |
48 |
+ <flag name="medium-cluster">Automatically generated description for medium-cluster</flag> |
49 |
+ <flag name="rdma">Automatically generated description for rdma</flag> |
50 |
+ <flag name="romio">Automatically generated description for romio</flag> |
51 |
+ </use> |
52 |
+</pkgmetadata> |
53 |
|
54 |
diff --git a/sys-cluster/mvapich2/mvapich2-1.6.ebuild b/sys-cluster/mvapich2/mvapich2-1.6.ebuild |
55 |
new file mode 100644 |
56 |
index 0000000..b9c7ed4 |
57 |
--- /dev/null |
58 |
+++ b/sys-cluster/mvapich2/mvapich2-1.6.ebuild |
59 |
@@ -0,0 +1,155 @@ |
60 |
+# Copyright 1999-2011 Gentoo Foundation |
61 |
+# Distributed under the terms of the GNU General Public License v2 |
62 |
+# $Header: $ |
63 |
+ |
64 |
+inherit fortran-2 mpi |
65 |
+ |
66 |
+DESCRIPTION="MVAPICH2 MPI-over-infiniband package auto-configured for OpenIB" |
67 |
+HOMEPAGE="http://mvapich.cse.ohio-state.edu/" |
68 |
+SRC_URI="${HOMEPAGE}/download/mvapich2/mvapich2-${PV/_/-}.tgz" |
69 |
+ |
70 |
+SLOT="0" |
71 |
+LICENSE="BSD" |
72 |
+KEYWORDS="~x86 ~amd64" |
73 |
+IUSE="debug fortran large-cluster medium-cluster rdma romio threads" |
74 |
+ |
75 |
+RDEPEND=" |
76 |
+ || ( |
77 |
+ ( |
78 |
+ sys-infiniband/libibverbs |
79 |
+ sys-infiniband/libibumad |
80 |
+ sys-infiniband/libibmad |
81 |
+ rdma? ( sys-infiniband/librdmacm ) ) |
82 |
+ sys-infiniband/openib-userspace )" |
83 |
+DEPEND="${RDEPEND}" |
84 |
+ |
85 |
+S="${WORKDIR}/mvapich2-${PV/_/-}" |
86 |
+ |
87 |
+pkg_setup() { |
88 |
+ fortran-2_pkg_setup |
89 |
+ MPI_ESELECT_FILE="eselect.mpi.mvapich2" |
90 |
+ |
91 |
+ if [ -z "${MVAPICH_HCA_TYPE}" ]; then |
92 |
+ elog "${PN} needs to know which HCA it should optimize for. This is" |
93 |
+ elog "passed to the ebuild with the variable, \${MVAPICH_HCA_TYPE}." |
94 |
+ elog "Please choose one of: _MLX_PCI_EX_SDR_, _MLX_PCI_EX_DDR_," |
95 |
+ elog "_MLX_PCI_X, _PATH_HT_, or _IBM_EHCA_." |
96 |
+ elog "See make.mvapich2.detect in ${S} for more information." |
97 |
+ die "MVAPICH_HCA_TYPE undefined" |
98 |
+ fi |
99 |
+ |
100 |
+ case ${ARCH} in |
101 |
+ amd64) |
102 |
+ if grep Intel /proc/cpuinfo &>/dev/null; then |
103 |
+ BUILD_ARCH=-D_EM64T_ |
104 |
+ else |
105 |
+ BUILD_ARCH=-D_X86_64_ |
106 |
+ fi |
107 |
+ ;; |
108 |
+ x86) |
109 |
+ BUILD_ARCH=-D_IA32_ |
110 |
+ ;; |
111 |
+ ia64) |
112 |
+ BUILD_ARCH=-D_IA64_ |
113 |
+ ;; |
114 |
+ ppc64) |
115 |
+ BUILD_ARCH=-D_PPC64_ |
116 |
+ ;; |
117 |
+ *) |
118 |
+ die "unsupported architecture: ${ARCH}" |
119 |
+ ;; |
120 |
+ esac |
121 |
+} |
122 |
+ |
123 |
+src_unpack() { |
124 |
+ unpack ${A} |
125 |
+ cd "${S}" |
126 |
+ einfo "Disabling examples" |
127 |
+ # Examples are always compiled with the default 'all' target. This |
128 |
+ # causes problems when we don't build support for everything, including |
129 |
+ # threads, mpe2, etc. So we're not going to build them. |
130 |
+ sed -i 's:.*cd examples && ${MAKE} all.*::' Makefile.in |
131 |
+} |
132 |
+ |
133 |
+src_compile() { |
134 |
+ local c="--with-device=osu_ch3:mrail |
135 |
+ --with-rdma=gen2 |
136 |
+ --with-pm=mpd |
137 |
+ $(use_enable romio) |
138 |
+ --with-mpe=no" |
139 |
+ |
140 |
+ # TODO Shared libs should build with this, but they don't |
141 |
+ # --enable-shared=gcc" |
142 |
+ |
143 |
+ local enable_srq |
144 |
+ local vcluster=-D_SMALL_CLUSTER |
145 |
+ |
146 |
+ use large-cluster && vcluster=-D_LARGE_CLUSTER |
147 |
+ use medium-cluster && vcluster=-D_MEDIUM_CLUSTER |
148 |
+ [ "${MVAPICH_HCA_TYPE}" == "_MLX_PCI_X_" ] && enable_srq="-DSRQ" |
149 |
+ |
150 |
+ if use rdma; then |
151 |
+ append-ldflags "-lrdmacm" |
152 |
+ append-flags "-DADAPTIVE_RDMA_FAST_PATH -DRDMA_CM" |
153 |
+ fi |
154 |
+ append-ldflags "-libverbs -libumad -libmad" |
155 |
+ |
156 |
+ append-flags "${BUILD_ARCH} -DUSE_INLINE -D_SMP_ -D_GNU_SOURCE" |
157 |
+ append-flags "${enable_srq} -DUSE_HEADER_CACHING -DLAZY_MEM_UNREGISTER" |
158 |
+ append-flags "-DONE_SIDED -D${MVAPICH_HCA_TYPE} ${vcluster}" |
159 |
+ append-flags "-DMPID_USE_SEQUENCE_NUMBERS -DUSE_MPD_RING" |
160 |
+ |
161 |
+ use debug && c="${c} --enable-g=all --enable-debuginfo" |
162 |
+ |
163 |
+ if use threads; then |
164 |
+ c="${c} --enable-threads=multiple --with-thread-package=pthreads" |
165 |
+ append-flags "-pthread" |
166 |
+ else |
167 |
+ c="${c} --with-thread-package=none" |
168 |
+ fi |
169 |
+ |
170 |
+ # enable f90 support for appropriate compilers |
171 |
+ if use fortran; then |
172 |
+ case "$(tc-getFC)" in |
173 |
+ gfortran|ifort|f95) |
174 |
+ c="${c} --enable-f77 --enable-f90";; |
175 |
+ g77|f77|f2c) |
176 |
+ c="${c} --enable-f77 --disable-f90";; |
177 |
+ esac |
178 |
+ else |
179 |
+ c="${c} --disable-f77 --disable-f90" |
180 |
+ fi |
181 |
+ |
182 |
+ sed -i \ |
183 |
+ -e 's/ ${exec_prefix}/ ${DESTDIR}${exec_prefix}/' \ |
184 |
+ -e 's/ ${libdir}/ ${DESTDIR}${libdir}/' \ |
185 |
+ ${S/-beta2/}/Makefile.in |
186 |
+ sed -i '/bindir/s/ ${bindir}/ ${DESTDIR}${bindir}/' ${S/-beta2/}/src/pm/mpd/Makefile.in |
187 |
+ cd ${S/-beta2/} |
188 |
+ |
189 |
+ ! mpi_classed && c="${c} --sysconfdir=/etc/${PN}" |
190 |
+ econf $(mpi_econf_args) ${c} |
191 |
+ |
192 |
+ # http://www.mcs.anl.gov/research/projects/mpich2/support/index.php?s=faqs#parmake |
193 |
+ # https://trac.mcs.anl.gov/projects/mpich2/ticket/297 |
194 |
+ emake -j1 || die |
195 |
+ |
196 |
+} |
197 |
+ |
198 |
+src_install() { |
199 |
+ emake DESTDIR="${D}"|| die |
200 |
+ mpi_dodoc CHANGES_MPICH2 COPYRIGHT COPYRIGHT_MVAPICH2 LICENSE.TXT \ |
201 |
+ README* RELEASE_NOTES* |
202 |
+ mpi_imp_add_eselect |
203 |
+} |
204 |
+ |
205 |
+pkg_postinst() { |
206 |
+ einfo "To allow normal users to use infiniband, it is necessary to" |
207 |
+ einfo "increase the system limits on locked memory." |
208 |
+ einfo "You must increase the kernel.shmmax sysctl value, and increase" |
209 |
+ einfo "the memlock limits in /etc/security/limits.conf. i.e.:" |
210 |
+ echo |
211 |
+ einfo "echo 'kernel.shmmax = 512000000' >> /etc/sysctl.conf" |
212 |
+ einfo "echo 512000000 > /proc/sys/kernel/shmmax" |
213 |
+ einfo "echo -e '* soft memlock 500000\n* hard memlock 500000' > /etc/security/limits.conf" |
214 |
+} |