From 6427b12ba425dea82eaae2f39bebd40f3aa4cc29 Mon Sep 17 00:00:00 2001 From: doupengda Date: Thu, 25 Apr 2024 15:51:58 +0800 Subject: [PATCH] add support for loongarch64 (cherry picked from commit 0b86711cd4117431e96eb94419f68f6d20439dcf) --- ...h2-2.3.6-add-support-for-loongarch64.patch | 37 +++++++++++++++++++ mvapich2.spec | 6 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-mvapich2-2.3.6-add-support-for-loongarch64.patch diff --git a/0001-mvapich2-2.3.6-add-support-for-loongarch64.patch b/0001-mvapich2-2.3.6-add-support-for-loongarch64.patch new file mode 100644 index 0000000..102f94c --- /dev/null +++ b/0001-mvapich2-2.3.6-add-support-for-loongarch64.patch @@ -0,0 +1,37 @@ +From f9aedeaeadd84f2c5e949a148e82d2a18d1e45d8 Mon Sep 17 00:00:00 2001 +From: test +Date: Thu, 25 Apr 2024 07:45:52 +0000 +Subject: [PATCH] mvapich2 2.3.6 add support for 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 77552c4..0ad6b43 100644 +--- a/src/mpid/ch3/channels/common/include/mv2_clock.h ++++ b/src/mpid/ch3/channels/common/include/mv2_clock.h +@@ -81,6 +81,20 @@ static inline cycles_t get_cycles() + asm volatile ("mov %0=ar.itc" : "=r" (ret)); + 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; ++} + #elif defined(__aarch64__) + typedef unsigned long cycles_t; + static inline cycles_t get_cycles() +-- +2.43.0 + diff --git a/mvapich2.spec b/mvapich2.spec index 1180d6d..d6ae6b8 100644 --- a/mvapich2.spec +++ b/mvapich2.spec @@ -2,7 +2,7 @@ Name: mvapich2 Version: 2.3.6 -Release: 3 +Release: 4 Summary: OSU MVAPICH2 MPI package License: BSD and MIT URL: http://mvapich.cse.ohio-state.edu @@ -14,6 +14,7 @@ Patch0002: 0002-mvapich23-unbundle-osu_benchmarks.patch %ifarch riscv64 Patch1000: 1000-add-riscv-support.patch %endif +Patch1001: 0001-mvapich2-2.3.6-add-support-for-loongarch64.patch BuildRequires: gcc-gfortran python3-devel gcc-c++ BuildRequires: bison flex autoconf automake libtool BuildRequires: perl-Digest-MD5 hwloc-devel rdma-core-devel @@ -261,6 +262,9 @@ cd .. %changelog +* Thu Apr 25 2024 Pengda Dou - 2.3.6-4 +- add support for loongarch64 + * Fri Sep 1 2023 renyi <977713017@qq.com> - 2.3.6-3 - Fix changelog error -- Gitee