!31 [sync] PR-28: add loongarch64 and sw_64 support

From: @openeuler-sync-bot 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-09-21 12:21:22 +00:00 committed by Gitee
commit d9e7b4410e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 74 additions and 4 deletions

View File

@ -0,0 +1,37 @@
From 2c87d0fb35dc83c446665c80c78629bb9114e2b4 Mon Sep 17 00:00:00 2001
From: houfangdong <houfangdong@loongson.cn>
Date: Thu, 18 Nov 2021 09:03:23 +0800
Subject: [PATCH 3/3] mv2_clock support loongarch64.
---
src/mpid/ch3/channels/common/include/mv2_clock.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/mpid/ch3/channels/common/include/mv2_clock.h b/src/mpid/ch3/channels/common/include/mv2_clock.h
index 98f05df..45f3316 100644
--- a/src/mpid/ch3/channels/common/include/mv2_clock.h
+++ b/src/mpid/ch3/channels/common/include/mv2_clock.h
@@ -92,6 +92,20 @@ static inline cycles_t get_cycles()
return ret;
}
+#elif defined(__loongarch64)
+typedef unsigned long cycles_t;
+static inline cycles_t get_cycles()
+{
+ int rID = 0;
+ cycles_t val = 0;
+
+ __asm__ __volatile__(
+ "rdtime.d %0, %1 \n\t"
+ : "=r"(val), "=r"(rID)
+ :
+ );
+ return val;
+}
#else
#warning get_cycles not implemented for this architecture: attempt asm/timex.h
--
2.27.0

View File

@ -0,0 +1,20 @@
diff --git a/src/mpid/ch3/channels/common/include/mv2_clock.h b/src/mpid/ch3/channels/common/include/mv2_clock.h
index 135798f..ae32d00 100644
--- a/src/mpid/ch3/channels/common/include/mv2_clock.h
+++ b/src/mpid/ch3/channels/common/include/mv2_clock.h
@@ -106,6 +106,15 @@ static inline cycles_t get_cycles()
);
return val;
}
+#elif defined(__sw_64__)
+typedef unsigned long cycles_t;
+static inline cycles_t get_cycles()
+{
+ cycles_t ret;
+
+ __asm__ __volatile__ ("rtc %0" : "=r"(ret));
+ return ret;
+}
#else
#warning get_cycles not implemented for this architecture: attempt asm/timex.h

View File

@ -2,7 +2,7 @@
Name: mvapich2
Version: 2.3.6
Release: 1
Release: 2
Summary: OSU MVAPICH2 MPI package
License: BSD and MIT
URL: http://mvapich.cse.ohio-state.edu
@ -11,6 +11,9 @@ Source1: mvapich2.module.in
Source2: mvapich2.macros.in
Patch0001: 0001-mvapich23-unbundle-contrib-hwloc.patch
Patch0002: 0002-mvapich23-unbundle-osu_benchmarks.patch
Patch1000: 1000-add-loongarch64-support-not-upstream-mv2_clock.patch
Patch1001: 1001-add-sw_64-support-not-upstream-mv2_clock.patch
# END KYLINSEC
BuildRequires: gcc-gfortran python3-devel gcc-c++
BuildRequires: bison flex autoconf automake libtool
BuildRequires: perl-Digest-MD5 hwloc-devel rdma-core-devel
@ -119,7 +122,12 @@ cd default
--datarootdir=%{_datadir}/mvapich2 --docdir=%{_docdir}/mvapich2 \
--enable-error-checking=runtime --enable-timing=none --enable-g=mem,dbg,meminit \
--enable-fast=all --enable-shared --enable-static --enable-fortran=all --enable-cxx \
--disable-silent-rules --disable-wrapper-rpath --with-hwloc=v2
%ifarch sw_64
--disable-fortran \
%else
--enable-fortran=all \
%endif
--disable-silent-rules --disable-wrapper-rpath --with-hwloc=v2
find . -name libtool -exec \
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g;
@ -192,9 +200,11 @@ cd ..
%{_libdir}/mvapich2/bin/mpic++
%{_libdir}/mvapich2/bin/mpicc
%{_libdir}/mvapich2/bin/mpicxx
%ifnarch sw_64
%{_libdir}/mvapich2/bin/mpif77
%{_libdir}/mvapich2/bin/mpif90
%{_libdir}/mvapich2/bin/mpifort
%endif
%{_libdir}/mvapich2/lib/pkgconfig
%{_libdir}/mvapich2/lib/*.a
%{_libdir}/mvapich2/lib/*.so
@ -247,13 +257,16 @@ cd ..
%changelog
* Mon Aug 28 2023 panchenbo <panchenbo@kylinsec.com.cn> - 2.3.6-2
- add sw_64 and loongarch64 support
* Mon Jun 20 2022 liyanan <liyanan32@h-partners.com> - 2.3.6-1
- Update to 2.3.6
* Sat 07 Aug 2021 sunguoshuai <sunguoshuai@huawei.com> - 2.3-11
* Sat Aug 07 2021 sunguoshuai <sunguoshuai@huawei.com> - 2.3-11
- fix build error with gcc 10,include allow mismatched arguement and multiple definition
* Wed July 9 2021 zhaoyao <zhaoyao32@huawei.com> - 2.3-10
* Fri Jul 09 2021 zhaoyao <zhaoyao32@huawei.com> - 2.3-10
- fix build error: Abording because C++ compiler does not work.
* Sat Mar 27 2021 zhanghua <zhanghua40@huawei.com> - 2.3-9