From 6b98ceb5c257fcfc403f4e88836259688221af0a Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Thu, 23 Mar 2023 10:15:01 +0200 Subject: [PATCH] Run OpenMPI with --oversubscribe option on riscv64 Otherwise OpenMPI complains there are not enough slots on SiFive HiFive Unmatched boards. Signed-off-by: David Abdurachmanov --- fftw-openmpi-oversubscribe.patch | 67 ++++++++++++++++++++++++++++++++ fftw.spec | 16 +++++++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 fftw-openmpi-oversubscribe.patch diff --git a/fftw-openmpi-oversubscribe.patch b/fftw-openmpi-oversubscribe.patch new file mode 100644 index 0000000..c5956b4 --- /dev/null +++ b/fftw-openmpi-oversubscribe.patch @@ -0,0 +1,67 @@ +diff --git a/mpi/Makefile.am b/mpi/Makefile.am +index 8e43fac..a44100e 100644 +--- a/mpi/Makefile.am ++++ b/mpi/Makefile.am +@@ -50,24 +50,24 @@ CHECKOPTS = --verbose --random --maxsize=$(CHECKSIZE) -c=$(NUMCHECK) $(CHECK_PL_ + if MPI + + check-local: mpi-bench$(EXEEXT) +- perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 1 `pwd`/mpi-bench" ++ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 1 `pwd`/mpi-bench" + @echo "--------------------------------------------------------------" + @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 1 CPU" + @echo "--------------------------------------------------------------" +- perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 2 `pwd`/mpi-bench" ++ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 2 `pwd`/mpi-bench" + @echo "--------------------------------------------------------------" + @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 2 CPUs" + @echo "--------------------------------------------------------------" +- perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 3 `pwd`/mpi-bench" ++ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 3 `pwd`/mpi-bench" + @echo "--------------------------------------------------------------" + @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 3 CPUs" + @echo "--------------------------------------------------------------" +- perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 4 `pwd`/mpi-bench" ++ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 4 `pwd`/mpi-bench" + @echo "--------------------------------------------------------------" + @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 4 CPUs" + @echo "--------------------------------------------------------------" + if SMP +- perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) -np 3 `pwd`/mpi-bench" ++ perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) $(MPIARGS) -np 3 `pwd`/mpi-bench" + @echo "--------------------------------------------------------------" + @echo " MPI FFTW threaded transforms passed "$(NUMCHECK)" tests!" + @echo "--------------------------------------------------------------" +diff --git a/mpi/Makefile.in b/mpi/Makefile.in +index 0041d0f..9f994b3 100644 +--- a/mpi/Makefile.in ++++ b/mpi/Makefile.in +@@ -990,23 +990,23 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + + + @MPI_TRUE@check-local: mpi-bench$(EXEEXT) +-@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 1 `pwd`/mpi-bench" ++@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 1 `pwd`/mpi-bench" + @MPI_TRUE@ @echo "--------------------------------------------------------------" + @MPI_TRUE@ @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 1 CPU" + @MPI_TRUE@ @echo "--------------------------------------------------------------" +-@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 2 `pwd`/mpi-bench" ++@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 2 `pwd`/mpi-bench" + @MPI_TRUE@ @echo "--------------------------------------------------------------" + @MPI_TRUE@ @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 2 CPUs" + @MPI_TRUE@ @echo "--------------------------------------------------------------" +-@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 3 `pwd`/mpi-bench" ++@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 3 `pwd`/mpi-bench" + @MPI_TRUE@ @echo "--------------------------------------------------------------" + @MPI_TRUE@ @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 3 CPUs" + @MPI_TRUE@ @echo "--------------------------------------------------------------" +-@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) -np 4 `pwd`/mpi-bench" ++@MPI_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi "$(MPIRUN) $(MPIARGS) -np 4 `pwd`/mpi-bench" + @MPI_TRUE@ @echo "--------------------------------------------------------------" + @MPI_TRUE@ @echo " MPI FFTW transforms passed "$(NUMCHECK)" tests, 4 CPUs" + @MPI_TRUE@ @echo "--------------------------------------------------------------" +-@MPI_TRUE@@SMP_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) -np 3 `pwd`/mpi-bench" ++@MPI_TRUE@@SMP_TRUE@ perl -w $(CHECK) $(CHECKOPTS) --mpi --nthreads=2 "$(MPIRUN) $(MPIARGS) -np 3 `pwd`/mpi-bench" + @MPI_TRUE@@SMP_TRUE@ @echo "--------------------------------------------------------------" + @MPI_TRUE@@SMP_TRUE@ @echo " MPI FFTW threaded transforms passed "$(NUMCHECK)" tests!" + @MPI_TRUE@@SMP_TRUE@ @echo "--------------------------------------------------------------" diff --git a/fftw.spec b/fftw.spec index 00791a3..cf5be2c 100644 --- a/fftw.spec +++ b/fftw.spec @@ -13,12 +13,14 @@ Name: fftw Version: 3.3.10 -Release: 4%{?dist} +Release: 4.0.riscv64%{?dist} Summary: A Fast Fourier Transform library License: GPLv2+ URL: http://www.fftw.org Source0: http://www.fftw.org/fftw-%{version}.tar.gz +Patch0: fftw-openmpi-oversubscribe.patch + BuildRequires: gcc-gfortran %global quad 0 @@ -266,6 +268,10 @@ library. %prep %setup -q +%ifarch riscv64 +%patch0 -p1 +%endif + %build # Explicitly load shell support for the environment-modules package, used # below via 'module' pseudo-command. @@ -404,10 +410,15 @@ export OMPI_MCA_btl="^vader" %endif for mpi in %{mpi_list} ; do module load mpi/${mpi}-%{_arch} + export MPIARGS= + if [ "$mpi" = "openmpi" ]; then + export MPIARGS=--oversubscribe + fi for ver in single double long ; do export LD_LIBRARY_PATH=$bdir/$ver/.libs:$bdir/$ver/threads/.libs make %{?_smp_mflags} -C ${mpi}-${ver}/mpi check done + unset MPIARGS module unload mpi/${mpi}-%{_arch} done @@ -530,6 +541,9 @@ done %endif %changelog +* Thu Mar 23 2023 David Abdurachmanov - 3.3.10-4.0.riscv64 +- Run OpenMPI with --oversubscribe option on riscv64 + * Thu Jan 19 2023 Fedora Release Engineering - 3.3.10-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild