From e0840a30ec905a7b0790c60dd75220edbc80a60e Mon Sep 17 00:00:00 2001 From: Patrick Lavin Date: Wed, 31 Jul 2024 15:24:58 -0600 Subject: [PATCH] move files, enable Ariel MPI testing --- src/sst/elements/ariel/Makefile.am | 8 +- src/sst/elements/ariel/api/Makefile | 13 - src/sst/elements/ariel/api/Makefile.am | 7 + src/sst/elements/ariel/configure.m4 | 10 + src/sst/elements/ariel/mpi/Makefile | 830 +++++++++++++++++- src/sst/elements/ariel/mpi/arielapi.h | 33 - src/sst/elements/ariel/mpi/hello.cc | 79 +- src/sst/elements/ariel/mpi/reduce.cc | 43 +- src/sst/elements/ariel/tests/testMPI/hello.cc | 76 -- .../elements/ariel/tests/testMPI/reduce.cc | 122 --- .../elements/ariel/tests/testMPI/test-mpi.py | 13 +- .../ariel/tests/testsuite_mpi_Ariel.py | 8 +- 12 files changed, 918 insertions(+), 324 deletions(-) delete mode 100644 src/sst/elements/ariel/api/Makefile create mode 100644 src/sst/elements/ariel/api/Makefile.am delete mode 100644 src/sst/elements/ariel/mpi/arielapi.h delete mode 100644 src/sst/elements/ariel/tests/testMPI/hello.cc delete mode 100644 src/sst/elements/ariel/tests/testMPI/reduce.cc diff --git a/src/sst/elements/ariel/Makefile.am b/src/sst/elements/ariel/Makefile.am index 0726342b85..20f45b6ac9 100644 --- a/src/sst/elements/ariel/Makefile.am +++ b/src/sst/elements/ariel/Makefile.am @@ -1,5 +1,9 @@ +SUBDIRS = api +if SST_USE_ARIEL_MPI +SUBDIRS += mpi +endif + AM_CPPFLAGS += \ - $(MPI_CPPFLAGS) \ -I$(top_srcdir)/src if HAVE_SET_PTRACER @@ -104,7 +108,7 @@ endif libariel_la_CPPFLAGS = \ -DARIEL_TRACE_LIB=$(libdir)/sst \ - -DARIEL_TOOL_DIR="$(libexecdir)" \ + -DARIEL_TOOL_DIR="$(libexecdir)" \ -DPINTOOL_EXECUTABLE="$(PINTOOL_RUNTIME)" \ -DMPILAUNCHER_EXECUTABLE="$(CURDIR)/mpi/mpilauncher" \ $(AM_CPPFLAGS) $(CPPFLAGS) diff --git a/src/sst/elements/ariel/api/Makefile b/src/sst/elements/ariel/api/Makefile deleted file mode 100644 index 584a966ef3..0000000000 --- a/src/sst/elements/ariel/api/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: libarielapi.so libarielapi.a - -libarielapi.so: arielapi.c arielapi.h - $(CC) -fPIC -shared -o libarielapi.so arielapi.c -fopenmp - -arielapi.o: arielapi.c arielapi.h - $(CC) -c -o arielapi.o arielapi.c -fopenmp - -libarielapi.a: arielapi.o - ar rcs $@ $^ - -clean: - rm *.o *.a *.so diff --git a/src/sst/elements/ariel/api/Makefile.am b/src/sst/elements/ariel/api/Makefile.am new file mode 100644 index 0000000000..a28d6b183b --- /dev/null +++ b/src/sst/elements/ariel/api/Makefile.am @@ -0,0 +1,7 @@ +CC=$(ARIEL_MPICC) +CXX=$(ARIEL_MPICXX) +CFLAGS+=-fopenmp +CXXFLAGS+=fopenmp +lib_LTLIBRARIES = libarielapi.la +libarielapi_la_SOURCES = arielapi.c arielapi.h +include_HEADERS = arielapi.h diff --git a/src/sst/elements/ariel/configure.m4 b/src/sst/elements/ariel/configure.m4 index 9b8ac78759..52748b1b66 100644 --- a/src/sst/elements/ariel/configure.m4 +++ b/src/sst/elements/ariel/configure.m4 @@ -4,6 +4,8 @@ AC_DEFUN([SST_ariel_CONFIG], [ sst_check_ariel="yes" SST_CHECK_PINTOOL([have_pin=1],[have_pin=0],[AC_MSG_ERROR([PIN was requested but not found])]) +dnl SST_CHECK_ARIEL_MPI([], [AC_MSG_ERROR([Can't enable Ariel MPI])]) + SST_CHECK_PTRACE_SET_TRACER() SST_CHECK_SHM() @@ -13,5 +15,13 @@ AC_DEFUN([SST_ariel_CONFIG], [ # Use LIBZ SST_CHECK_LIBZ() + AC_SUBST([ARIEL_MPICC]) + AC_SUBST([ARIEL_MPICXX]) + AC_SUBST([ARIEL_CFLAGS]) + AC_SUBST([ARIEL_CXXFLAGS]) + + AC_CONFIG_FILES([src/sst/elements/ariel/api/Makefile]) + AC_CONFIG_FILES([src/sst/elements/ariel/mpi/Makefile]) + AS_IF([test "$sst_check_ariel" = "yes"], [$1], [$2]) ]) diff --git a/src/sst/elements/ariel/mpi/Makefile b/src/sst/elements/ariel/mpi/Makefile index fa1ab49bcb..e328ea3c70 100644 --- a/src/sst/elements/ariel/mpi/Makefile +++ b/src/sst/elements/ariel/mpi/Makefile @@ -1,28 +1,820 @@ -CC=gcc -CXX=g++ -MPICXX=mpic++ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# src/sst/elements/ariel/mpi/Makefile. Generated from Makefile.in by configure. -all: mpilauncher hello fakepin reduce libarielapi.so +# Copyright (C) 1994-2021 Free Software Foundation, Inc. -clean: - rm -rf mpilauncher mpilauncher hello fakepin reduce *.o *.so +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -mpilauncher: mpilauncher.cc - g++ -g -o mpilauncher mpilauncher.cc +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -hello: hello.cc - mpic++ -fopenmp -g -o hello hello.cc -reduce: reduce.cc libarielapi.so - mpic++ -fopenmp -g -o reduce reduce.cc -L. -larielapi -fakepin: fakepin.cc - g++ -g -o fakepin fakepin.cc -libarielapi.so: libarielapi.o - gcc -shared -o libarielapi.so libarielapi.o -libarielapi.o: libarielapi.c - gcc -o libarielapi.o -fPIC -I./ -c libarielapi.c +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/sst-elements-library +pkgincludedir = $(includedir)/sst-elements-library +pkglibdir = $(libdir)/sst-elements-library +pkglibexecdir = $(libexecdir)/sst-elements-library +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-pc-linux-gnu +host_triplet = x86_64-pc-linux-gnu +bin_PROGRAMS = hello$(EXEEXT) reduce$(EXEEXT) mpilauncher$(EXEEXT) \ + fakepin$(EXEEXT) +subdir = src/sst/elements/ariel/mpi +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/acx_mpi.m4 \ + $(top_srcdir)/config/ax_openmp.m4 \ + $(top_srcdir)/config/libtool.m4 $(top_srcdir)/config/ltargz.m4 \ + $(top_srcdir)/config/ltdl.m4 $(top_srcdir)/config/ltoptions.m4 \ + $(top_srcdir)/config/ltsugar.m4 \ + $(top_srcdir)/config/ltversion.m4 \ + $(top_srcdir)/config/lt~obsolete.m4 \ + $(top_srcdir)/config/sst-check_picky.m4 \ + $(top_srcdir)/config/sst_check_ariel_mpi.m4 \ + $(top_srcdir)/config/sst_check_cuda.m4 \ + $(top_srcdir)/config/sst_check_dramsim.m4 \ + $(top_srcdir)/config/sst_check_dramsim3.m4 \ + $(top_srcdir)/config/sst_check_fdsim.m4 \ + $(top_srcdir)/config/sst_check_goblin_hmcsim.m4 \ + $(top_srcdir)/config/sst_check_hbmdramsim.m4 \ + $(top_srcdir)/config/sst_check_hybridsim.m4 \ + $(top_srcdir)/config/sst_check_libz.m4 \ + $(top_srcdir)/config/sst_check_nvdimmsim.m4 \ + $(top_srcdir)/config/sst_check_pintool.m4 \ + $(top_srcdir)/config/sst_check_ptrace_set_tracer.m4 \ + $(top_srcdir)/config/sst_check_ramulator.m4 \ + $(top_srcdir)/config/sst_check_shm.m4 \ + $(top_srcdir)/config/sst_check_spinlock.m4 \ + $(top_srcdir)/config/sst_check_stake.m4 \ + $(top_srcdir)/config/sst_core_check_install.m4 \ + $(top_srcdir)/config/sst_elements_config_output.m4 \ + $(top_srcdir)/config/sst_os_check_osx.m4 \ + $(top_srcdir)/config/sst_elements_include.m4 \ + $(top_srcdir)/src/sst/elements/ariel/configure.m4 \ + $(top_srcdir)/src/sst/elements/memHierarchy/configure.m4 \ + $(top_srcdir)/src/sst/elements/messier/configure.m4 \ + $(top_srcdir)/src/sst/elements/miranda/configure.m4 \ + $(top_srcdir)/src/sst/elements/mmu/configure.m4 \ + $(top_srcdir)/src/sst/elements/opal/configure.m4 \ + $(top_srcdir)/src/sst/elements/prospero/configure.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/sst_element_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_fakepin_OBJECTS = fakepin.$(OBJEXT) +fakepin_OBJECTS = $(am_fakepin_OBJECTS) +fakepin_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +am_hello_OBJECTS = hello.$(OBJEXT) +hello_OBJECTS = $(am_hello_OBJECTS) +am__DEPENDENCIES_1 = +hello_DEPENDENCIES = ../api/libarielapi.la $(am__DEPENDENCIES_1) +am_mpilauncher_OBJECTS = mpilauncher.$(OBJEXT) +mpilauncher_OBJECTS = $(am_mpilauncher_OBJECTS) +mpilauncher_LDADD = $(LDADD) +am_reduce_OBJECTS = reduce.$(OBJEXT) +reduce_OBJECTS = $(am_reduce_OBJECTS) +reduce_DEPENDENCIES = ../api/libarielapi.la $(am__DEPENDENCIES_1) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/fakepin.Po ./$(DEPDIR)/hello.Po \ + ./$(DEPDIR)/mpilauncher.Po ./$(DEPDIR)/reduce.Po +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_$(V)) +am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_$(V)) +am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(fakepin_SOURCES) $(hello_SOURCES) $(mpilauncher_SOURCES) \ + $(reduce_SOURCES) +DIST_SOURCES = $(fakepin_SOURCES) $(hello_SOURCES) \ + $(mpilauncher_SOURCES) $(reduce_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__extra_recursive_targets = snippets-recursive +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} '/home/prlavin/tmp/delete-this-sst/sst-elements/config/missing' aclocal-1.16 +AMTAR = $${TAR-tar} +AM_CFLAGS = +AM_CPPFLAGS = -I/home/prlavin/tmp/delete-this-sst/install/include/python3.12 -I/home/prlavin/tmp/delete-this-sst/install/include/python3.12 -I/home/prlavin/tmp/delete-this-sst/install/include/sst/core -I/home/prlavin/tmp/delete-this-sst/install/include -I../api $(MPI_CPPFLAGS) $(ARIEL_CFLAGS) +AM_CXXFLAGS = -std=c++17 +AM_DEFAULT_VERBOSITY = 1 +AM_LDFLAGS = -L/home/prlavin/tmp/delete-this-sst/install/lib -lpython3.12 -lpthread -ldl -lutil -lm +AR = ar +ARIEL_CFLAGS = +ARIEL_CXXFLAGS = +ARIEL_MPICC = mpicc +ARIEL_MPICXX = mpicxx +AUTOCONF = ${SHELL} '/home/prlavin/tmp/delete-this-sst/sst-elements/config/missing' autoconf +AUTOHEADER = ${SHELL} '/home/prlavin/tmp/delete-this-sst/sst-elements/config/missing' autoheader +AUTOMAKE = ${SHELL} '/home/prlavin/tmp/delete-this-sst/sst-elements/config/missing' automake-1.16 +AWK = gawk +CC = $(ARIEL_MPICC) +CCAS = gcc +CCASDEPMODE = depmode=gcc3 +CCASFLAGS = -g -O2 +CCDEPMODE = depmode=gcc3 +CC_VERSION = gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10) +CFLAGS = -g -O2 $(ARIEL_CFLAGS) -fopenmp +CPP = gcc +CPPFLAGS = +CSCOPE = cscope +CTAGS = ctags +CUDA_CPPFLAGS = +CUDA_LDFLAGS = +CUDA_LIBDIR = +CUDA_LIBS = +CXX = $(ARIEL_MPICXX) +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 $(ARIEL_CXXFLAGS) -fopenmp +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DRAMSIM3_CPPFLAGS = +DRAMSIM3_LDFLAGS = +DRAMSIM3_LIB = +DRAMSIM3_LIBDIR = +DRAMSIM_CPPFLAGS = +DRAMSIM_LDFLAGS = +DRAMSIM_LIB = +DRAMSIM_LIBDIR = +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /usr/bin/grep -E +ETAGS = etags +EXEEXT = +FDSIM_CPPFLAGS = +FDSIM_CXXFLAGS = +FDSIM_LDFLAGS = +FDSIM_LIB = +FDSIM_LIBDIR = +FGREP = /usr/bin/grep -F +FILECMD = file +GOBLIN_HMCSIM_CPPFLAGS = +GOBLIN_HMCSIM_LDFLAGS = +GOBLIN_HMCSIM_LIB = +GOBLIN_HMCSIM_LIBDIR = +GREP = /usr/bin/grep +HAVE_SET_PTRACER = 1 +HBMDRAMSIM_CPPFLAGS = +HBMDRAMSIM_LDFLAGS = +HBMDRAMSIM_LIB = +HBMDRAMSIM_LIBDIR = +HYBRIDSIM_CPPFLAGS = +HYBRIDSIM_LDFLAGS = +HYBRIDSIM_LIB = +HYBRIDSIM_LIBDIR = +INCLTDL = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = +LIBADD_DL = -ldl +LIBADD_DLD_LINK = +LIBADD_DLOPEN = -ldl +LIBADD_SHL_LOAD = +LIBLTDL = -lltdl +LIBOBJS = +LIBS = -lrt -lrt +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIBZ_CPPFLAGS = +LIBZ_LDFLAGS = +LIBZ_LIB = -lz +LIPO = +LN_S = ln -s +LTDLDEPS = +LTDLINCL = +LTDLOPEN = libltdl +LTLIBOBJS = +LT_ARGZ_H = +LT_CONFIG_H = src/sst_element_config.h +LT_DLLOADERS = dlopen.la +LT_DLPREOPEN = -dlpreopen dlopen.la +LT_SYS_LIBRARY_PATH = +MAKEINFO = ${SHELL} '/home/prlavin/tmp/delete-this-sst/sst-elements/config/missing' makeinfo +MANIFEST_TOOL = : +MKDIR_P = /usr/bin/mkdir -p +MPICC = gcc +MPICPP = mpicc -E +MPICXX = g++ -std=c++17 +MPICXXCPP = mpicxx -E +MPILIBS = +MPI_CPPFLAGS = -I/usr/local/module-pkgs/mpi/OpenMPI/openmpi-4.1.4_gcc-8.5.0/include +NM = /usr/bin/nm -B +NMEDIT = +NVDIMMSIM_CPPFLAGS = +NVDIMMSIM_CXXFLAGS = +NVDIMMSIM_LDFLAGS = +NVDIMMSIM_LIB = +NVDIMMSIM_LIBDIR = +OBJDUMP = objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = sst-elements-library +PACKAGE_BUGREPORT = sst@sandia.gov +PACKAGE_NAME = SST Elements Library +PACKAGE_STRING = SST Elements Library -dev +PACKAGE_TARNAME = sst-elements-library +PACKAGE_URL = +PACKAGE_VERSION = -dev +PATH_SEPARATOR = : +PINTOOL2_RUNTIME = +PINTOOL3_RUNTIME = /home/prlavin/tmp/delete-this-sst/pin-3.28/pin +PINTOOL_CPPFLAGS = -I/home/prlavin/tmp/delete-this-sst/pin-3.28/source/include -DHAVE_PIN=1 -DPINTOOL_EXECUTABLE=\"/home/prlavin/tmp/delete-this-sst/pin-3.28/pin\" +PINTOOL_DIR = /home/prlavin/tmp/delete-this-sst/pin-3.28 +PINTOOL_LDFLAGS = -L/home/prlavin/tmp/delete-this-sst/pin-3.28/intel64/runtime -L/home/prlavin/tmp/delete-this-sst/pin-3.28/intel64/lib -L/home/prlavin/tmp/delete-this-sst/pin-3.28/intel/lib-ext +PINTOOL_PATH = /home/prlavin/tmp/delete-this-sst/pin-3.28:/home/prlavin/tmp/delete-this-sst/install/bin:/usr/local/module-pkgs/mpi/OpenMPI/openmpi-4.1.4_gcc-8.5.0/bin:/home/prlavin/projects/reference-paper-2024/install/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/prlavin/.local/bin:/home/prlavin/bin:/home/prlavin/scripts:/home/prlavin/.local/bin:/home/prlavin/bin:/home/prlavin/scripts +PINTOOL_RUNTIME = /home/prlavin/tmp/delete-this-sst/pin-3.28/pin +RAMULATOR_CPPFLAGS = +RAMULATOR_LDFLAGS = +RAMULATOR_LIB = +RAMULATOR_LIBDIR = +RANLIB = ranlib +SED = /usr/bin/sed +SET_MAKE = +SHELL = /bin/sh +SHM_LIB = -lrt -lrt +SSTELEMENTS_GIT_BRANCH = ariel-mpi-autotools +SSTELEMENTS_GIT_COMMITCOUNT = 15159 +SSTELEMENTS_GIT_HEADSHA = 37a83be7d8621347a16f7ce967ba49160e665711 +SST_ACTIVE_ELEMENT_LIBRARIES = ariel cacheTracer cassini cramSim kingsley memHierarchy merlin messier miranda mmu opal prospero rdmaNic serrano shogun vaultsim +SST_CONFIG_TOOL = /home/prlavin/tmp/delete-this-sst/install/bin/sst-config +SST_DIST_ELEMENT_LIBRARIES = ariel cacheTracer cassini cramSim kingsley memHierarchy merlin messier miranda mmu opal prospero rdmaNic serrano shogun vaultsim +SST_PREFIX = /home/prlavin/tmp/delete-this-sst/install +SST_REGISTER_TOOL = /home/prlavin/tmp/delete-this-sst/install/bin/sst-register +SST_SNIPPETS_TOOL = /home/prlavin/tmp/delete-this-sst/install/bin/sst-snippets.py +STAKE_CPPFLAGS = +STAKE_LDFLAGS = +STAKE_LIB = +STAKE_LIBDIR = +STRIP = strip +VERSION = -dev +abs_builddir = /home/prlavin/tmp/delete-this-sst/sst-elements/src/sst/elements/ariel/mpi +abs_srcdir = /home/prlavin/tmp/delete-this-sst/sst-elements/src/sst/elements/ariel/mpi +abs_top_builddir = /home/prlavin/tmp/delete-this-sst/sst-elements +abs_top_srcdir = /home/prlavin/tmp/delete-this-sst/sst-elements +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = tar --format=posix -chf - "$$tardir" +am__untar = tar -xf - +bindir = ${exec_prefix}/bin +build = x86_64-pc-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-pc-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = pc +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/prlavin/tmp/delete-this-sst/sst-elements/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +ltdl_LIBOBJS = lt__strl.o +ltdl_LTLIBOBJS = lt__strl.lo +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /home/prlavin/tmp/delete-this-sst/install +program_transform_name = s,x,x, +psdir = ${docdir} +runstatedir = ${localstatedir}/run +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sys_symbol_underscore = no +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../../../../../ +top_builddir = ../../../../.. +top_srcdir = ../../../../.. +mpilauncher_SOURCES = mpilauncher.cc +hello_SOURCES = hello.cc +reduce_SOURCES = reduce.cc +fakepin_SOURCES = fakepin.cc +hello_LDADD = ../api/libarielapi.la $(MPI_LIBS) $(MPILIBS) +reduce_LDADD = ../api/libarielapi.la $(MPI_LIBS) $(MPILIBS) +all: all-am -.PHONY: all clean +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sst/elements/ariel/mpi/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/sst/elements/ariel/mpi/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +fakepin$(EXEEXT): $(fakepin_OBJECTS) $(fakepin_DEPENDENCIES) $(EXTRA_fakepin_DEPENDENCIES) + @rm -f fakepin$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(fakepin_OBJECTS) $(fakepin_LDADD) $(LIBS) + +hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES) $(EXTRA_hello_DEPENDENCIES) + @rm -f hello$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(hello_OBJECTS) $(hello_LDADD) $(LIBS) + +mpilauncher$(EXEEXT): $(mpilauncher_OBJECTS) $(mpilauncher_DEPENDENCIES) $(EXTRA_mpilauncher_DEPENDENCIES) + @rm -f mpilauncher$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(mpilauncher_OBJECTS) $(mpilauncher_LDADD) $(LIBS) + +reduce$(EXEEXT): $(reduce_OBJECTS) $(reduce_DEPENDENCIES) $(EXTRA_reduce_DEPENDENCIES) + @rm -f reduce$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(reduce_OBJECTS) $(reduce_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/fakepin.Po # am--include-marker +include ./$(DEPDIR)/hello.Po # am--include-marker +include ./$(DEPDIR)/mpilauncher.Po # am--include-marker +include ./$(DEPDIR)/reduce.Po # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cc.o: + $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CXX)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CXX)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: + $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Plo +# $(AM_V_CXX)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(AM_V_CXX_no)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +snippets-local: + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/fakepin.Po + -rm -f ./$(DEPDIR)/hello.Po + -rm -f ./$(DEPDIR)/mpilauncher.Po + -rm -f ./$(DEPDIR)/reduce.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/fakepin.Po + -rm -f ./$(DEPDIR)/hello.Po + -rm -f ./$(DEPDIR)/mpilauncher.Po + -rm -f ./$(DEPDIR)/reduce.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +snippets: snippets-am + +snippets-am: snippets-local + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + snippets-am snippets-local tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/sst/elements/ariel/mpi/arielapi.h b/src/sst/elements/ariel/mpi/arielapi.h deleted file mode 100644 index 4ef5ae367e..0000000000 --- a/src/sst/elements/ariel/mpi/arielapi.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2009-2015 Sandia Corporation. Under the terms -// of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. -// Government retains certain rights in this software. -// -// Copyright (c) 2009-2015, Sandia Corporation -// All rights reserved. -// -// This file is part of the SST software package. For license -// information, see the LICENSE file in the top level directory of the -// distribution. - - -#ifndef _H_ARIEL_API -#define _H_ARIEL_API - -#include - -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif - -void ariel_enable(); -void ariel_disable(); -uint64_t ariel_cycles(); -void ariel_output_stats(); -void ariel_malloc_flag(int64_t id, int count, int level); - -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - -#endif - diff --git a/src/sst/elements/ariel/mpi/hello.cc b/src/sst/elements/ariel/mpi/hello.cc index fc433f4e5e..a1ecbce3ea 100644 --- a/src/sst/elements/ariel/mpi/hello.cc +++ b/src/sst/elements/ariel/mpi/hello.cc @@ -1,16 +1,16 @@ #include #include +#include #include #include +#include -int ariel_enable() { - printf("App: ariel_enable called\n"); - return 0; -} - +// Useage: ./hello [output-file] +// If running with multiple ranks, each will output to its own file int main(int argc, char* argv[]) { + MPI_Init(&argc, &argv); - ariel_enable(); + int rank = 0; int nranks = 0; int ret = MPI_Comm_rank(MPI_COMM_WORLD, &rank); @@ -24,52 +24,53 @@ int main(int argc, char* argv[]) { exit(1); } -#pragma omp parallel - { - int thread = omp_get_thread_num(); - -#pragma omp critical - { - if (!std::getenv("FAKEPIN")) { - printf("Hello from rank %d/%d, thread %d!", rank, nranks, thread); - } else { - printf("Hello from rank %d/%d, thread %d! (Launched by fakepin)", rank, nranks, thread); - } - - for (int i = 1; i < argc; i++) { - printf(" -- %s", argv[i]); + // Redirect output to a file if an argument was given. Append the rank to each filename. + FILE *output = stdout; + if (argc > 1) { + int len = strlen(argv[1]) + 12;// Space for underscore, plus up to a 10 digit integer, plus the null character + char *outfile = (char*)malloc(len); + if (!outfile) { + printf("Error allocating space for filename\n"); } - printf("\n"); + snprintf(outfile, len, "%s_%d", argv[1], rank); + output = fopen(outfile, "w"); + if (!output) { + printf("Error opening %s\n"); + exit(1); } + free(outfile); } - int compute = 0; - if (argc > 1) { - compute = atoi(argv[1]); - } - if (compute) { - if (rank == 0) { - int *vec_a = (int*) malloc(sizeof(int) * compute); - for (int i = 0; i < compute; i++) { - vec_a[i] = 2; - } - for (int i = 0; i < compute; i++) { - for (int j = 0; j < i; j++) { - for (int k = 0; k < j; k++) { - vec_a[i] += vec_a[j] + vec_a[k] + (i % 7 == 0 ? 3 : 5); - } - } + ariel_enable(); +#pragma omp parallel + { + int thread = omp_get_thread_num(); +#pragma omp critical + { + // ./fakepin sets the FAKEPIN environment variale. This is useful for debugging but + // not needed for our Ariel MPI testsuite. + // We only want output from the traced process + if (std::getenv("FAKEPIN")) { + fprintf(output, "Hello from rank %d of %d, thread %d! (Launched by fakepin)\n", rank, nranks, thread); + } else if (std::getenv("PIN_CRT_TZDATA") || std::getenv("PIN_APP_LD_LIBRARY_PATH")) { + fprintf(output, "Hello from rank %d of %d, thread %d! (Launched by pin)\n", rank, nranks, thread); + } else { + fprintf(output, "Hello from rank %d of %d, thread %d!\n", rank, nranks, thread); } - printf("Rank 0: vec_a[%d] is %d\n", compute-1, vec_a[compute-1]); } } - + // This is here just to make sure it doesn't crash when the processes try to communicate. MPI_Barrier(MPI_COMM_WORLD); + ariel_disable(); if (rank == 0) { printf("Rank 0: Barrier complete.\n"); } + if (argc > 1) { + fclose(output); + } + MPI_Finalize(); } diff --git a/src/sst/elements/ariel/mpi/reduce.cc b/src/sst/elements/ariel/mpi/reduce.cc index 81ea10f484..a889167dc1 100644 --- a/src/sst/elements/ariel/mpi/reduce.cc +++ b/src/sst/elements/ariel/mpi/reduce.cc @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -7,10 +8,12 @@ #include "arielapi.h" #define DEBUG 0 +#define TIMING 1 int main(int argc, char* argv[]) { - MPI_Init(&argc, &argv); + int prov; + MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &prov); if (argc < 2) { printf("Too few args\n"); @@ -24,7 +27,6 @@ int main(int argc, char* argv[]) { exit(1); } - int rank = 0; int nranks = 0; @@ -46,13 +48,30 @@ int main(int argc, char* argv[]) { len = len / nranks; + FILE *output = stdout; + + if (argc > 2) { + int len = strlen(argv[2]) + 12;// Space for underscore, plus up to a 10 digit integer, plus the null character + char *outfile = (char*)malloc(len); + if (!outfile) { + printf("Error allocating space for filename\n"); + } + snprintf(outfile, len, "%s_%d", argv[2], rank); + + output = fopen(outfile, "w"); + if (!output) { + printf("Unable to open %s\n", outfile); + exit(1); + } + } + + int nthreads = omp_get_max_threads(); #if DEBUG printf("Running on %d ranks, %d threads per rank\n", nranks, nthreads); #endif - // Initialize int *vec = (int*) malloc(sizeof(int) * len); for (int i = 0; i < len; i++) { @@ -60,23 +79,27 @@ int main(int argc, char* argv[]) { } ariel_enable(); + +#if TIMING auto begin = std::chrono::high_resolution_clock::now(); +#endif + long int sum = 0; #pragma omp parallel for reduction(+:sum) for (int i = 0; i < len; i++) { sum += vec[i]; } + +#if TIMING auto end = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration_cast(end-begin).count(); if (rank == 0) { std::cout << nranks << " " << nthreads << " " << duration/1000000 << "\n"; } - ariel_disable(); - -#if DEBUG - printf("Rank %d: sum is %ld\n", rank, sum); #endif + ariel_disable(); + long int tot = 0; MPI_Allreduce( &sum, @@ -86,11 +109,7 @@ int main(int argc, char* argv[]) { MPI_SUM, MPI_COMM_WORLD); - -#if DEBUG - printf("Rank %d: tot is %ld\n", rank, tot); -#endif - + fprintf(output, "Rank %d partial sum is %ld, total sum is %d\n", rank, sum, tot); MPI_Barrier(MPI_COMM_WORLD); if (rank == 0) { diff --git a/src/sst/elements/ariel/tests/testMPI/hello.cc b/src/sst/elements/ariel/tests/testMPI/hello.cc deleted file mode 100644 index a1ecbce3ea..0000000000 --- a/src/sst/elements/ariel/tests/testMPI/hello.cc +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include -#include -#include -#include - -// Useage: ./hello [output-file] -// If running with multiple ranks, each will output to its own file -int main(int argc, char* argv[]) { - - MPI_Init(&argc, &argv); - - int rank = 0; - int nranks = 0; - int ret = MPI_Comm_rank(MPI_COMM_WORLD, &rank); - if (ret != MPI_SUCCESS) { - printf("Error: MPI_Comm_rank retuned error: %d\n", ret); - exit(1); - } - ret = MPI_Comm_size(MPI_COMM_WORLD, &nranks); - if (ret != MPI_SUCCESS) { - printf("Error: MPI_Comm_rank retuned error: %d\n", ret); - exit(1); - } - - // Redirect output to a file if an argument was given. Append the rank to each filename. - FILE *output = stdout; - if (argc > 1) { - int len = strlen(argv[1]) + 12;// Space for underscore, plus up to a 10 digit integer, plus the null character - char *outfile = (char*)malloc(len); - if (!outfile) { - printf("Error allocating space for filename\n"); - } - snprintf(outfile, len, "%s_%d", argv[1], rank); - output = fopen(outfile, "w"); - if (!output) { - printf("Error opening %s\n"); - exit(1); - } - free(outfile); - } - - - ariel_enable(); -#pragma omp parallel - { - int thread = omp_get_thread_num(); -#pragma omp critical - { - // ./fakepin sets the FAKEPIN environment variale. This is useful for debugging but - // not needed for our Ariel MPI testsuite. - // We only want output from the traced process - if (std::getenv("FAKEPIN")) { - fprintf(output, "Hello from rank %d of %d, thread %d! (Launched by fakepin)\n", rank, nranks, thread); - } else if (std::getenv("PIN_CRT_TZDATA") || std::getenv("PIN_APP_LD_LIBRARY_PATH")) { - fprintf(output, "Hello from rank %d of %d, thread %d! (Launched by pin)\n", rank, nranks, thread); - } else { - fprintf(output, "Hello from rank %d of %d, thread %d!\n", rank, nranks, thread); - } - } - } - - // This is here just to make sure it doesn't crash when the processes try to communicate. - MPI_Barrier(MPI_COMM_WORLD); - ariel_disable(); - if (rank == 0) { - printf("Rank 0: Barrier complete.\n"); - } - - if (argc > 1) { - fclose(output); - } - - MPI_Finalize(); -} diff --git a/src/sst/elements/ariel/tests/testMPI/reduce.cc b/src/sst/elements/ariel/tests/testMPI/reduce.cc deleted file mode 100644 index a889167dc1..0000000000 --- a/src/sst/elements/ariel/tests/testMPI/reduce.cc +++ /dev/null @@ -1,122 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "arielapi.h" - -#define DEBUG 0 -#define TIMING 1 - -int main(int argc, char* argv[]) { - - int prov; - MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &prov); - - if (argc < 2) { - printf("Too few args\n"); - exit(1); - } - - int len = atoi(argv[1]); - - if (len < 1) { - printf("Please specify positive len\n"); - exit(1); - } - - int rank = 0; - int nranks = 0; - - int ret = MPI_Comm_rank(MPI_COMM_WORLD, &rank); - if (ret != MPI_SUCCESS) { - printf("Error: MPI_Comm_rank retuned error: %d\n", ret); - exit(1); - } - ret = MPI_Comm_size(MPI_COMM_WORLD, &nranks); - if (ret != MPI_SUCCESS) { - printf("Error: MPI_Comm_rank retuned error: %d\n", ret); - exit(1); - } - - if (len % nranks != 0) { - printf("MPI ranks must divide vector length (len = %d, nranks = %d)\n", len, nranks); - exit(1); - } - - len = len / nranks; - - FILE *output = stdout; - - if (argc > 2) { - int len = strlen(argv[2]) + 12;// Space for underscore, plus up to a 10 digit integer, plus the null character - char *outfile = (char*)malloc(len); - if (!outfile) { - printf("Error allocating space for filename\n"); - } - snprintf(outfile, len, "%s_%d", argv[2], rank); - - output = fopen(outfile, "w"); - if (!output) { - printf("Unable to open %s\n", outfile); - exit(1); - } - } - - - int nthreads = omp_get_max_threads(); - -#if DEBUG - printf("Running on %d ranks, %d threads per rank\n", nranks, nthreads); -#endif - - // Initialize - int *vec = (int*) malloc(sizeof(int) * len); - for (int i = 0; i < len; i++) { - vec[i] = rank*len + i; - } - - ariel_enable(); - -#if TIMING - auto begin = std::chrono::high_resolution_clock::now(); -#endif - - long int sum = 0; - #pragma omp parallel for reduction(+:sum) - for (int i = 0; i < len; i++) { - sum += vec[i]; - } - -#if TIMING - auto end = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration_cast(end-begin).count(); - if (rank == 0) { - std::cout << nranks << " " << nthreads << " " << duration/1000000 << "\n"; - } -#endif - - ariel_disable(); - - long int tot = 0; - MPI_Allreduce( - &sum, - &tot, - 1, - MPI_LONG, - MPI_SUM, - MPI_COMM_WORLD); - - fprintf(output, "Rank %d partial sum is %ld, total sum is %d\n", rank, sum, tot); - - MPI_Barrier(MPI_COMM_WORLD); - if (rank == 0) { -#if DEBUG - printf("Rank 0: Barrier complete.\n"); -#endif - } - - MPI_Finalize(); -} diff --git a/src/sst/elements/ariel/tests/testMPI/test-mpi.py b/src/sst/elements/ariel/tests/testMPI/test-mpi.py index 5c70fa70b2..9ed724da3b 100644 --- a/src/sst/elements/ariel/tests/testMPI/test-mpi.py +++ b/src/sst/elements/ariel/tests/testMPI/test-mpi.py @@ -2,6 +2,7 @@ import sys import os import argparse +import pathlib parser = argparse.ArgumentParser( prog=f'sst [sst-args] test-mpi.py --', @@ -44,11 +45,15 @@ ######################################################################### ## Set component parameters and fill subcomponent slots ######################################################################### +# The test executable are located in a directory with all of the other +# files that need to be compiled with MPI enabled +exe = f'../../mpi/{args.program}' + # 2.4GHz cores. One for each omp thread core.addParams({ "clock" : "2.4GHz", "verbose" : 1, - "executable" : f"./{args.program}", + "executable" : exe, "arielmode" : 0, # Disable tracing at start "corecount" : ncores, "mpimode" : 1, @@ -56,6 +61,12 @@ "mpitracerank" : tracerank, }) +# This should be detected in Ariel but checking here allows us to fail +# the test faster +if not pathlib.Path(exe).exists(): + print(f'test-mpi.py: Error: executable {exe} does not exist') + sys.exit(1) + # Set the size of the reduce vector and optionally set the output file if args.program == "reduce": if args.output is not None: diff --git a/src/sst/elements/ariel/tests/testsuite_mpi_Ariel.py b/src/sst/elements/ariel/tests/testsuite_mpi_Ariel.py index 97a50887e2..ecbc92156f 100644 --- a/src/sst/elements/ariel/tests/testsuite_mpi_Ariel.py +++ b/src/sst/elements/ariel/tests/testsuite_mpi_Ariel.py @@ -211,13 +211,7 @@ def _setup_ariel_test_files(self): self.ArielElementDir = os.path.abspath("{0}/../".format(test_path)) self.ArielElementTestMPIDir = "{0}/tests/testMPI".format(self.ArielElementDir) - # Build the Ariel API library with mpicc - ArielApiDir = "{0}/api".format(self.ArielElementDir) - cmd = "make clean" - OSCommand(cmd, set_cwd=ArielApiDir).run() - cmd = "CC=mpicc make" - rtn0 = OSCommand(cmd, set_cwd=ArielApiDir).run() - log_debug("Ariel api/libarielapi.so Make result = {0}; output =\n{1}".format(rtn0.result(), rtn0.output())) + # Apps may need this. TODO: verify os.environ["ARIELAPI"] = ArielApiDir # Build the test mpi programs