aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Barbieri <lssndrbarbieri@gmail.com>2022-05-24 02:09:38 +0200
committerAlessandro Barbieri <lssndrbarbieri@gmail.com>2022-05-24 19:36:37 +0200
commit379bd24175680c4c373815de6b93e50fa7da0e50 (patch)
tree80704ac4190bc19ecc7cfad473a26f1ccc4aa71f /sys-cluster/psort
parentsys-cluster/Graph500: new package, add 1.2 (diff)
downloadguru-379bd24175680c4c373815de6b93e50fa7da0e50.tar.gz
guru-379bd24175680c4c373815de6b93e50fa7da0e50.tar.bz2
guru-379bd24175680c4c373815de6b93e50fa7da0e50.zip
sys-cluster/psort: new package, add 1.0
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Diffstat (limited to 'sys-cluster/psort')
-rw-r--r--sys-cluster/psort/Manifest1
-rw-r--r--sys-cluster/psort/files/psort-1.0-make_pair.patch77
-rw-r--r--sys-cluster/psort/files/psort-1.0-makefile.patch20
-rw-r--r--sys-cluster/psort/metadata.xml10
-rw-r--r--sys-cluster/psort/psort-1.0.ebuild34
5 files changed, 142 insertions, 0 deletions
diff --git a/sys-cluster/psort/Manifest b/sys-cluster/psort/Manifest
new file mode 100644
index 000000000..d17e2b517
--- /dev/null
+++ b/sys-cluster/psort/Manifest
@@ -0,0 +1 @@
+DIST psort-1.0.tar.gz 644944 BLAKE2B 55419576e3cbe3268f3a313f3a651a244825a147cef3f2a2ffb822494e63f6fd166d22b588f7e6753f85d8d0a241e603dfb2242b8f30cc21f2aa9b9a98b6251c SHA512 3d53f4d7002e12e0a7660d3e9a87cedead013a056537d6a472e87ef9043ec174cb55b43b767c7acefdce70a761db2ad004c2ef9776436a55638d1658c7b662e1
diff --git a/sys-cluster/psort/files/psort-1.0-make_pair.patch b/sys-cluster/psort/files/psort-1.0-make_pair.patch
new file mode 100644
index 000000000..cfc96c7bf
--- /dev/null
+++ b/sys-cluster/psort/files/psort-1.0-make_pair.patch
@@ -0,0 +1,77 @@
+--- a/src/funnel.h
++++ b/src/funnel.h
+@@ -204,7 +204,7 @@
+ };
+
+ inline void add_stream(RanIt begin, RanIt end)
+- { *last_stream++ = std::make_pair(begin,end); }
++ { *last_stream++ = std::pair(begin,end); }
+ inline stream_iterator begin()
+ { return stream_iterator(input_streams); }
+ inline stream_iterator end()
+--- a/src/psort_splitters.h
++++ b/src/psort_splitters.h
+@@ -87,8 +87,8 @@
+ // keep a list of ranges, trying to "activate" them at each branch
+ vector< pair<_RandomAccessIter, _RandomAccessIter> > d_ranges(nproc - 1);
+ vector< pair<_Distance *, _Distance *> > t_ranges(nproc - 1);
+- d_ranges[0] = make_pair(first, last);
+- t_ranges[0] = make_pair(targets, targets + (nproc - 1));
++ d_ranges[0] = pair(first, last);
++ t_ranges[0] = pair(targets, targets + (nproc - 1));
+
+ // invariant: subdist[i][rank] == d_ranges[i].second - d_ranges[i].first
+ // amount of data each proc still has in the search
+@@ -181,7 +181,7 @@
+ // sum to get the global range of indices
+ vector<pair<_Distance, _Distance> > ind_global(n_act);
+ for (int k = 0; k < n_act; ++k) {
+- ind_global[k] = make_pair(0, 0);
++ ind_global[k] = pair(0, 0);
+ for (int i = 0; i < nproc; ++i) {
+ ind_global[k].first += ind_all[2 * (i * n_act + k)];
+ ind_global[k].second += ind_all[2 * (i * n_act + k) + 1];
+@@ -223,9 +223,9 @@
+ }
+
+ if ((split_low - t_ranges[k].first) > 0) {
+- t_ranges_x[n_act_x] = make_pair (t_ranges[k].first, split_low);
++ t_ranges_x[n_act_x] = pair (t_ranges[k].first, split_low);
+ // lop off local_ind_low..end
+- d_ranges_x[n_act_x] = make_pair (d_ranges[k].first,
++ d_ranges_x[n_act_x] = pair (d_ranges[k].first,
+ first + ind_local[2 * k]);
+ for (int i = 0; i < nproc; ++i) {
+ subdist_x[n_act_x][i] = ind_all[2 * (i * n_act + k)] - outleft[k][i];
+@@ -235,9 +235,9 @@
+ }
+
+ if ((t_ranges[k].second - split_high) > 0) {
+- t_ranges_x[n_act_x] = make_pair (split_high, t_ranges[k].second);
++ t_ranges_x[n_act_x] = pair (split_high, t_ranges[k].second);
+ // lop off begin..local_ind_high
+- d_ranges_x[n_act_x] = make_pair (first + ind_local[2 * k + 1],
++ d_ranges_x[n_act_x] = pair (first + ind_local[2 * k + 1],
+ d_ranges[k].second);
+ for (int i = 0; i < nproc; ++i) {
+ subdist_x[n_act_x][i] = outleft[k][i]
+--- a/src/sort.timpl.h
++++ b/src/sort.timpl.h
+@@ -194,7 +194,7 @@
+ return *this;
+ }
+ std::pair<RanIt,RanIt> operator*()
+- { return make_pair(begin,end); }
++ { return pair(begin,end); }
+ bool operator==(const iterator& rhs)
+ { return begin == rhs.begin; }
+ private:
+@@ -251,7 +251,7 @@
+ begin_cache = end_cache = malloc.allocate(rec_calls);
+ for( Diff d=run_size; d>static_cast<Diff>(Splitter::switch_to_cache_aware()); d=run_size_<Splitter>(d), ++end_cache )
+ new(end_cache) Merger(Splitter::prefered_order_output(d), talloc);
+- return make_pair(begin_cache,end_cache);
++ return pair(begin_cache,end_cache);
+ }
+
+ template<class Merger, class Splitter, class It, class OutIt, class Alloc>
diff --git a/sys-cluster/psort/files/psort-1.0-makefile.patch b/sys-cluster/psort/files/psort-1.0-makefile.patch
new file mode 100644
index 000000000..6446f62ae
--- /dev/null
+++ b/sys-cluster/psort/files/psort-1.0-makefile.patch
@@ -0,0 +1,20 @@
+--- a/driver/Makefile
++++ b/driver/Makefile
+@@ -1,8 +1,7 @@
+ include ./Make.inc
+
+ psort: psort_driver.cc
+- $(CXX) $(CXXFLAGS) -I../src psort_driver.cc -o psort $(LIBS)
+- strip psort
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -fPIE -I../src psort_driver.cc -o psort $(LIBS)
+
+ clean:
+ rm -f *.o psort results
+--- a/driver/Make.inc
++++ b/driver/Make.inc
+@@ -1,4 +1,4 @@
+ CXX=mpic++
+-CXXFLAGS=-O2 -DUSE_FUNNEL -Wall
++CXXFLAGS+=-DUSE_FUNNEL -Wall
+ LIBS=-lm
+
diff --git a/sys-cluster/psort/metadata.xml b/sys-cluster/psort/metadata.xml
new file mode 100644
index 000000000..2fd3037bd
--- /dev/null
+++ b/sys-cluster/psort/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>lssndrbarbieri@gmail.com</email>
+ <name>Alessandro Barbieri</name>
+ </maintainer>
+ <longdescription lang="en">PSORT is a parallel sorting code for distributed and shared memory architectures. It uses MPI for communication, and is designed to minimize the volume of communication. It has been tested on terabyte datasets with up to 256 processors. It does not use sampling to locate splitters, and hence no prior knowledge of the probability distribution is required. It provides several options for splitting, sequential sorting and merging. A parallel sample sort is also included.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-cluster/psort/psort-1.0.ebuild b/sys-cluster/psort/psort-1.0.ebuild
new file mode 100644
index 000000000..2d116eb66
--- /dev/null
+++ b/sys-cluster/psort/psort-1.0.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2019-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Parallel sorting code for distributed and shared memory architectures"
+HOMEPAGE="https://web.archive.org/web/20181126115900/http://gauss.cs.ucsb.edu/code/index.shtml"
+SRC_URI="https://web.archive.org/web/20181126115900/http://gauss.cs.ucsb.edu/code/${PN}/${P}.tar.gz"
+
+LICENSE="MIT GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="virtual/mpi"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-make_pair.patch"
+ "${FILESDIR}/${P}-makefile.patch"
+)
+
+src_compile() {
+ pushd driver || die
+ emake
+ popd || die
+}
+
+src_install() {
+ dodoc README doc/psort.pdf
+ insinto "/usr/include/psort"
+ doins src/*.h driver/*.h
+ dobin driver/psort
+}