jskarvad pushed to hpl (master). "Initial import (#830869)"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri May 15 13:28:09 UTC 2015


From 6b1623573251b5abc207b615a6f811d9e0e89575 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad at redhat.com>
Date: Fri, 15 May 2015 15:27:57 +0200
Subject: Initial import (#830869)


diff --git a/.gitignore b/.gitignore
index e69de29..4cf6767 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/hpl-2.1.tar.gz
diff --git a/hpl-2.1-fedora.patch b/hpl-2.1-fedora.patch
new file mode 100644
index 0000000..d9c3776
--- /dev/null
+++ b/hpl-2.1-fedora.patch
@@ -0,0 +1,87 @@
+diff --git a/setup/Make.Linux_PII_CBLAS_gm b/setup/Make.Linux_PII_CBLAS_gm
+index b1c6401..7855ab0 100644
+--- a/setup/Make.Linux_PII_CBLAS_gm
++++ b/setup/Make.Linux_PII_CBLAS_gm
+@@ -56,6 +56,14 @@ LN_S         = ln -s
+ MKDIR        = mkdir
+ RM           = /bin/rm -f
+ TOUCH        = touch
++
++LBITS := $(shell getconf LONG_BIT)
++ifeq ($(LBITS),64)
++  SYSLIBDIR=/usr/lib64
++else
++  SYSLIBDIR=/usr/lib
++endif
++
+ #
+ # ----------------------------------------------------------------------
+ # - Platform identifier ------------------------------------------------
+@@ -92,9 +100,9 @@ MPlib        =
+ # header files,  LAlib  is defined  to be the name of  the library to be
+ # used. The variable LAdir is only used for defining LAinc and LAlib.
+ #
+-LAdir        = $(HOME)/netlib/ARCHIVES/Linux_PII
++LAdir        = $(SYSLIBDIR)/atlas
+ LAinc        =
+-LAlib        = $(LAdir)/libcblas.a $(LAdir)/libatlas.a
++LAlib        = -L$(LAdir) -lcblas -latlas
+ #
+ # ----------------------------------------------------------------------
+ # - F77 / C interface --------------------------------------------------
+@@ -168,7 +176,7 @@ HPL_DEFS     = $(F2CDEFS) $(HPL_OPTS) $(HPL_INCLUDES)
+ #
+ CC           = mpicc
+ CCNOOPT      = $(HPL_DEFS)
+-CCFLAGS      = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall
++CCFLAGS      = $(HPL_DEFS) $(CFLAGS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall
+ #
+ # On some platforms,  it is necessary  to use the Fortran linker to find
+ # the Fortran internals used in the BLAS library.
+diff --git a/testing/ptest/HPL_pdinfo.c b/testing/ptest/HPL_pdinfo.c
+index e24530e..fd1ec80 100644
+--- a/testing/ptest/HPL_pdinfo.c
++++ b/testing/ptest/HPL_pdinfo.c
+@@ -48,6 +48,8 @@
+  * Include files
+  */
+ #include "hpl.h"
++#include <stdlib.h>
++#include <string.h>
+ 
+ #ifdef STDC_HEADERS
+ void HPL_pdinfo
+@@ -275,6 +277,8 @@ void HPL_pdinfo
+    char                       * lineptr;
+    int                        error=0, fid, i, j, lwork, maxp, nprocs,
+                               rank, size;
++   char                       * confdir = NULL;
++   char                       conffile[1024] = {0};
+ /* ..
+  * .. Executable Statements ..
+  */
+@@ -291,14 +295,22 @@ void HPL_pdinfo
+  */
+    if( rank == 0 )
+    {
++      if ( ( confdir = getenv("MPI_SYSCONFIG") ) == NULL )
++         strcpy(conffile, "/etc");
++      else
++         strncpy(conffile, confdir, 1023);
++
++      strncat(conffile, "/hpl/HPL.dat", 1023);
++
+ /*
+  * Open file and skip data file header
+  */
+-      if( ( infp = fopen( "HPL.dat", "r" ) ) == NULL )
++      if( ( infp = fopen( "HPL.dat", "r" ) ) == NULL &&
++          ( infp = fopen( conffile, "r" ) ) == NULL )
+       { 
+          HPL_pwarn( stderr, __LINE__, "HPL_pdinfo",
+                     "cannot open file HPL.dat" );
+-         error = 1; goto label_error;
++         exit( 1 );
+       }
+ 
+       (void) fgets( line, HPL_LINE_MAX - 2, infp );
diff --git a/hpl-README.Fedora b/hpl-README.Fedora
new file mode 100644
index 0000000..918e281
--- /dev/null
+++ b/hpl-README.Fedora
@@ -0,0 +1,19 @@
+Run the benchmark by (for e.g. mpich-x86_64 implementation):
+$ module load mpi/mpich-x86_64
+$ mpirun -n 4 xhpl_mpich
+$ module unload mpi/mpich-x86_64
+
+In case you have only one MPI implementation installed or you don't care
+about the implementation you can load it simply by:
+$ module load mpi
+
+If you just installed the environment-modules, the module command may not
+work until the shell is restarted or the appropriate file is sourced
+by e.g. (for bash):
+$ . /etc/profile.d/modules.sh
+
+Benchmark configuration file HPL.dat is loaded from the current directory.
+If the configuration file is not found in the current directory and
+$MPI_SYSCONFIG enviroment variable is set, the configuration is loaded
+from the $MPI_SYSCONFIG/hpl directory. If $MPI_SYSCONFIG enviroment variable
+is not set, the /etc/hpl directory is tried as the last resort.
diff --git a/hpl.spec b/hpl.spec
new file mode 100644
index 0000000..284ff73
--- /dev/null
+++ b/hpl.spec
@@ -0,0 +1,201 @@
+# The packaged OpenBLAS gives what appear to be optimal results on AVX
+# and older x86 systems -- essentially the same as the proprietary
+# BLAS. The packaged Atlas doesn't have AVX support and, in general,
+# needs to be built natively for optimal results.  However, OpenBLAS
+# is currently only packaged for x86.
+%ifarch %{ix86} x86_64
+%bcond_without openblas
+%else
+%bcond_with openblas
+%endif
+
+%global _docdir_fmt %{name}
+
+Name:           hpl
+URL:            http://www.netlib.org/benchmark/hpl/
+Version:        2.1
+Release:        8%{?dist}
+License:        BSD with advertising
+Requires:       %{name}-common = %{version}-%{release}
+BuildRequires:  mpich-devel, openmpi-devel
+%if %{with openblas}
+BuildRequires:  openblas-devel
+%else
+BuildRequires:  atlas-devel
+%endif
+Group:          Applications/System
+Summary:        A Portable Implementation of the High-Performance Linpack Benchmark
+Source0:        http://www.netlib.org/benchmark/hpl/%{name}-%{version}.tar.gz
+# setup/Make.Linux_PII_CBLAS_gm tuned for Fedora
+Source1:        hpl-README.Fedora
+Patch0:         hpl-2.1-fedora.patch
+
+%description
+HPL is a software package that solves a (random) dense linear system in
+double precision (64 bits) arithmetic on distributed-memory computers.
+It can thus be regarded as a portable as well as freely available
+implementation of the High Performance Computing Linpack Benchmark.
+
+%package common
+Summary: HPL common files
+BuildArch: noarch
+
+%description common
+HPL common files
+
+%package doc
+Summary: HPL documentation
+Requires: %{name}-common = %{version}-%{release}
+BuildArch: noarch
+
+%description doc
+HPL documentation.
+
+%package openmpi
+Summary: HPL compiled against openmpi
+# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
+Requires: openmpi
+Requires: %{name}-common = %{version}-%{release}
+
+%description openmpi
+This package contains HPL compiled with openmpi.
+
+%package mpich
+Summary: HPL compiled against mpich
+BuildRequires: mpich-devel
+# Require explicitly for dir ownership and to guarantee the pickup of the right runtime
+Requires: mpich
+Requires: %{name}-common = %{version}-%{release}
+
+%description mpich
+This package contains HPL compiled with mpich.
+
+
+%prep
+%setup -q
+%patch0 -p1 -b .fedora
+
+cp %{SOURCE1} README.Fedora
+
+# Remove executable mode from sources
+find . -type f -perm /111 -exec chmod a-x {} \;
+
+# Patch docs to point to upstream sources
+sed -i "s|\"hpl-%{version}.tar.gz\"|\"http://www.netlib.org/benchmark/hpl/hpl-%{version}.tar.gz\"|g" www/*.html
+
+%build
+# Have to do off-root builds to be able to build many versions at once
+
+# To avoid replicated code define a build macro
+# Cannot build in parallel (with _smp_mflags macro)
+%global dobuild() \
+cp setup/Make.Linux_PII_CBLAS_gm Make.$MPI_COMPILER \
+make TOPdir="%{_builddir}/%{name}-%{version}" arch=$MPI_COMPILER ARCH=$MPI_COMPILER \\\
+%if %{with openblas} \
+ LAlib=-lopenblas \
+%endif
+
+# Build OpenMPI version
+%{_openmpi_load}
+%dobuild
+%{_openmpi_unload}
+
+# Build mpich version
+%{_mpich_load}
+%dobuild
+%{_mpich_unload}
+
+
+%install
+# Install OpenMPI version
+%{_openmpi_load}
+install -D -m 0755 bin/${MPI_COMPILER}/xhpl %{buildroot}${MPI_BIN}/xhpl${MPI_SUFFIX}
+%{_openmpi_unload}
+
+# Install MPICH version
+%{_mpich_load}
+install -D -m 0755 bin/${MPI_COMPILER}/xhpl %{buildroot}${MPI_BIN}/xhpl${MPI_SUFFIX}
+%{_mpich_unload}
+
+# Install HPL.dat
+install -D -m 0644 testing/ptest/HPL.dat %{buildroot}%{_sysconfdir}/%{name}/HPL.dat
+
+# Install docs
+install -d -D -m 0755 %{buildroot}%{_docdir}/%{name}/html
+install -p -D -m 0644 www/* %{buildroot}%{_docdir}/%{name}/html
+
+# Install man pages
+install -d -D -m 0755 %{buildroot}%{_mandir}/man3
+install -p -D -m 0644 man/man3/* %{buildroot}%{_mandir}/man3
+
+
+%check
+# Check openmpi implementation
+%{_openmpi_load}
+pushd bin/${MPI_COMPILER}
+mpirun -n 4 ./xhpl
+popd
+%{_openmpi_unload}
+
+# Check mpich implementation
+%{_mpich_load}
+pushd bin/${MPI_COMPILER}
+mpirun -n 4 ./xhpl
+popd
+%{_mpich_unload}
+
+
+%files common
+%exclude %{_docdir}/%{name}/html
+%license COPYRIGHT
+%doc BUGS HISTORY README TODO TUNING README.Fedora
+%config(noreplace) %{_sysconfdir}/%{name}
+
+%files doc
+%doc %{_docdir}/%{name}/html
+%{_mandir}/man3/*.3*
+
+%files openmpi
+%{_libdir}/openmpi/bin/xhpl*
+
+%files mpich
+%{_libdir}/mpich/bin/xhpl*
+
+
+%changelog
+* Fri May 15 2015 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-8
+- Added config(noreplace) to /etc/hpl/HPL.dat
+
+* Thu May 14 2015 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-7
+- Moved HPL.dat to /etc/hpl
+- Added build time check testing openmpi and mpich implementations
+
+* Wed May 13 2015 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-6
+- Added '_docdir_fmt name' for hpl-common subpackage to store its
+  documentation under /usr/share/doc/hpl
+- Other changes according to Fedora review
+
+* Tue Mar  3 2015 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-5
+- Moved HPL.dat to /usr/share
+
+* Wed Jan 14 2015 Dave Love <d.love at liverpool.ac.uk> - 2.1-4
+- Build against openblas on x86
+- Fix doc description
+- Port to current Fedora
+- Drop headers and devel packages
+
+* Thu Jul 31 2014 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-3
+- Used mpich instead of mpich2
+
+* Mon Jun 17 2013 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-2
+- Moved files from the main package to the common subpackage
+
+* Tue May 28 2013 Jaroslav Škarvada <jskarvad at redhat.com> - 2.1-1
+- New version
+- Re-packaged according to MPI guidelines
+
+* Mon Jun 11 2012 Jaroslav Škarvada <jskarvad at redhat.com> - 2.0-2
+- Fixed mpich2 module loading on architectures other than x86_64
+
+* Fri Jun 08 2012 Jaroslav Škarvada <jskarvad at redhat.com> - 2.0-1
+- Initial release
diff --git a/sources b/sources
index e69de29..9dac883 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+091aa58c3e62bdf598b403420d8387ef  hpl-2.1.tar.gz
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/hpl.git/commit/?h=master&id=6b1623573251b5abc207b615a6f811d9e0e89575


More information about the scm-commits mailing list