Gentoo Archives: gentoo-commits

From: Alessandro Barbieri <lssndrbarbieri@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: sys-cluster/sionlib/, sys-cluster/sionlib/files/
Date: Sun, 25 Apr 2021 01:01:30
Message-Id: 1619312466.8b1d3fec410cc64f8815b76dd8d413777eb19d65.Alessandro-Barbieri@gentoo
1 commit: 8b1d3fec410cc64f8815b76dd8d413777eb19d65
2 Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
3 AuthorDate: Sun Apr 25 01:01:06 2021 +0000
4 Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
5 CommitDate: Sun Apr 25 01:01:06 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8b1d3fec
7
8 sys-cluster/sionlib: new package
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
12
13 sys-cluster/sionlib/Manifest | 1 +
14 sys-cluster/sionlib/files/respect-flags.patch | 134 ++++++++++++++++++++++++++
15 sys-cluster/sionlib/metadata.xml | 34 +++++++
16 sys-cluster/sionlib/sionlib-1.7.6.ebuild | 104 ++++++++++++++++++++
17 4 files changed, 273 insertions(+)
18
19 diff --git a/sys-cluster/sionlib/Manifest b/sys-cluster/sionlib/Manifest
20 new file mode 100644
21 index 000000000..9046f5a2b
22 --- /dev/null
23 +++ b/sys-cluster/sionlib/Manifest
24 @@ -0,0 +1 @@
25 +DIST sionlib-1.7.6.tar.gz 486418 BLAKE2B 885eb2012ec6da031f5ae8b093ee4f3e5bbe31c9b24a11576f2ad01b32ddd8a85051565034f0e6c756af51409fb89f9c79f80b35c8337f2dc7912cb9e54d909b SHA512 afdd8520f489bc940edc51ffa636a25cad778de07bfbb21d2bd2ab767e57b16044990d85ef44d2e6482a376196f5c6a2a6f1a71556dd987f8094dd396a971d1c
26
27 diff --git a/sys-cluster/sionlib/files/respect-flags.patch b/sys-cluster/sionlib/files/respect-flags.patch
28 new file mode 100644
29 index 000000000..9ff5bd384
30 --- /dev/null
31 +++ b/sys-cluster/sionlib/files/respect-flags.patch
32 @@ -0,0 +1,134 @@
33 +diff '--color=auto' -ru a/config/determine-cc.sh b/config/determine-cc.sh
34 +--- a/config/determine-cc.sh 2021-04-25 01:09:35.175990108 +0200
35 ++++ b/config/determine-cc.sh 2021-04-25 01:10:02.876433713 +0200
36 +@@ -1,7 +1,6 @@
37 + #!/bin/sh
38 + # determine what compiler is behind "cc" (and presumably "CC" and "ftn") wrapper
39 +
40 +-CC=`which cc 2>/dev/null`
41 + COMP=
42 + if [ -z "$CC" ]; then
43 + echo "No 'cc' located!"
44 +diff '--color=auto' -ru a/config/select-compiler.sh b/config/select-compiler.sh
45 +--- a/config/select-compiler.sh 2021-04-25 01:09:35.175990108 +0200
46 ++++ b/config/select-compiler.sh 2021-04-25 01:10:26.882817842 +0200
47 +@@ -9,7 +9,7 @@
48 + CPS=""
49 + COMP=""
50 +
51 +-GNU=`which gcc 2> /dev/null`
52 ++GNU="${CC}"
53 + if [ -n "${GNU}" ]
54 + then
55 + NCPS=`expr ${NCPS} + 1`
56 +diff '--color=auto' -ru a/config/select-mpi.sh b/config/select-mpi.sh
57 +--- a/config/select-mpi.sh 2021-04-25 01:09:35.175990108 +0200
58 ++++ b/config/select-mpi.sh 2021-04-25 01:12:41.269962840 +0200
59 +@@ -76,7 +76,6 @@
60 + if [ -z "${MPIS}" ]; then MPIS="${MPI}"; else MPIS="${MPIS}|${MPI}"; fi
61 + fi
62 +
63 +-MPICC=`which mpicc 2> /dev/null`
64 + if [ -n "${MPICC}" ]
65 + then
66 + FMPI=""
67 +@@ -86,7 +85,7 @@
68 + MPIROOTDIR1=`dirname ${MBINDIR}`
69 +
70 + echo "#include <mpi.h>" > conftest.c
71 +- mpicc -E conftest.c | grep '/mpi.h"' | head -1 > mpiconf.txt
72 ++ "${MPICC}" -E conftest.c | grep '/mpi.h"' | head -1 > mpiconf.txt
73 + MINCDIR=`cat mpiconf.txt | sed -e 's#^.* "##' -e 's#/mpi.h".*##'`
74 + if [ -n "${MINCDIR}" ]
75 + then
76 +diff '--color=auto' -ru a/mf/Makefile.defs.linux-gomp b/mf/Makefile.defs.linux-gomp
77 +--- a/mf/Makefile.defs.linux-gomp 2021-04-25 01:09:35.119989211 +0200
78 ++++ b/mf/Makefile.defs.linux-gomp 2021-04-25 01:52:32.378951608 +0200
79 +@@ -23,24 +23,19 @@
80 + #------------------------------------------------------------------------------
81 + # SIONlib General Settings
82 + #------------------------------------------------------------------------------
83 +-OPTFLAGS = -g -O0 -Wall
84 ++CFLAGS += -std=c99 $(PFLAG) $(OPTFLAGS) -fPIC
85 +
86 +-CC = gcc
87 +-CFLAGS = -std=c99 $(PFLAG) $(OPTFLAGS) -fPIC
88 ++CXXFLAGS += $(PFLAG) $(OPTFLAGS) -fPIC
89 +
90 +-CXX = g++
91 +-CXXFLAGS = $(PFLAG) $(OPTFLAGS) -O3
92 +-
93 +-F77 = gfortran
94 +-FFLAGS = $(PFLAG) $(OPTFLAGS)
95 ++FFLAGS += $(PFLAG) $(OPTFLAGS) -fPIC
96 +
97 + F90 = $(F77)
98 +-F90FLAGS = $(PFLAG) $(OPTFLAGS) -ffree-form
99 ++F90FLAGS += $(PFLAG) $(OPTFLAGS) -ffree-form -fPIC $(FCFLAGS)
100 +
101 + FPP =
102 + FDOPT = -D
103 +
104 +-LDFLAGS = $(PFLAG) $(OPTFLAGS) $(HINTSLIB)
105 ++LDFLAGS += $(PFLAG) $(OPTFLAGS) $(HINTSLIB)
106 + UTILLIB =
107 + FOBASE = pomp_fwrapper_base.o
108 +
109 +@@ -101,10 +96,6 @@
110 + #------------------------------------------------------------------------------
111 +
112 + MPIENABLE = 1
113 +-MPICC = mpicc
114 +-MPICXX = mpicxx
115 +-MPIF77 = mpif77
116 +-MPIF90 = mpif90
117 + MPILIB = -lmpich
118 + PMPILIB = -lpmpich
119 + #PMPILIB = # MPICH2
120 +@@ -139,8 +130,7 @@
121 + #------------------------------------------------------------------------------
122 +
123 + SZLIB = szlib
124 +-SZLIB_OPTFLAGS = -O3
125 +-SZLIB_CFLAGS = -I$(TOPDIR)/utils/szlib -DELG_COMPRESSED -DCUBE_COMPRESSED
126 ++SZLIB_CFLAGS = -I$(TOPDIR)/utils/szlib -DELG_COMPRESSED -DCUBE_COMPRESSED $(CFLAGS)
127 + SZLIB_LIBPATH = -L$(TOPDIR)/utils/szlib
128 + SZLIB_LIB = -lsc.z
129 +
130 +diff '--color=auto' -ru a/src/fortraninterface/Makefile b/src/fortraninterface/Makefile
131 +--- a/src/fortraninterface/Makefile 2021-04-25 01:09:35.141989563 +0200
132 ++++ b/src/fortraninterface/Makefile 2021-04-25 01:23:48.055976593 +0200
133 +@@ -109,7 +110,7 @@
134 + $(CPP) $(F90FLAGS) $(F90FLAGS_CPP) -P -E -I ../lib sion_f90.F90 > sion_f90.f90
135 + sion_f90.mod : sion_f90.o
136 + sion_f90.o : sion_f90.f90 sion_f77.h $(SION_HDRS)
137 +- $(F90) -c sion_f90.f90
138 ++ $(F90) $(F90FLAGS) -c sion_f90.f90
139 +
140 + sion_f90_omp.o: sion_f90.o
141 + sion_f90_mpi.o: sion_f90.o
142 +@@ -121,21 +122,21 @@
143 + $(CPP) $(F90FLAGS) $(F90FLAGS_CPP) $(F90MPIFLAGS) -P -E -I ../lib sion_f90_mpi.F90 > sion_f90_mpi.f90
144 + sion_f90_mpi.mod : sion_f90_mpi.o
145 + sion_f90_mpi.o : sion_f90_mpi.f90 sion_f90.mod $(SION_HDRS)
146 +- $(MPIF90) -c sion_f90_mpi.f90
147 ++ $(MPIF90) $(F90FLAGS) $(F90MPIFLAGS) -c sion_f90_mpi.f90
148 +
149 + # F90 Interface (OMP)
150 + sion_f90_omp.f90: sion_f90_omp.F90
151 + $(CPP) $(F90OMPFLAGS) $(F90FLAGS) $(F90FLAGS_CPP) -P -E -I ../lib sion_f90_omp.F90 > sion_f90_omp.f90
152 + sion_f90_omp.mod : sion_f90_omp.o
153 + sion_f90_omp.o : sion_f90_omp.f90 sion_f90.mod $(SION_HDRS)
154 +- $(OMPF90) -c sion_f90_omp.f90
155 ++ $(OMPF90) $(F90FLAGS) $(F90OMPFLAGS) -c sion_f90_omp.f90
156 +
157 + # F90 Interface (OMPI)
158 + sion_f90_ompi.f90: sion_f90_ompi.F90 $(SION_HDRS)
159 + $(CPP) $(F90MPIFLAGS) $(F90OMPFLAGS) $(F90FLAGS) $(F90FLAGS_CPP) -P -E -I ../lib sion_f90_ompi.F90 > sion_f90_ompi.f90
160 + sion_f90_ompi.mod : sion_f90_ompi.o
161 + sion_f90_ompi.o : sion_f90_ompi.f90 $(SION_HDRS)
162 +- $(MPIF90) -c sion_f90_ompi.f90
163 ++ $(MPIF90) $(F90FLAGS) $(F90MPIFLAGS) -c sion_f90_ompi.f90
164 +
165 +
166 +
167
168 diff --git a/sys-cluster/sionlib/metadata.xml b/sys-cluster/sionlib/metadata.xml
169 new file mode 100644
170 index 000000000..2c7649717
171 --- /dev/null
172 +++ b/sys-cluster/sionlib/metadata.xml
173 @@ -0,0 +1,34 @@
174 +<?xml version="1.0" encoding="UTF-8"?>
175 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
176 +<pkgmetadata>
177 + <maintainer type="person">
178 + <email>lssndrbarbieri@×××××.com</email>
179 + <name>Alessandro Barbieri</name>
180 + </maintainer>
181 + <longdescription>
182 +SIONlib is a library for writing and reading data from several thousands of parallel tasks into/from one or a small number of physical files. Only the open and close functions are collective while file access can be performed independently.
183 +
184 +SIONlib can be used as a replacement for standard I/O APIs (e.g. POSIX) that are used to access distinct files from every parallel process. SIONlib will bundle the data into one or few files in a coordinated fashion in order to sidestep sequentialising mechanism in the file system. At the same time, the task-per-file picture is maintained for the application, every process has access to its logical file only. File access is performed using SIONlib equivalents to standard C-I/O functionality (fwrite becomes sion_write, fseek becomes sion_seek, etc.) which have similar semantics as their C counterparts.
185 +
186 +Internally, the physical files are sub-divided into sequences of blocks, which themselves contain one chunk of data belonging to every logical file. In case the amount to be written to a file is known up front, it can optionally be specified when opening the file and the sequence of blocks collapses into a single block with one chunk per task containing all of its data. If a chunk size cannot be specified ahead of time, a sensible default is chosen and reads and writes that cross chunk boundaries are handled transparently by SIONlib.
187 +
188 +SIONlib also uses information about the block size of the underlying file system, because access to the same block from different tasks often leads to contention.
189 +
190 +Both, the estimated chunk size and file system block size are used to align individual chunks with file system blocks. Ensuring contention-free access to file system blocks enables efficient parallel writing and reading.
191 +
192 +SIONlib provides two different interfaces: one for parallel access (with implementations for different parallel programming technologies such as MPI, OpenMP and hybrid MPI+OpenMP) and one for sequential access which is also used internally by the SIONlib utilities.
193 + </longdescription>
194 + <use>
195 + <!--<flag name="cuda">enable CUDA aware interface</flag>-->
196 + <flag name="cxx">Disable C++ support</flag>
197 + <flag name="debug">enable SIONlib debug</flag>
198 + <flag name="fortran">Enable Fortran support</flag>
199 + <flag name="mpi">enable mpi</flag>
200 + <flag name="python">enable python support</flag>
201 + <flag name="ompi">enable hybrid openmp mpi</flag>
202 + <flag name="openmp">enable openmp</flag>
203 + <flag name="parutils">Enable compilation of parutils (used for benchmarking)</flag>
204 + <flag name="pthreads">configure SIONlib to use pthreads for locking</flag>
205 + <!--<flag name="sionfwd">enable I/O forwarding with SIONfwd</flag>-->
206 + </use>
207 +</pkgmetadata>
208
209 diff --git a/sys-cluster/sionlib/sionlib-1.7.6.ebuild b/sys-cluster/sionlib/sionlib-1.7.6.ebuild
210 new file mode 100644
211 index 000000000..e1959dcc2
212 --- /dev/null
213 +++ b/sys-cluster/sionlib/sionlib-1.7.6.ebuild
214 @@ -0,0 +1,104 @@
215 +# Copyright 2019-2021 Gentoo Authors
216 +# Distributed under the terms of the GNU General Public License v2
217 +
218 +EAPI=7
219 +
220 +FORTRAN_NEEDED="fortran"
221 +PYTHON_COMPAT=( pypy3 python3_{7,8,9} )
222 +inherit flag-o-matic fortran-2 python-any-r1 toolchain-funcs
223 +
224 +DESCRIPTION="Scalable I/O library for parallel access to task-local files"
225 +HOMEPAGE="https://www.fz-juelich.de/ias/jsc/EN/Expertise/Support/Software/SIONlib/_node.html"
226 +SRC_URI="http://apps.fz-juelich.de/jsc/sionlib/download.php?version=${PV} -> ${P}.tar.gz"
227 +
228 +LICENSE="BSD"
229 +SLOT="0"
230 +KEYWORDS="~amd64"
231 +IUSE="+cxx debug doc +fortran +mpi +ompi +openmp +parutils +pthreads python"
232 +#TODO: cuda sionfwd msa
233 +#--enable-sionfwd=/path/to/sionfwd
234 +#--msa=(hostname-regex|deep-est-sdv)] MSA aware collective operations for the given system
235 +
236 +PATCHES=( "${FILESDIR}/respect-flags.patch" )
237 +
238 +RDEPEND="
239 + ${PYTHON_DEPS}
240 + mpi? ( virtual/mpi )
241 + ompi? (
242 + sys-libs/libomp
243 + virtual/mpi
244 + )
245 + openmp? ( sys-libs/libomp )
246 +"
247 +DEPEND="${RDEPEND}"
248 +BDEPEND="doc? ( app-doc/doxygen )"
249 +S="${WORKDIR}/${PN}"
250 +
251 +pkg_setup() {
252 + FORTRAN_NEED_OPENMP=0
253 + use openmp && FORTRAN_NEED_OPENMP=1
254 + use ompi && FORTRAN_NEED_OPENMP=1
255 +
256 + fortran-2_pkg_setup
257 +}
258 +
259 +src_configure() {
260 + export AR=$(tc-getAR)
261 + export CC=$(tc-getCC)
262 + export CXX=$(tc-getCXX)
263 + export MPICC=/usr/bin/mpicc
264 + export MPICXX=/usr/bin/mpicxx
265 + export MPIF77=/usr/bin/mpif77
266 + export MPIF90=/usr/bin/mpif90
267 + export F77=$(tc-getF77)
268 + export F90=$(tc-getFC)
269 + export OMPF77=$(tc-getF77)
270 + export OMPF90=$(tc-getFC)
271 +
272 + append-fflags -fallow-argument-mismatch
273 +
274 + local myconf=(
275 + --disable-mic
276 + --prefix="${EPREFIX}/usr"
277 + )
278 +
279 + #custom configure?
280 + use cxx || myconf+=( "--disable-cxx" )
281 + use fortran || myconf+=( "--disable-fortran" )
282 + use mpi || myconf+=( "--disable-mpi" )
283 + use ompi || myconf+=( "--disable-ompi" )
284 + use openmp || myconf+=( "--disable-omp" )
285 + use parutils || myconf+=( "--disable-parutils" )
286 + use pthreads || myconf+=( "--disable-pthreads" )
287 +
288 + use debug && myconf+=( "--enable-debug" )
289 + use python && myconf+=( "--enable-python=3" )
290 +
291 + ./configure "${myconf[@]}" || die
292 +}
293 +
294 +src_compile() {
295 + default
296 + use doc && doxygen -u doxy && doxygen doxy || die
297 +}
298 +
299 +src_install() {
300 + sed -e "s|\${PREFIX}|${D}/usr|g" -i mf/common.defs || die
301 + sed -e "s|\$(PREFIX)|${D}/usr|g" -i src/utils/Makefile || die
302 + sed \
303 + -e "s|\$(PREFIX)|${D}/usr|g" \
304 + -e "s|\${PREFIX}|${D}/usr|g" \
305 + -i mf/RealMakefile || die
306 +
307 + default
308 +
309 + use doc && dodoc -r doc/html
310 +
311 + mv "${ED}/usr/examples" "${ED}/usr/share/doc/${PF}/" || die
312 + docompress -x "/usr/share/doc/${PF}/examples"
313 + docompress -x "/usr/share/doc/${PF}/html"
314 +
315 + #TODO: build shared libs
316 + #find "${ED}" -name '*.a' -delete || die
317 + find "${ED}" -name '*.la' -delete || die
318 +}