Skip to content

Commit b3c052e

Browse files
dong0321bosilca
authored andcommitted
Support for ARM SVE to instrinsics MPI_Op
Add readme, install and plot scripts Signed-off-by: dongzhong <zhongdong0321@hotmail.com>
1 parent a166ad7 commit b3c052e

File tree

12 files changed

+1074
-1
lines changed

12 files changed

+1074
-1
lines changed

ARM_SVE_README

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Configuration and installation details please check script arm_install.sh
2+
3+
Run test: (Test example takes 4 args)
4+
arg1 : elements count for operation
5+
arg2 : elements type could be : i (integer), f (float), d (double)
6+
arg3: type size in bits, only apply when you set arg2 to i. eg: i 8 will be converted to int8; i 16 to int16
7+
arg4: operation type. Could be : max, min, sum , mul, band , bor, bxor
8+
If you want to use SVE module for MPI ops, you need to pass mca params as : -mca op sve -mca op_sve_hardware_available 1
9+
=======
10+
Example for test
11+
$PATH_To_BIN/mpirun -mca op sve -mca op_sve_hardware_available 1 -mca pml ob1 -np 1 armie -msve-vector-bits=256 --iclient libinscount_emulated.so --unsafe-ldstex -- /ccsopen/home/dzhong/Downloads/github/intel_to_arm/ompi/test/datatype/Reduce_local_float 33 i 8 min
12+
13+
If you don't need armie you can remove the ARMIE part in the command line as :
14+
$PATH_To_BIN//mpirun -mca op sve -mca op_sve_hardware_available 1 -mca pml ob1 -np 1 /ompi/test/datatype/Reduce_local_float 33 i 8 min
15+
16+
How we evaluate the performance?
17+
======
18+
Logical:
19+
20+
Start_time;
21+
MPI_reduce_local(...);
22+
End_time;
23+
24+
Reduce_time = Start_time - End_time;
25+
26+
Possible issues (this happened on thunder2 machine):
27+
======
28+
Reason for "-mca pml ob1" : on Arm machine the default pml module will cause a problem with armie (instruction not supported, I don't know why), but with ob1 it works.
29+
30+

arm_install.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
mkdir build
2+
3+
./autogen.pl >/dev/null
4+
5+
./configure --prefix=$PWD/build --enable-mpirun-prefix-by-default --enable-debug CC=armclang CFLAGS="-march=armv8-a+sve" CXX=armclang++ FC=armflang >/dev/null
6+
7+
./config.status >/dev/null
8+
make -j 128 install >/dev/null
9+
10+
## compile the test code, test code under ompi/test/datapyte/Reduce_local_float.c
11+
./build/bin/mpicc -g -O3 -march=armv8-a+sve -o ./test/datatype/Reduce_local_float ./test/datatype/Reduce_local_float.c

ompi/mca/op/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
# University Research and Technology
44
# Corporation. All rights reserved.
5-
# Copyright (c) 2004-2005 The University of Tennessee and The University
5+
# Copyright (c) 2004-2020 The University of Tennessee and The University
66
# of Tennessee Research Foundation. All rights
77
# reserved.
88
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -17,6 +17,8 @@
1717
# $HEADER$
1818
#
1919

20+
AM_CPPFLAGS = $(LTDLINCL)
21+
2022
# main library setup
2123
noinst_LTLIBRARIES = libmca_op.la
2224
libmca_op_la_SOURCES =

ompi/mca/op/sve/Makefile.am

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Copyright (c) 2019 The University of Tennessee and The University
3+
# of Tennessee Research Foundation. All rights
4+
# reserved.
5+
# $COPYRIGHT$
6+
#
7+
# Additional copyrights may follow
8+
#
9+
# $HEADER$
10+
#
11+
12+
# This is an sve op component. This Makefile.am is a typical
13+
# sve of how to integrate into Open MPI's Automake-based build
14+
# system.
15+
#
16+
# See https://github.com/open-mpi/ompi/wiki/devel-CreateComponent
17+
# for more details on how to make Open MPI components.
18+
19+
# First, list all .h and .c sources. It is necessary to list all .h
20+
# files so that they will be picked up in the distribution tarball.
21+
22+
sources = \
23+
op_sve.h \
24+
op_sve_component.c \
25+
op_sve_functions.h \
26+
op_sve_functions.c
27+
28+
# Open MPI components can be compiled two ways:
29+
#
30+
# 1. As a standalone dynamic shared object (DSO), sometimes called a
31+
# dynamically loadable library (DLL).
32+
#
33+
# 2. As a static library that is slurped up into the upper-level
34+
# libmpi library (regardless of whether libmpi is a static or dynamic
35+
# library). This is called a "Libtool convenience library".
36+
#
37+
# The component needs to create an output library in this top-level
38+
# component directory, and named either mca_<type>_<name>.la (for DSO
39+
# builds) or libmca_<type>_<name>.la (for static builds). The OMPI
40+
# build system will have set the
41+
# MCA_BUILD_ompi_<framework>_<component>_DSO AM_CONDITIONAL to indicate
42+
# which way this component should be built.
43+
44+
if MCA_BUILD_ompi_op_arm_sve_op_DSO
45+
component_noinst =
46+
component_install = mca_op_sve.la
47+
else
48+
component_install =
49+
component_noinst = component_noinst
50+
endif
51+
52+
# Specific information for DSO builds.
53+
#
54+
# The DSO should install itself in $(ompilibdir) (by default,
55+
# $prefix/lib/openmpi).
56+
57+
mcacomponentdir = $(ompilibdir)
58+
mcacomponent_LTLIBRARIES = $(component_install)
59+
mca_op_sve_la_SOURCES = $(sources)
60+
mca_op_sve_la_LDFLAGS = -module -avoid-version
61+
mca_op_sve_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
62+
63+
# Specific information for static builds.
64+
#
65+
# Note that we *must* "noinst"; the upper-layer Makefile.am's will
66+
# slurp in the resulting .la library into libmpi.
67+
68+
noinst_LTLIBRARIES = $(component_noinst)
69+
libmca_op_sve_la_SOURCES = $(sources)
70+
libmca_op_sve_la_LDFLAGS = -module -avoid-version

ompi/mca/op/sve/configure.m4

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- shell-script -*-
2+
#
3+
# Copyright (c) 2019-2020 The University of Tennessee and The University
4+
# of Tennessee Research Foundation. All rights
5+
# reserved.
6+
#
7+
# $COPYRIGHT$
8+
#
9+
# Additional copyrights may follow
10+
#
11+
# $HEADER$
12+
#
13+
14+
# MCA_ompi_op_sve_CONFIG([action-if-can-compile],
15+
# [action-if-cant-compile])
16+
# ------------------------------------------------
17+
# We can always build, unless we were explicitly disabled.
18+
AC_DEFUN([MCA_ompi_op_sve_CONFIG],[
19+
AC_CONFIG_FILES([ompi/mca/op/sve/Makefile])
20+
[$1],
21+
])dnl

ompi/mca/op/sve/op_sve.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (c) 2019 The University of Tennessee and The University
3+
* of Tennessee Research Foundation. All rights
4+
* reserved.
5+
*
6+
* Copyright (c) 2019 Arm Ltd. All rights reserved.
7+
*
8+
* $COPYRIGHT$
9+
*
10+
* Additional copyrights may follow
11+
*
12+
* $HEADER$
13+
*/
14+
15+
#ifndef MCA_OP_SVE_EXPORT_H
16+
#define MCA_OP_SVE_EXPORT_H
17+
18+
#include "ompi_config.h"
19+
20+
#include "ompi/mca/mca.h"
21+
#include "opal/class/opal_object.h"
22+
23+
#include "ompi/mca/op/op.h"
24+
25+
BEGIN_C_DECLS
26+
27+
/**
28+
* Derive a struct from the base op component struct, allowing us to
29+
* cache some component-specific information on our well-known
30+
* component struct.
31+
*/
32+
typedef struct {
33+
/** The base op component struct */
34+
ompi_op_base_component_1_0_0_t super;
35+
36+
/* What follows is sve-component-specific cached information. We
37+
tend to use this scheme (caching information on the sve
38+
component itself) instead of lots of individual global
39+
variables for the component. The following data fields are
40+
sves; replace them with whatever is relevant for your
41+
component. */
42+
43+
/** A simple boolean indicating that the hardware is available. */
44+
bool hardware_available;
45+
46+
/** A simple boolean indicating whether double precision is
47+
supported. */
48+
bool double_supported;
49+
} ompi_op_sve_component_t;
50+
51+
/**
52+
* Globally exported variable. Note that it is a *sve* component
53+
* (defined above), which has the ompi_op_base_component_t as its
54+
* first member. Hence, the MCA/op framework will find the data that
55+
* it expects in the first memory locations, but then the component
56+
* itself can cache additional information after that that can be used
57+
* by both the component and modules.
58+
*/
59+
OMPI_DECLSPEC extern ompi_op_sve_component_t
60+
mca_op_sve_component;
61+
62+
END_C_DECLS
63+
64+
#endif /* MCA_OP_SVE_EXPORT_H */

0 commit comments

Comments
 (0)