Hello community, here is the log from the commit of package libpsm2 for openSUSE:Factory checked in at 2017-11-23 09:40:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libpsm2 (Old) and /work/SRC/openSUSE:Factory/.libpsm2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libpsm2" Thu Nov 23 09:40:54 2017 rev:7 rq:544102 version:10.3.17 Changes: -------- --- /work/SRC/openSUSE:Factory/libpsm2/libpsm2.changes 2017-09-08 20:40:43.001786349 +0200 +++ /work/SRC/openSUSE:Factory/.libpsm2.new/libpsm2.changes 2017-11-23 09:41:13.203507217 +0100 @@ -1,0 +2,13 @@ +Mon Nov 20 16:42:59 UTC 2017 - nmoreychaisemar...@suse.com + +- Updated to version 10.3.17: + - Small bug fixes and some enhanced debugging. + - Assigned context is not freed on close() which could lead to + context starvation. Therefore release hfi1 mappings when closing a + context. + - Close receive thread only while closing last endpoint +- Rebase libpsm2-include-ioctl_h.patch, libpsm2-use_RPM_OPT_FLAGS.patch and + libpsm2-use-exported-variable-for-version-and-release.patch to the + latest sources. + +------------------------------------------------------------------- Old: ---- libpsm2-10.2.260.tar.bz2 New: ---- libpsm2-10.3.17.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libpsm2.spec ++++++ --- /var/tmp/diff_new_pack.23nXba/_old 2017-11-23 09:41:16.099401560 +0100 +++ /var/tmp/diff_new_pack.23nXba/_new 2017-11-23 09:41:16.099401560 +0100 @@ -20,7 +20,7 @@ %define psm_so 2 Name: libpsm2 -Version: 10.2.260 +Version: 10.3.17 Release: 0 Summary: Intel PSM Messaging API libraries License: BSD-2-Clause or GPL-2.0 @@ -84,8 +84,8 @@ %prep %setup -q -n %{name}-%{version}%{git_ver} %patch2 -%patch3 -p1 -%patch4 -p1 +%patch3 +%patch4 cp %{S:1} ChangeLog ++++++ _service ++++++ --- /var/tmp/diff_new_pack.23nXba/_old 2017-11-23 09:41:16.127400538 +0100 +++ /var/tmp/diff_new_pack.23nXba/_new 2017-11-23 09:41:16.131400392 +0100 @@ -5,11 +5,11 @@ <param name="package-meta">no</param> <param name="exclude">.git</param> <param name="filename">libpsm2</param> - <param name="version">10.2.260</param> + <param name="version">10.3.17</param> <param name="versionrewrite-pattern">PSM2_(.*)</param> <param name="versionrewrite-replacement">\1</param> <param name="match-tag">PSM2_*</param> - <param name="revision">3f30d743ffbd39703e3cecdb25d319ed199d3d97</param> + <param name="revision">96f6e83d0445246ebe39f2fcdd987749daaad049</param> </service> <service name="recompress" mode="disabled"> <param name="file">libpsm2*.tar</param> ++++++ libpsm2-10.2.260.tar.bz2 -> libpsm2-10.3.17.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/COMMIT new/libpsm2-10.3.17/COMMIT --- old/libpsm2-10.2.260/COMMIT 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/COMMIT 2017-10-20 00:34:17.000000000 +0200 @@ -1 +1 @@ -d7e63ede75bc080c68117cfa3f4e9e8b2d85e2cd \ No newline at end of file +f8df7f0de7139df384ea8b94dc8567885bf76070 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/Makefile new/libpsm2-10.3.17/Makefile --- old/libpsm2-10.2.260/Makefile 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/Makefile 2017-10-20 00:34:17.000000000 +0200 @@ -177,23 +177,34 @@ export LIBPSM2_COMPAT_CONF_DIR # The desired version number comes from the most recent tag starting with "v" -VERSION := $(shell if [ -e .git ] ; then git describe --tags --abbrev=0 --match='v*' | sed -e 's/^v//' -e 's/-/_/'; else echo "version" ; fi) +ifeq (true, $(shell git rev-parse --is-inside-work-tree 2>/dev/null)) +ISGIT := 1 # Cache the result for later +# Note, we don't define ISGIT if we are not in a git folder +VERSION := $(shell git describe --tags --abbrev=0 --match='psm-v*' | sed -e 's/^psm-v//' -e 's/-/_/') +else +ISGIT := 0 +VERSION := version +endif # If we have a file called 'rpm_release_extension' (as on github), # we take the release extension number from this file -RELEASE_EXT := $(shell if [ -e rpm_release_extension ] ; then cat rpm_release_extension; fi) -CURRENTSHA := $(shell if [ -e .git -a -f rpm_release_extension ] ; then git log --pretty=format:'%h' -n 1; fi) -RPMEXTHASH := $(shell if [ -e .git -a -f rpm_release_extension ] ; then git log --pretty=format:'%h' -n 1 rpm_release_extension; fi) +RELEASE_EXT := $(shell if [ -e rpm_release_extension ] ;\ + then cat rpm_release_extension; fi) +CURRENTSHA := $(shell if [ $(ISGIT) = 1 -a -f rpm_release_extension ] ;\ + then git log --pretty=format:'%h' -n 1; fi) +RPMEXTHASH := $(shell if [ $(ISGIT) = 1 -a -f rpm_release_extension ] ;\ + then git log --pretty=format:'%h' -n 1 rpm_release_extension; fi) +# This logic should kick-in only on github +ifdef RELEASE_EXT +ifneq ($(CURRENTSHA), $(RPMEXTHASH)) # On github, the last commit for each release should be the one to bump up # the release extension number in 'rpm_release_extension'. Further commits # are counted here and appended to the final rpm name to distinguish commits # present only on github -NCOMMITS := $(shell if [ -e .git -a -f rpm_release_extension ] ; then git log $(RPMEXTHASH)..$(CURRENTSHA) --pretty=oneline | wc -l; fi) - -# This logic should kick-in only on github -ifdef RELEASE_EXT -ifneq ($(CURRENTSHA), $(RPMEXTHASH)) +NCOMMITS := $(shell if [ $(ISGIT) = 1 -a -f rpm_release_extension ] ;\ + then git log --children $(RPMEXTHASH)..$(CURRENTSHA) \ + --pretty=oneline . | wc -l; fi) RELEASE := $(RELEASE_EXT)_$(NCOMMITS) endif endif @@ -201,14 +212,13 @@ # The desired release number comes the git describe following the version which # is the number of commits since the version tag was planted suffixed by the g<commitid> ifndef RELEASE +RELTAG := "psm-v$(VERSION)" RELEASE := $(shell if [ -f rpm_release_extension ]; then cat rpm_release_extension;\ - elif [ -e .git ] ; then git describe --tags --long --match='v*' | \ - sed -e 's/v[0-9.]*-\(.*\)/\1/' -e 's/-/_/' | \ - sed -e 's/_g.*$$//'; \ + elif [ $(ISGIT) = 1 ] ; then git rev-list $(RELTAG)..HEAD -- . | wc -l; \ else echo "release" ; fi) endif -DIST_SHA := ${shell if [ -e .git ] ; then git log -n1 --pretty=format:%H ; \ +DIST_SHA := ${shell if [ $(ISGIT) = 1 ] ; then git log -n1 --pretty=format:%H .; \ else echo DIST_SHA ; fi} # Concatenated version and release @@ -218,7 +228,7 @@ VERSION_RELEASE := ${VERSION_RELEASE_OVERRIDE} endif -LDLIBS := -lrt -lpthread -ldl -lnuma ${EXTRA_LIBS} +LDLIBS := -lrt -ldl -lnuma ${EXTRA_LIBS} -pthread PKG_CONFIG ?= pkg-config @@ -399,7 +409,7 @@ mkdir -p ${OUTDIR}/${DIST}/$$dir; \ [ ! -d $$x ] && cp $$x ${OUTDIR}/${DIST}/$$dir; \ done - if [ -e .git ] ; then git log -n1 --pretty=format:%H > ${OUTDIR}/${DIST}/COMMIT ; fi + if [ $(ISGIT) = 1 ] ; then git log -n1 --pretty=format:%H . > ${OUTDIR}/${DIST}/COMMIT ; fi echo ${RELEASE} > ${OUTDIR}/${DIST}/rpm_release_extension cd ${OUTDIR}; tar czvf ${DIST}.tar.gz ${DIST} @echo "${DIST}.tar.gz is located in ${OUTDIR}/${DIST}.tar.gz" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/README new/libpsm2-10.3.17/README --- old/libpsm2-10.2.260/README 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/README 2017-10-20 00:34:17.000000000 +0200 @@ -148,12 +148,13 @@ This command results in the following collection of rpm's and source code rpm's under your $PWD/temp.X/ directory. ("X" is the pid of the bash script that created the srpm and rpm files) + (Result shown here for RHEL systems.) - RPMS/x86_64/libpsm2-compat-10.2.171-1x86_64.rpm - RPMS/x86_64/libpsm2-devel-10.2.171-1x86_64.rpm - RPMS/x86_64/libpsm2-10.2.171-1x86_64.rpm - RPMS/x86_64/libpsm2-debuginfo-10.2.171-1x86_64.rpm - SRPMS/libpsm2-10.2.171-1.src.rpm + RPMS/x86_64/libpsm2-compat-10.3.7-1x86_64.rpm + RPMS/x86_64/libpsm2-devel-10.3.7-1x86_64.rpm + RPMS/x86_64/libpsm2-10.3.7-1x86_64.rpm + RPMS/x86_64/libpsm2-debuginfo-10.3.7-1x86_64.rpm + SRPMS/libpsm2-10.3.7-1.src.rpm 1.1. Optionally for GPU Direct support run this command from your $PWD to generate rpm, srpm files @@ -162,10 +163,16 @@ This command results in the following collection of rpm's and source code rpm's under your $PWD/temp.X/ directory. ("X" is the pid of the bash script that created the srpm and rpm files): - RPMS/x86_64/libpsm2-10.2.171-1cuda.x86_64.rpm - RPMS/x86_64/libpsm2-compat-10.2.171-1cuda.x86_64.rpm - RPMS/x86_64/libpsm2-devel-10.2.171-1cuda.x86_64.rpm - SRPMS/x86_64/libpsm2-10.2.171-1cuda.src.rpm + RPMS/x86_64/libpsm2-10.3.7-1cuda.x86_64.rpm + RPMS/x86_64/libpsm2-compat-10.3.7-1cuda.x86_64.rpm + RPMS/x86_64/libpsm2-devel-10.3.7-1cuda.x86_64.rpm + SRPMS/x86_64/libpsm2-10.3.7-1cuda.src.rpm + + On systems with SLES 12.3 or newer, the package name for the base libpsm2 + RPM will be: + libpsm2-2-10.3.7-1.x86_64.rpm + + Other supporting RPM package names will be as listed above. INSTALLING ========== @@ -223,10 +230,11 @@ latest development branch allowing a single OpenMPI installation to target HFI hardware via PSM2 or Verbs as well as alternate transports seamlessly. -If NVIDIA CUDA support is wanted at this time, the Intel provided OpenMPI -1.10.4-cuda-hfi from the IFS installer v10.4.X and newer are needed for proper -support. Intel has done slight modifications to this libray which have not -been upstreamed yet. +If NVIDIA CUDA support is desired, you can use the OpenMPI build +(v1.10.4-cuda-hfi) provided by Intel in the IFS installer v10.4.X or newer. +The changes have also been accepted into v3.0.x branch of upstream OpenMPI +repository. Therefore subsequent v3.0.x versions of OpenMPI should carry the +required OpenMPI support for PSM2 GPUDirect feature. PSM2 header and runtime files need to be installed on a node where the OpenMPI build is performed. All compute nodes additionally should have the PSM2 runtime @@ -264,8 +272,8 @@ are available for use. For sample code on writing applications leveraging the PSM2 APIs, refer to Section 5. -Link to latest (as of Mar 2017) PSM2 Programmer's Guide: -http://www.intel.com/content/dam/support/us/en/documents/network-and-i-o/fabric-products/Intel_PSM2_PG_H76473_v5_0.pdf +Link to latest (as of Sep 2017) PSM2 Programmer's Guide: +https://www.intel.com/content/dam/support/us/en/documents/network-and-i-o/fabric-products/Intel_PSM2_PG_H76473_v7_0.pdf PSM Compatibility Support ------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/buildflags.mak new/libpsm2-10.3.17/buildflags.mak --- old/libpsm2-10.2.260/buildflags.mak 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/buildflags.mak 2017-10-20 00:34:17.000000000 +0200 @@ -80,7 +80,7 @@ anerr := $(error Unknown Fortran compiler arch: ${FCARCH}) endif # gfortran -BASECFLAGS += $(BASE_FLAGS) +BASECFLAGS += $(BASE_FLAGS) -pthread LDFLAGS += $(BASE_FLAGS) ASFLAGS += $(BASE_FLAGS) @@ -155,9 +155,9 @@ LDFLAGS += -fprofile-arcs endif ifneq (,${PSM_LOG}) - BASECFLAGS += -DPSM_LOG + BASECFLAGS += -DPSM2_LOG ifneq (,${PSM_LOG_FAST_IO}) - BASECFLAGS += -DPSM_LOG_FAST_IO + BASECFLAGS += -DPSM2_LOG_FAST_IO PSM2_ADDITIONAL_GLOBALS += psmi_log_fini;psmi_log_message; endif endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/debian/symbols new/libpsm2-10.3.17/debian/symbols --- old/libpsm2-10.2.260/debian/symbols 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/debian/symbols 2017-10-20 00:34:17.000000000 +0200 @@ -20,9 +20,12 @@ psm2_am_register_handlers@PSM2_1.0 10.2 psm2_am_reply_short@PSM2_1.0 10.2 psm2_am_request_short@PSM2_1.0 10.2 + psm2_capabilities_bitset@PSM2_1.0 10.3.0 psm2_ep_close@PSM2_1.0 10.2 psm2_ep_connect@PSM2_1.0 10.2 + psm2_ep_disconnect2@PSM2_1.0 10.3.0 psm2_ep_disconnect@PSM2_1.0 10.2 + psm2_ep_epid_lookup2@PSM2_1.0 10.3.0 psm2_ep_epid_lookup@PSM2_1.0 10.2 psm2_ep_epid_share_memory@PSM2_1.0 10.2 psm2_ep_num_devunits@PSM2_1.0 10.2 @@ -32,6 +35,7 @@ psm2_epaddr_getctxt@PSM2_1.0 10.2 psm2_epaddr_setctxt@PSM2_1.0 10.2 psm2_epaddr_setlabel@PSM2_1.0 10.2 + psm2_epaddr_to_epid@PSM2_1.0 10.3.0 psm2_epid_context@PSM2_1.0 10.2 psm2_epid_nid@PSM2_1.0 10.2 psm2_epid_port@PSM2_1.0 10.2 @@ -39,6 +43,7 @@ psm2_error_get_string@PSM2_1.0 10.2 psm2_error_register_handler@PSM2_1.0 10.2 psm2_finalize@PSM2_1.0 10.2 + psm2_get_capability_mask@PSM2_1.0 10.3.0 psm2_getopt@PSM2_1.0 10.2 psm2_init@PSM2_1.0 10.2 psm2_map_nid_hostname@PSM2_1.0 10.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/makesdeb.sh new/libpsm2-10.3.17/makesdeb.sh --- old/libpsm2-10.2.260/makesdeb.sh 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/makesdeb.sh 2017-10-20 00:34:17.000000000 +0200 @@ -21,7 +21,7 @@ # # BSD LICENSE # -# Copyright(c) 2016 Intel Corporation. +# Copyright(c) 2017 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -53,8 +53,17 @@ # Stop on error set -e -BUILD_OPTS="gFGbBAS" -BUILD_OPT=F +BUILD_OPTS="gGbBAS" +BUILD_OPT= +DEB_NAME=libpsm2 + +# OUT_DIR is where the Makefile places its meta-data +OUT_DIR=build_release + +# Set BUILD_DIR first, so user control can override the value +# This is where this script places deb(s) and uses its build meta-data. +# It can be set the same as OUT_DIR, and work just fine if desired. +BUILD_DIR=temp.$$ function literate() { @@ -63,21 +72,61 @@ function usage() { - echo "Usage: ${0##*/} [-h] [debuild -($(literate $BUILD_OPTS '|'))]" + SCRIPT=${0##*/} + echo "Usage: $SCRIPT [OPTIONS]" + echo + echo "Creates tar ball of source and source rpms by default." + echo "Optionally generates binary rpm(s) " + echo + echo " $(literate $BUILD_OPTS ',')" + echo " Optional, default is full build (source and binary)" + echo " Set single extension letter for dpkg-buildpackage argument" + echo " -r <name>" + echo " Optional, set the output deb name" + echo " -e <basename ext>" + echo " Optional, set a base name extension" + echo " This only appends an extra string onto the base DEB name" + echo " Does not affect supporting DEBs" + echo " -c" + echo " Optional, default is unset" + echo " Sets PSM_CUDA=1, creating -cuda based manifest and debs" + echo " -d <path>" + echo " Optionally sets output folder for dpkg-buildpackage to use" + echo " -h" + echo " Shows this screen" + echo " Examples:" + echo " $SCRIPT b" + echo " $SCRIPT s -c" + echo " $SCRIPT -" + echo " $SCRIPT -d ./temp" + echo " $SCRIPT b -c -d output" exit $1 } -while getopts "h$BUILD_OPTS" OPT; do +while getopts "r:e:cd:h$BUILD_OPTS" OPT; do case $OPT in + r) + DEB_NAME=$OPTARG + ;; + e) + BASE_EXT=$OPTARG + ;; + c) + export PSM_CUDA=1 + DEB_EXT="-cuda" + ;; + d) + BUILD_DIR=$OPTARG + ;; h) - usage - ;; + usage 0 + ;; \?) usage 1 - ;; + ;; *) - BUILD_OPT=$OPT - ;; + BUILD_OPT=-$OPT + ;; esac done @@ -87,19 +136,34 @@ # Check if we have any non-option parameters test ! $# -eq 0 && usage -# Annotate changelog -cat debian/changelog.in > debian/changelog +# Generic cleanup, build, and tmp folder creation +make distclean OUTDIR=$OUT_DIR -GIT_TAG_PREFIX=v -GIT_TAG_RELEASE=$(git describe --tags --long --match="$GIT_TAG_PREFIX*") -VERSION=$(sed -e "s/^$GIT_TAG_PREFIX\(.\+\)-\(.\+\)-.\+/\1_\2/" -e 's/_/./g' <<< "$GIT_TAG_RELEASE") +make RPM_NAME=$DEB_NAME RPM_NAME_BASEEXT=$BASE_EXT dist OUTDIR=$OUT_DIR -debchange --newversion=$VERSION "Bump up version to $VERSION" +# Prepare build area +mkdir -p $BUILD_DIR/{build,binary,sources,dists} + +# Differnet paths based on DEB_EXT +cp $OUT_DIR/$DEB_NAME-*.tar.gz $BUILD_DIR/dists/ + +FILE_BASE=$(basename $BUILD_DIR/dists/$DEB_NAME-*.tar.gz .tar.gz) +VERSION=${FILE_BASE##$DEB_NAME-} + +echo Building $DEB_NAME version $VERSION... -debchange --release "" +tar xzf $BUILD_DIR/dists/$DEB_NAME-$VERSION.tar.gz -C $BUILD_DIR/build + +(cd $BUILD_DIR/build/$DEB_NAME-$VERSION + +# Annotate changelog +mv debian/changelog.in debian/changelog +debchange --newversion=$VERSION "Bump up version to $VERSION" # Build package -debuild -$BUILD_OPT -tc +dpkg-buildpackage $BUILD_OPT -us -uc -tc) -echo "The deb package(s) is (are) in parent directory" +mv $BUILD_DIR/build/$DEB_NAME*{.tar.xz,.dsc,.changes} $BUILD_DIR/sources/ +mv $BUILD_DIR/build/$DEB_NAME*{.deb,.ddeb} $BUILD_DIR/binary/ +echo "The deb package(s) is (are) in $BUILD_DIR/binary/$(ls $BUILD_DIR/binary)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/opa/opa_debug.c new/libpsm2-10.3.17/opa/opa_debug.c --- old/libpsm2-10.2.260/opa/opa_debug.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/opa/opa_debug.c 2017-10-20 00:34:17.000000000 +0200 @@ -173,10 +173,10 @@ static char buf[150], hname[64], fname[128]; static int i, j, fd, id; extern char *__progname; - PSM_LOG_DECLARE_BT_BUFFER(); + PSM2_LOG_DECLARE_BT_BUFFER(); - /* CALLS UNSAFE FUNCTION when PSM_LOG is defined. */ - PSM_LOG_BT(100,__FUNCTION__); + /* CALLS UNSAFE FUNCTION when PSM2_LOG is defined. */ + PSM2_LOG_BT(100,__FUNCTION__); /* If this is a SIGINT do not display backtrace. Just invoke exit handlers */ if ((sig == SIGINT) || (sig == SIGTERM)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/opa/opa_utils.c new/libpsm2-10.3.17/opa/opa_utils.c --- old/libpsm2-10.2.260/opa/opa_utils.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/opa/opa_utils.c 2017-10-20 00:34:17.000000000 +0200 @@ -191,10 +191,14 @@ cmd.len = 0; cmd.addr = (uint64_t) pkey; + _HFI_VDBG("Setting context pkey to %x.\n", (unsigned int) pkey); if (hfi_cmd_write(ctrl->fd, &cmd, sizeof(cmd)) == -1) { - if (errno != EINVAL) - _HFI_INFO("set pkey failed: %s\n", strerror(errno)); + _HFI_INFO("Setting context pkey to %x failed: %s\n", + (unsigned int) pkey, strerror(errno)); return -1; + } else { + _HFI_VDBG("Successfully set context pkey to %x.\n", + (unsigned int) pkey); } return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/psm_context.c new/libpsm2-10.3.17/psm_context.c --- old/libpsm2-10.2.260/psm_context.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/psm_context.c 2017-10-20 00:34:17.000000000 +0200 @@ -494,6 +494,44 @@ psm2_error_t psmi_context_close(psmi_context_t *context) { if (context->fd >= 0) { + struct hfi1_base_info *binfo; + struct hfi1_ctxt_info *cinfo; + int __hfi_pg_sz = sysconf(_SC_PAGESIZE); + binfo = &context->ctrl->base_info; + cinfo = &context->ctrl->ctxt_info; + + munmap((void*)PSMI_ALIGNDOWN(binfo->sc_credits_addr, __hfi_pg_sz), + __hfi_pg_sz); + munmap((void*)PSMI_ALIGNDOWN(binfo->pio_bufbase_sop, __hfi_pg_sz), + cinfo->credits * 64); + munmap((void*)PSMI_ALIGNDOWN(binfo->pio_bufbase, __hfi_pg_sz), + cinfo->credits * 64); + munmap((void*)PSMI_ALIGNDOWN(binfo->rcvhdr_bufbase, __hfi_pg_sz), + cinfo->rcvhdrq_cnt * cinfo->rcvhdrq_entsize); + munmap((void*)PSMI_ALIGNDOWN(binfo->rcvegr_bufbase, __hfi_pg_sz), + cinfo->egrtids * cinfo->rcvegr_size); + munmap((void*)PSMI_ALIGNDOWN(binfo->sdma_comp_bufbase, __hfi_pg_sz), + cinfo->sdma_ring_size * sizeof(struct hfi1_sdma_comp_entry)); + /* only unmap the RTAIL if it was enabled in the first place */ + if (cinfo->runtime_flags & HFI1_CAP_DMA_RTAIL) { + munmap((void*)PSMI_ALIGNDOWN(binfo->rcvhdrtail_base, __hfi_pg_sz), + __hfi_pg_sz); + } + munmap((void*)PSMI_ALIGNDOWN(binfo->events_bufbase, __hfi_pg_sz), + __hfi_pg_sz); + munmap((void*)PSMI_ALIGNDOWN(binfo->status_bufbase, __hfi_pg_sz), + __hfi_pg_sz); + + /* only unmap subcontext-related stuff it subcontexts are enabled */ + if (context->user_info.subctxt_cnt > 0) { + munmap((void*)PSMI_ALIGNDOWN(binfo->subctxt_uregbase, __hfi_pg_sz), + __hfi_pg_sz); + munmap((void*)PSMI_ALIGNDOWN(binfo->subctxt_rcvhdrbuf, __hfi_pg_sz), + __hfi_pg_sz); + munmap((void*)PSMI_ALIGNDOWN(binfo->subctxt_rcvegrbuf, __hfi_pg_sz), + __hfi_pg_sz); + } + hfi_context_close(context->fd); context->fd = -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/psm_ep.c new/libpsm2-10.3.17/psm_ep.c --- old/libpsm2-10.2.260/psm_ep.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/psm_ep.c 2017-10-20 00:34:17.000000000 +0200 @@ -1205,6 +1205,22 @@ * interface to allow asynchronous finalization */ + + /* Check if transfer ownership of receive thread is needed before closing ep. + * In case of PSM2_MULTI_EP support receive thread is created and assigned + * to first opened endpoint. Receive thread is killed when closing this + * endpoint. + */ + if (ep->user_ep_next != NULL) { + /* Receive thread will be transfered and assigned to ep->user_ep_next + * only if currently working receive thread (which will be killed) is + * assigned to ep and there isn't any assigned to ep->user_ep_next. + */ + if ((psmi_ptl_ips_rcvthread.is_enabled(ep->ptl_ips.ptl)) && + (!psmi_ptl_ips_rcvthread.is_enabled(ep->user_ep_next->ptl_ips.ptl))) + psmi_ptl_ips_rcvthread.transfer_ownership(ep->ptl_ips.ptl, ep->user_ep_next->ptl_ips.ptl); + } + /* * Before freeing the master ep itself, * remove it from the global linklist. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/psm_log.h new/libpsm2-10.3.17/psm_log.h --- old/libpsm2-10.2.260/psm_log.h 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/psm_log.h 2017-10-20 00:34:17.000000000 +0200 @@ -56,19 +56,19 @@ /* - A note about PSM_LOG and PSM_LOG_FAST_IO: + A note about PSM2_LOG and PSM2_LOG_FAST_IO: - By default, the PSM_LOG facility is safe, slow, and is complete. That is, if the + By default, the PSM2_LOG facility is safe, slow, and is complete. That is, if the test case you are debugging has an abnormal termiation, no problem. The logs are saved up to the point of the abnormal termination. Abnormal termination can be a seg fault, the test case issues a fatal error, or exit()'s or abort()'s. - However, debugging timing sensitive problems, make the usual SLOW PSM_LOG + However, debugging timing sensitive problems, make the usual SLOW PSM2_LOG facility inadequate as the timing overhead that it introduces dominates, and the symptoms of your problem may change or go away. - For this case, you can use BOTH: PSM_LOG and PSM_LOG_FAST_IO. To use - PSM_LOG_FAST_IO though, caution: for abnormal program termination, you will get + For this case, you can use BOTH: PSM2_LOG and PSM2_LOG_FAST_IO. To use + PSM2_LOG_FAST_IO though, caution: for abnormal program termination, you will get no log file. To workaround this problem, and allow you to get a log file even after an abnormal @@ -84,23 +84,23 @@ By default, these macros are not defined when building psm. When not defined, the macros become no-ops in the PSM code. - When enabled (by defining the PSM_LOG symbol), the macros present information to + When enabled (by defining the PSM2_LOG symbol), the macros present information to the psmi_log_message() facility for processing. See below for more information on the psmi_log_message() facility. - To enable the macros, build PSM with the PSM_LOG environment variable exported, ala: + To enable the macros, build PSM with the PSM2_LOG environment variable exported, ala: - PSM_LOG=1 make ... + PSM2_LOG=1 make ... The macros are described in the following: PSM2_LOG_MSG(FORMAT,...) Spills a printf-style message to the log. - PSM_LOG_DECLARE_BT_BUFFER() Declares a local back trace buffer for use with the - PSM_LOG_BT() macro. - PSM_LOG_BT(NFRAMES,FORMAT,...) Spills the current backtrace, if it differs from the + PSM2_LOG_DECLARE_BT_BUFFER() Declares a local back trace buffer for use with the + PSM2_LOG_BT() macro. + PSM2_LOG_BT(NFRAMES,FORMAT,...) Spills the current backtrace, if it differs from the previous backtrace spilled to the log. - The psmi_log_message() facility is the backend for these messages when PSM_LOG is enabled. + The psmi_log_message() facility is the backend for these messages when PSM2_LOG is enabled. The psmi_log_message() facility spills messages to unique log files based on the process id and the thread id. So every unique process id, and thread id will spill to unique log files. The psmi_log_message prefixes each message in the log files with a high resolution timer @@ -108,15 +108,15 @@ It is left as an exercise to the reader to reconcile log messages from different hosts to one timeline. - The backtrace capability in the PSM_LOG functionality needs some explanation: often a bug - happens only when the code is tickled from a specific call-chain. The PSM_LOG_BT() macro + The backtrace capability in the PSM2_LOG functionality needs some explanation: often a bug + happens only when the code is tickled from a specific call-chain. The PSM2_LOG_BT() macro supports identifying the unique call-chain when a problem occurs. The model is as follows: A unique declaration is made for a backtrace to spill the backtrace information to. This - declaration should be made in the same basic block as the use of the PSM_LOG_BT() macro. - To make the declaration, use PSM_LOG_DECLARE_BT_BUFFER(). + declaration should be made in the same basic block as the use of the PSM2_LOG_BT() macro. + To make the declaration, use PSM2_LOG_DECLARE_BT_BUFFER(). - When the PSM_LOG is enabled, at the statement for the macro: PSM_LOG_BT(NFRAMES,FORMAT,...), + When the PSM2_LOG is enabled, at the statement for the macro: PSM2_LOG_BT(NFRAMES,FORMAT,...), the psmi_log_message() facility generates the current backtrace, and compares the first NFRAMES of the current backtrace against the previous backtrace stored in the backtrace buffer declared with the declaration. If the two backtraces differ, the psmi_log_message() @@ -160,11 +160,11 @@ */ -#define PSM_LOG_EPM_TX ((int)1) -#define PSM_LOG_EPM_RX ((int)0) +#define PSM2_LOG_EPM_TX ((int)1) +#define PSM2_LOG_EPM_RX ((int)0) -#ifdef PSM_LOG +#ifdef PSM2_LOG extern void psmi_log_initialize(void); @@ -174,7 +174,7 @@ int lineNumber, const char *format, ...); -#ifdef PSM_LOG_FAST_IO +#ifdef PSM2_LOG_FAST_IO extern void psmi_log_fini(void); #else #define psmi_log_fini() /* nothing */ @@ -182,26 +182,30 @@ #define PSM2_LOG_MSG(FORMAT , ...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,FORMAT, ## __VA_ARGS__) -#define PSM_LOG_BT_BUFFER_SIZE 100 +#define PSM2_LOG_BT_BUFFER_SIZE 100 -#define PSM_LOG_DECLARE_BT_BUFFER() static void * psm_log_bt_buffer[PSM_LOG_BT_BUFFER_SIZE] +#define PSM2_LOG_DECLARE_BT_BUFFER() static void * psm_log_bt_buffer[PSM2_LOG_BT_BUFFER_SIZE] -#define PSM_LOG_BT_MAGIC ((const char *)-1) +#define PSM2_LOG_BT_MAGIC ((const char *)-1) -#define PSM_LOG_BT(NFRAMES,FORMAT , ...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,PSM_LOG_BT_MAGIC,psm_log_bt_buffer,NFRAMES,FORMAT, ## __VA_ARGS__) +#define PSM2_LOG_BT(NFRAMES,FORMAT , ...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,PSM2_LOG_BT_MAGIC,psm_log_bt_buffer,NFRAMES,FORMAT, ## __VA_ARGS__) -#define PSM_LOG_EPM_MAGIC ((const char *)-2) +#define PSM2_LOG_EPM_MAGIC ((const char *)-2) /* EPM is short for Emit Protocol Message to the log file. OPCODE is an int, and corresponds to one of the OPCODES declared in ptl_ips/ips_proto_header.h -TXRX is an int, and should be one of the above two consts (PSM_LOG_EPM_TX, or PSM_LOG_EPM_RX). +TXRX is an int, and should be one of the above two consts (PSM2_LOG_EPM_TX, or PSM2_LOG_EPM_RX). FROMEPID and TOEPID are uint64_t's and the fromepid should be the epid (end point id) of the sender of the message and the toepid should be the epid (end point id) of the receiver of the message */ -#define PSM_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,PSM_LOG_EPM_MAGIC,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT, ## __VA_ARGS__) +#define PSM2_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,PSM2_LOG_EPM_MAGIC,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT, ## __VA_ARGS__) -/* Just adds a condition to the PSM_LOG_EPM() macro. */ -#define PSM_LOG_EPM_COND(COND,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) if (COND) PSM_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT, ## __VA_ARGS__) +/* Just adds a condition to the PSM2_LOG_EPM() macro. */ +#define PSM2_LOG_EPM_COND(COND,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) if (COND) PSM2_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT, ## __VA_ARGS__) + +#define PSM2_LOG_DUMP_MAGIC ((const char *)-3) + +#define PSM2_LOG_MSG_DUMP(ADDR,SIZE,FORMAT , ...) psmi_log_message(__FILE__,__FUNCTION__,__LINE__,PSM2_LOG_DUMP_MAGIC,ADDR,SIZE,FORMAT, ## __VA_ARGS__) #else @@ -211,14 +215,16 @@ #define psmi_log_fini() /* nothing */ -#define PSM_LOG_DECLARE_BT_BUFFER() /* nothing */ +#define PSM2_LOG_DECLARE_BT_BUFFER() /* nothing */ + +#define PSM2_LOG_BT(NFRAMES,FORMAT , ...) /* nothing */ -#define PSM_LOG_BT(NFRAMES,FORMAT , ...) /* nothing */ +#define PSM2_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) /* nothing */ -#define PSM_LOG_EPM(OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) /* nothing */ +#define PSM2_LOG_EPM_COND(COND,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) /* nothing */ -#define PSM_LOG_EPM_COND(COND,OPCODE,TXRX,FROMEPID,TOEPID,FORMAT,...) /* nothing */ +#define PSM2_LOG_MSG_DUMP(ADDR,SIZE,FORMAT , ...) /* nothing */ -#endif /* #ifdef PSM_LOG */ +#endif /* #ifdef PSM2_LOG */ #endif /* #ifndef _PSMI_LOG_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/psm_mq_recv.c new/libpsm2-10.3.17/psm_mq_recv.c --- old/libpsm2-10.2.260/psm_mq_recv.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/psm_mq_recv.c 2017-10-20 00:34:17.000000000 +0200 @@ -275,7 +275,7 @@ } req->recv_msgoff = req->send_msgoff = paylen; *req_o = req; /* yes match */ - PSM_LOG_EPM(OPCODE_LONG_RTS,PSM_LOG_EPM_RX,src->epid,mq->ep->epid, + PSM2_LOG_EPM(OPCODE_LONG_RTS,PSM2_LOG_EPM_RX,src->epid,mq->ep->epid, "req->rts_reqidx_peer: %d",req->rts_reqidx_peer); rc = MQ_RET_MATCH_OK; } else if (msgorder > 1) { @@ -292,8 +292,8 @@ /* We don't know recv_msglen yet but we set it here for * mq_iprobe */ req->send_msglen = req->recv_msglen = send_msglen; - PSM_LOG_EPM_COND(req->send_msglen > mq->hfi_thresh_rv, - OPCODE_LONG_RTS,PSM_LOG_EPM_RX,src->epid,mq->ep->epid, + PSM2_LOG_EPM_COND(req->send_msglen > mq->hfi_thresh_rv, + OPCODE_LONG_RTS,PSM2_LOG_EPM_RX,src->epid,mq->ep->epid, "req->rts_reqidx_peer: %d",req->rts_reqidx_peer); req->state = MQ_STATE_UNEXP_RV; req->peer = src; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/psm_utils.c new/libpsm2-10.3.17/psm_utils.c --- old/libpsm2-10.2.260/psm_utils.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/psm_utils.c 2017-10-20 00:34:17.000000000 +0200 @@ -1682,7 +1682,7 @@ return psmi_amopt_ctl(am_obj, optname, optval, optlen, 1); } -#ifdef PSM_LOG +#ifdef PSM2_LOG #include <execinfo.h> #include <stdio.h> @@ -1692,7 +1692,7 @@ #include "ptl_ips/ips_proto_header.h" /* A treeNode is used to store the list of Function Name Lists that - are passed to the PSM_LOG facility via environment variables. + are passed to the PSM2_LOG facility via environment variables. See psm_log.h for more information. Note that treeNode is a node in a binary tree data structure. */ @@ -2064,8 +2064,8 @@ { switch(txrx) { - case PSM_LOG_EPM_TX: return "Sent"; - case PSM_LOG_EPM_RX: return "Received"; + case PSM2_LOG_EPM_TX: return "Sent"; + case PSM2_LOG_EPM_RX: return "Received"; default: return "Unknown"; } } @@ -2098,7 +2098,7 @@ &excludeFunctionNamesTreeRoot); } -#ifdef PSM_LOG_FAST_IO +#ifdef PSM2_LOG_FAST_IO struct psmi_log_io_thread_info { @@ -2328,7 +2328,7 @@ #endif -/* plmf is short for 'psm log message facility. All of the PSM_LOG macros defined in psm_log.h +/* plmf is short for 'psm log message facility. All of the PSM2_LOG macros defined in psm_log.h are serviced from this back end. */ void psmi_log_message(const char *fileName, const char *functionName, @@ -2342,7 +2342,9 @@ /* Next, determine if this log message is signal or noise. */ if (plmf_search_format_string) { - if((format != PSM_LOG_BT_MAGIC) && (format != PSM_LOG_EPM_MAGIC)) + if((format != PSM2_LOG_BT_MAGIC) && + (format != PSM2_LOG_EPM_MAGIC) && + (format != PSM2_LOG_DUMP_MAGIC)) { if (fnmatch(plmf_search_format_string, format, 0)) { @@ -2376,8 +2378,8 @@ } /* At this point, we think that this may be a message that we want to emit to the log. - But, there is one more test, to apply to the two cases where (format == PSM_LOG_BT_MAGIC - and format == PSM_LOG_EPM_MAGIC. */ + But, there is one more test, to apply to the two cases where (format == PSM2_LOG_BT_MAGIC + and format == PSM2_LOG_EPM_MAGIC and format == PSM2_LOG_DUMP_MAGIC. */ { void **voidarray = NULL; /*va_arg(ap,void **);*/ int nframes = 0; /*va_arg(ap,int);*/ @@ -2386,8 +2388,10 @@ int txrx = 0; uint64_t fromepid = 0; uint64_t toepid = 0; + void *dumpAddr = 0; + size_t dumpSize = 0; -#ifdef PSM_LOG_FAST_IO +#ifdef PSM2_LOG_FAST_IO #define IO_PORT 0 #define MY_FPRINTF psmi_buff_fprintf #define MY_VFPRINTF psmi_buff_vfprintf @@ -2404,46 +2408,40 @@ #endif struct timespec tp; - if (format == PSM_LOG_BT_MAGIC) + /* Pop arguments for the alternative forms of PSM2_LOG functionality: */ + if (format == PSM2_LOG_BT_MAGIC) { voidarray = va_arg(ap,void **); nframes = va_arg(ap,int); newFormat = va_arg(ap,const char *); - /* One last test to make sure that this message is signal: */ - if (plmf_search_format_string) - { - { - if (fnmatch(plmf_search_format_string, newFormat, 0)) - { - va_end(ap); - /* tis noise, return. */ - return; - } - } - } } - else if (format == PSM_LOG_EPM_MAGIC) + else if (format == PSM2_LOG_EPM_MAGIC) { opcode = va_arg(ap,int); txrx = va_arg(ap,int); fromepid = va_arg(ap,uint64_t); toepid = va_arg(ap,uint64_t); newFormat = va_arg(ap,const char *); - /* One last test to make sure that this message is signal: */ - if (plmf_search_format_string) + } + else if (format == PSM2_LOG_DUMP_MAGIC) + { + dumpAddr = va_arg(ap,void*); + dumpSize = va_arg(ap,size_t); + newFormat = va_arg(ap,const char *); + } + + /* One last test to make sure that this message is signal: */ + if (plmf_search_format_string && newFormat) + { + if (fnmatch(plmf_search_format_string, newFormat, 0)) { - { - if (fnmatch(plmf_search_format_string, newFormat, 0)) - { - va_end(ap); - /* tis noise, return. */ - return; - } - } + va_end(ap); + /* tis noise, return. */ + return; } } -#ifdef PSM_LOG_FAST_IO +#ifdef PSM2_LOG_FAST_IO if (psmi_log_register_tls() != 0) { va_end(ap); @@ -2469,16 +2467,18 @@ M1(); - if ((format != PSM_LOG_BT_MAGIC) && (format != PSM_LOG_EPM_MAGIC)) + if ((format != PSM2_LOG_BT_MAGIC) && + (format != PSM2_LOG_EPM_MAGIC) && + (format != PSM2_LOG_DUMP_MAGIC)) { MY_VFPRINTF(IO_PORT,format,ap); MY_FPUTC('\n',IO_PORT); } - else if (format == PSM_LOG_BT_MAGIC) + else if (format == PSM2_LOG_BT_MAGIC) { - void *newframes[PSM_LOG_BT_BUFFER_SIZE]; + void *newframes[PSM2_LOG_BT_BUFFER_SIZE]; int newframecnt = backtrace(newframes, - PSM_LOG_BT_BUFFER_SIZE); + PSM2_LOG_BT_BUFFER_SIZE); int pframes = min(newframecnt,nframes); MY_VFPRINTF(IO_PORT,newFormat,ap); @@ -2494,26 +2494,22 @@ MY_FPRINTF(IO_PORT, "backtrace() returned %d addresses\n", newframecnt); - strings = backtrace_symbols(voidarray, pframes); if (strings == NULL) { perror("backtrace_symbols"); exit(EXIT_FAILURE); } - for (i = 0; i < pframes; i++) { M1(); MY_FPRINTF(IO_PORT,"%s\n", strings[i]); } - #undef free free(strings); } - } - else /* (format == PSM_LOG_EPM_MAGIC) */ + else if (format == PSM2_LOG_EPM_MAGIC) { static epmTreeNode *root = 0; static pthread_mutex_t plmf_epm_mutex = @@ -2545,9 +2541,33 @@ MY_VFPRINTF(IO_PORT,newFormat,ap); MY_FPUTC('\n',IO_PORT); } + else /* if (format == PSM2_LOG_DUMP_MAGIC) */ + { + MY_VFPRINTF(IO_PORT,newFormat,ap); + MY_FPUTC('\n',IO_PORT); + M1(); + + uint8_t *pu8 = (uint8_t *)dumpAddr; + size_t i,cnt=0; + for (i=0;i < dumpSize;i++) + { + if ((i != 0) && ((i % 8) == 0)) + { + MY_FPRINTF(IO_PORT," (%d)\n",(int)(i-8)); + M1(); + cnt = 0; + } + else if (cnt) + MY_FPUTC(',',IO_PORT); + MY_FPRINTF(IO_PORT,"0x%02x", pu8[i-1]); + cnt++; + } + if (cnt) + MY_FPRINTF(IO_PORT," (%d)\n",(int)(i-8)); + } MY_FCLOSE(IO_PORT); } va_end(ap); } -#endif /* #ifdef PSM_LOG */ +#endif /* #ifdef PSM2_LOG */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl.h new/libpsm2-10.3.17/ptl.h --- old/libpsm2-10.2.260/ptl.h 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl.h 2017-10-20 00:34:17.000000000 +0200 @@ -104,6 +104,11 @@ void *optval, uint64_t *optlen); }; +struct ptl_ctl_rcvthread { + uint32_t(*is_enabled) (const ptl_t *ptl); + void(*transfer_ownership) (ptl_t *from_ptl, ptl_t *to_ptl); +}; + typedef struct ptl_arg { union { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ips_proto_expected.c new/libpsm2-10.3.17/ptl_ips/ips_proto_expected.c --- old/libpsm2-10.2.260/ptl_ips/ips_proto_expected.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ips_proto_expected.c 2017-10-20 00:34:17.000000000 +0200 @@ -706,7 +706,7 @@ ips_scb_buffer(scb) = (void *)&tidrecvc->tid_list; ips_scb_length(scb) = tidrecvc->tsess_tidlist_length; - PSM_LOG_EPM(OPCODE_LONG_CTS,PSM_LOG_EPM_TX, proto->ep->epid, + PSM2_LOG_EPM(OPCODE_LONG_CTS,PSM2_LOG_EPM_TX, proto->ep->epid, flow->ipsaddr->epaddr.epid ,"tidrecvc->getreq->tidgr_sendtoken; %d", tidrecvc->getreq->tidgr_sendtoken); @@ -723,7 +723,7 @@ struct ips_flow *flow = &ipsaddr->flows[proto->msgflowid]; ips_scb_t *scb; - PSM_LOG_EPM(OPCODE_EXPTID_COMPLETION,PSM_LOG_EPM_TX, proto->ep->epid, + PSM2_LOG_EPM(OPCODE_EXPTID_COMPLETION,PSM2_LOG_EPM_TX, proto->ep->epid, flow->ipsaddr->epaddr.epid ,"sdescid._desc_idx: %d", sdescid._desc_idx); scb = tidrecvc->completescb; @@ -765,7 +765,7 @@ struct ips_tid_send_desc *tidsendc; PSM2_LOG_MSG("entering"); - PSM_LOG_EPM(OPCODE_EXPTID_COMPLETION,PSM_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, + PSM2_LOG_EPM(OPCODE_EXPTID_COMPLETION,PSM2_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, rcv_ev->proto->ep->mq->ep->epid,"desc_id._desc_idx: %d",desc_id._desc_idx); if (!ips_proto_is_expected_or_nak(rcv_ev)) @@ -885,7 +885,7 @@ PSM2_LOG_MSG("entering"); desc_id._desc_idx = ips_proto_flowid(p_hdr); - PSM_LOG_EPM(OPCODE_EXPTID,PSM_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, + PSM2_LOG_EPM(OPCODE_EXPTID,PSM2_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, proto->ep->mq->ep->epid,"desc_id._desc_idx: %d", desc_id._desc_idx); desc_id._desc_genc = p_hdr->exp_rdescid_genc; @@ -1644,7 +1644,7 @@ /* * Other packet fields. */ - PSM_LOG_EPM(OPCODE_EXPTID,PSM_LOG_EPM_TX, protoexp->proto->ep->epid, + PSM2_LOG_EPM(OPCODE_EXPTID,PSM2_LOG_EPM_TX, protoexp->proto->ep->epid, flow->ipsaddr->epaddr.epid, "psmi_mpool_get_obj_index(tidsendc->mqreq): %d, tidsendc->rdescid._desc_idx: %d, tidsendc->sdescid._desc_idx: %d", psmi_mpool_get_obj_index(tidsendc->mqreq),tidsendc->rdescid._desc_idx,tidsendc->sdescid._desc_idx); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ips_proto_mq.c new/libpsm2-10.3.17/ptl_ips/ips_proto_mq.c --- old/libpsm2-10.2.260/ptl_ips/ips_proto_mq.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ips_proto_mq.c 2017-10-20 00:34:17.000000000 +0200 @@ -508,7 +508,7 @@ } #endif - PSM_LOG_EPM_COND(len > proto->mq->hfi_thresh_rv && proto->protoexp,OPCODE_LONG_RTS,PSM_LOG_EPM_TX,proto->ep->epid, req->rts_peer->epid, + PSM2_LOG_EPM_COND(len > proto->mq->hfi_thresh_rv && proto->protoexp,OPCODE_LONG_RTS,PSM2_LOG_EPM_TX,proto->ep->epid, req->rts_peer->epid, "ips_scb_hdrdata(scb).u32w0: %d",ips_scb_hdrdata(scb).u32w0); if ((err = ips_mq_send_envelope(proto, flow, scb, PSMI_TRUE))) @@ -993,7 +993,7 @@ args[1].u32w1 = req->recv_msglen; args[1].u32w0 = req->rts_reqidx_peer; - PSM_LOG_EPM(OPCODE_LONG_CTS,PSM_LOG_EPM_TX, proto->ep->epid, + PSM2_LOG_EPM(OPCODE_LONG_CTS,PSM2_LOG_EPM_TX, proto->ep->epid, flow->ipsaddr->epaddr.epid ,"req->rts_reqidx_peer: %d", req->rts_reqidx_peer); @@ -1176,7 +1176,7 @@ ips_tid_session_list *payload = ips_recvhdrq_event_payload(rcv_ev); psmi_assert(paylen == 0 || payload); - PSM_LOG_EPM(OPCODE_LONG_CTS,PSM_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, + PSM2_LOG_EPM(OPCODE_LONG_CTS,PSM2_LOG_EPM_RX,rcv_ev->ipsaddr->epaddr.epid, mq->ep->epid,"p_hdr->data[1].u32w0 %d", p_hdr->data[1].u32w0); proto->epaddr_stats.tids_grant_recv++; @@ -1310,7 +1310,7 @@ req->rts_reqidx_peer = p_hdr->data[1].u32w0; if (req->send_msglen > mq->hfi_thresh_rv) { - PSM_LOG_EPM(OPCODE_LONG_RTS,PSM_LOG_EPM_RX,req->rts_peer->epid,mq->ep->epid, + PSM2_LOG_EPM(OPCODE_LONG_RTS,PSM2_LOG_EPM_RX,req->rts_peer->epid,mq->ep->epid, "req->rts_reqidx_peer: %d",req->rts_reqidx_peer); } if (p_hdr->flags & IPS_SEND_FLAG_BLOCKING) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ptl.c new/libpsm2-10.3.17/ptl_ips/ptl.c --- old/libpsm2-10.2.260/ptl_ips/ptl.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ptl.c 2017-10-20 00:34:17.000000000 +0200 @@ -620,6 +620,14 @@ return ips_ptl_optctl(component_obj, optname, optval, optlen, 1); } + +static +uint32_t +ips_ptl_rcvthread_is_enabled(const ptl_t *ptl) +{ + return (ptl->runtime_flags & PSMI_RUNTIME_RCVTHREAD); +} + psm2_error_t ips_ptl_poll(ptl_t *ptl, int _ignored) { const uint64_t current_count = get_cycles(); @@ -948,3 +956,9 @@ ips_ptl_sizeof, ips_ptl_init, ips_ptl_fini, ips_ptl_setopt, ips_ptl_getopt }; + +struct ptl_ctl_rcvthread +psmi_ptl_ips_rcvthread = { + ips_ptl_rcvthread_is_enabled, + ips_ptl_rcvthread_transfer_ownership, +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ptl_fwd.h new/libpsm2-10.3.17/ptl_ips/ptl_fwd.h --- old/libpsm2-10.2.260/ptl_ips/ptl_fwd.h 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ptl_fwd.h 2017-10-20 00:34:17.000000000 +0200 @@ -62,4 +62,6 @@ /* Symbol in ips ptl */ struct ptl_ctl_init psmi_ptl_ips; + +struct ptl_ctl_rcvthread psmi_ptl_ips_rcvthread; #endif /* _PTL_FWD_IPS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ptl_ips.h new/libpsm2-10.3.17/ptl_ips/ptl_ips.h --- old/libpsm2-10.2.260/ptl_ips/ptl_ips.h 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ptl_ips.h 2017-10-20 00:34:17.000000000 +0200 @@ -190,5 +190,6 @@ */ psm2_error_t ips_ptl_rcvthread_init(ptl_t *ptl, struct ips_recvhdrq *recvq); psm2_error_t ips_ptl_rcvthread_fini(ptl_t *ptl); +void ips_ptl_rcvthread_transfer_ownership(ptl_t *from_ptl, ptl_t *to_ptl); #endif /* _IPS_PTL_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/ptl_ips/ptl_rcvthread.c new/libpsm2-10.3.17/ptl_ips/ptl_rcvthread.c --- old/libpsm2-10.2.260/ptl_ips/ptl_rcvthread.c 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/ptl_ips/ptl_rcvthread.c 2017-10-20 00:34:17.000000000 +0200 @@ -213,6 +213,23 @@ return err; } +void ips_ptl_rcvthread_transfer_ownership(ptl_t *from_ptl, ptl_t *to_ptl) +{ + struct ptl_rcvthread *rcvc; + + from_ptl->runtime_flags &= ~(PSMI_RUNTIME_RCVTHREAD); + to_ptl->runtime_flags |= PSMI_RUNTIME_RCVTHREAD; + + to_ptl->rcvthread = from_ptl->rcvthread; + from_ptl->rcvthread = NULL; + + rcvc = to_ptl->rcvthread; + + rcvc->recvq = &to_ptl->recvq; + rcvc->context = to_ptl->context; + rcvc->ptl = to_ptl; +} + psm2_error_t rcvthread_initsched(struct ptl_rcvthread *rcvc) { union psmi_envvar_val env_to; @@ -322,8 +339,6 @@ { struct ptl_rcvthread *rcvc = (struct ptl_rcvthread *)rcvthreadc; struct ips_recvhdrq *recvq = rcvc->recvq; - psmi_context_t *context = (psmi_context_t *) rcvc->context; - int fd_dev = context->fd; int fd_pipe = rcvc->pipefd[0]; psm2_ep_t ep; struct pollfd pfd[2]; @@ -354,7 +369,7 @@ _HFI_PRDBG("Enabled communication thread on URG packets\n"); while (1) { - pfd[0].fd = fd_dev; + pfd[0].fd = rcvc->context->fd; pfd[0].events = POLLIN; pfd[0].revents = 0; pfd[1].fd = fd_pipe; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libpsm2-10.2.260/rpm_release_extension new/libpsm2-10.3.17/rpm_release_extension --- old/libpsm2-10.2.260/rpm_release_extension 2017-09-06 01:28:41.000000000 +0200 +++ new/libpsm2-10.3.17/rpm_release_extension 2017-10-20 00:34:17.000000000 +0200 @@ -1 +1 @@ -260 +17 ++++++ libpsm2-include-ioctl_h.patch ++++++ --- /var/tmp/diff_new_pack.23nXba/_old 2017-11-23 09:41:16.435389301 +0100 +++ /var/tmp/diff_new_pack.23nXba/_new 2017-11-23 09:41:16.435389301 +0100 @@ -1,7 +1,17 @@ -Index: libpsm2-10.3.2/psmi_wrappers.c -=================================================================== ---- libpsm2-10.3.2.orig/psmi_wrappers.c -+++ libpsm2-10.3.2/psmi_wrappers.c +commit 577cf495e26e35e3965b6c43a38ccd84bb10fa52 +Author: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> +Date: Mon Nov 20 18:07:42 2017 +0100 + + libpsm2 include ioctl_h + + Fix compilation issue by including ioctl.h + + Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> + +diff --git psmi_wrappers.c psmi_wrappers.c +index ea857fc..f159787 100644 +--- psmi_wrappers.c ++++ psmi_wrappers.c @@ -55,6 +55,7 @@ #include "opa_common.h" #include <unistd.h> ++++++ libpsm2-use-exported-variable-for-version-and-release.patch ++++++ --- /var/tmp/diff_new_pack.23nXba/_old 2017-11-23 09:41:16.459388426 +0100 +++ /var/tmp/diff_new_pack.23nXba/_new 2017-11-23 09:41:16.459388426 +0100 @@ -1,26 +1,36 @@ -Index: libpsm2-10.3.1/Makefile -=================================================================== ---- libpsm2-10.3.1.orig/Makefile -+++ libpsm2-10.3.1/Makefile -@@ -138,7 +138,7 @@ endif - export LIBPSM2_COMPAT_CONF_DIR - - # The desired version number comes from the most recent tag starting with "v" --VERSION := $(shell if [ -e .git ] ; then git describe --tags --abbrev=0 --match='v*' | sed -e 's/^v//' -e 's/-/_/'; else echo "version" ; fi) -+VERSION ?= $(shell if [ -e .git ] ; then git describe --tags --abbrev=0 --match='v*' | sed -e 's/^v//' -e 's/-/_/'; else echo "version" ; fi) +commit c812d7da24984926e683e99aa5d3ef8a1d372774 +Author: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> +Date: Mon Nov 20 17:59:13 2017 +0100 + + libpsm2: use exported variable for version and release + + Allow to override VERSION and RELEASE variable through the command line. + + Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> + +diff --git Makefile Makefile +index 8db7c1d..b460785 100644 +--- Makefile ++++ Makefile +@@ -180,10 +180,10 @@ export LIBPSM2_COMPAT_CONF_DIR + ifeq (true, $(shell git rev-parse --is-inside-work-tree 2>/dev/null)) + ISGIT := 1 # Cache the result for later + # Note, we don't define ISGIT if we are not in a git folder +-VERSION := $(shell git describe --tags --abbrev=0 --match='psm-v*' | sed -e 's/^psm-v//' -e 's/-/_/') ++VERSION ?= $(shell git describe --tags --abbrev=0 --match='psm-v*' | sed -e 's/^psm-v//' -e 's/-/_/') + else + ISGIT := 0 +-VERSION := version ++VERSION ?= version + endif # If we have a file called 'rpm_release_extension' (as on github), - # we take the release extension number from this file -@@ -162,11 +162,7 @@ endif - # The desired release number comes the git describe following the version which +@@ -213,7 +213,7 @@ endif # is the number of commits since the version tag was planted suffixed by the g<commitid> ifndef RELEASE + RELTAG := "psm-v$(VERSION)" -RELEASE := $(shell if [ -f rpm_release_extension ]; then cat rpm_release_extension;\ -- elif [ -e .git ] ; then git describe --tags --long --match='v*' | \ -- sed -e 's/v[0-9.]*-\(.*\)/\1/' -e 's/-/_/' | \ -- sed -e 's/_g.*$$//'; \ -- else echo "release" ; fi) -+RELEASE ?= $(shell if [ -e .git ] ; then git describe --tags --long --match='v*' | sed -e 's/v[0-9.]*-\(.*\)/\1/' -e 's/-/_/' | sed -e 's/_g.*$$//'; else echo "release" ; fi) ++RELEASE ?= $(shell if [ -f rpm_release_extension ]; then cat rpm_release_extension;\ + elif [ $(ISGIT) = 1 ] ; then git rev-list $(RELTAG)..HEAD -- . | wc -l; \ + else echo "release" ; fi) endif - - DIST_SHA := ${shell if [ -e .git ] ; then git log -n1 --pretty=format:%H ; \ ++++++ libpsm2-use_RPM_OPT_FLAGS.patch ++++++ --- /var/tmp/diff_new_pack.23nXba/_old 2017-11-23 09:41:16.467388134 +0100 +++ /var/tmp/diff_new_pack.23nXba/_new 2017-11-23 09:41:16.467388134 +0100 @@ -1,25 +1,30 @@ ---- - buildflags.mak | 2 +- - compat/buildflags.mak | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) +commit 1ceab365d83ad618948fa06ed4b56ec5b0d2c90a +Author: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> +Date: Mon Nov 20 17:59:37 2017 +0100 -Index: buildflags.mak -=================================================================== ---- buildflags.mak.orig 2016-12-06 16:11:52.060197738 +0100 -+++ buildflags.mak 2016-12-06 16:12:15.004074162 +0100 + libpsm2: use_RPM_OPT_FLAGS + + Add RPM_OPT_FLAGS to CFLAGS + + Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemar...@suse.com> + +diff --git buildflags.mak buildflags.mak +index 67593f5..4c7d43e 100644 +--- buildflags.mak ++++ buildflags.mak @@ -80,7 +80,7 @@ else anerr := $(error Unknown Fortran compiler arch: ${FCARCH}) endif # gfortran --BASECFLAGS += $(BASE_FLAGS) -+BASECFLAGS += $(BASE_FLAGS) $(RPM_OPT_FLAGS) +-BASECFLAGS += $(BASE_FLAGS) -pthread ++BASECFLAGS += $(BASE_FLAGS) -pthread $(RPM_OPT_FLAGS) LDFLAGS += $(BASE_FLAGS) ASFLAGS += $(BASE_FLAGS) -Index: compat/buildflags.mak -=================================================================== ---- compat/buildflags.mak.orig 2016-12-06 16:11:45.612232462 +0100 -+++ compat/buildflags.mak 2016-12-06 16:11:52.060197738 +0100 +diff --git compat/buildflags.mak compat/buildflags.mak +index c677989..2674b87 100644 +--- compat/buildflags.mak ++++ compat/buildflags.mak @@ -71,7 +71,7 @@ else endif # gcc4 endif # gcc