diff --git a/lib/zstd.h b/lib/zstd.h index 4ce2f7742..9fe542edc 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -111,7 +111,7 @@ extern "C" { /*------ Version ------*/ #define ZSTD_VERSION_MAJOR 1 #define ZSTD_VERSION_MINOR 5 -#define ZSTD_VERSION_RELEASE 7 +#define ZSTD_VERSION_RELEASE 8 #define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE) /*! ZSTD_versionNumber() : diff --git a/programs/zstdcli.c b/programs/zstdcli.c index 637567b95..04e9218cf 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -686,6 +686,12 @@ static void printVersion(void) DISPLAYOUT("lz4 version %s\n", FIO_lz4Version()); DISPLAYOUT("lzma version %s\n", FIO_lzmaVersion()); + #ifdef ZSTD_MULTITHREAD + DISPLAYOUT("supports Multithreading \n"); + #else + DISPLAYOUT("single-thread operations only \n"); + #endif + /* posix support */ #ifdef _POSIX_C_SOURCE DISPLAYOUT("_POSIX_C_SOURCE defined: %ldL\n", (long) _POSIX_C_SOURCE); @@ -1336,7 +1342,7 @@ int main(int argCount, const char* argv[]) #ifdef ZSTD_MULTITHREAD if ((nbWorkers==NBWORKERS_AUTOCPU) && (!singleThread)) { - /* automatically set # workers based on # of reported cpus */ + /* automatically set # workers based on # of reported cpu cores */ if (defaultLogicalCores) { nbWorkers = (unsigned)UTIL_countLogicalCores(); DISPLAYLEVEL(3, "Note: %d logical core(s) detected \n", nbWorkers); @@ -1345,7 +1351,7 @@ int main(int argCount, const char* argv[]) DISPLAYLEVEL(3, "Note: %d physical core(s) detected \n", nbWorkers); } } - if (operation != zom_bench) + if (operation == zom_compress) DISPLAYLEVEL(4, "Compressing with %u worker threads \n", nbWorkers); #else (void)singleThread; (void)nbWorkers; (void)defaultLogicalCores; diff --git a/tests/playTests.sh b/tests/playTests.sh index 366f9c741..3d6bcdb0b 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e # exit immediately on error -# set -x # print commands before execution (debug) +set -x # print commands before execution (debug) unset ZSTD_CLEVEL unset ZSTD_NBTHREADS @@ -16,13 +16,7 @@ datagen() { "$DATAGEN_BIN" "$@" } -zstd() { - if [ -z "$EXE_PREFIX" ]; then - "$ZSTD_BIN" "$@" - else - "$EXE_PREFIX" "$ZSTD_BIN" "$@" - fi -} +alias zstd="$EXE_PREFIX $ZSTD_BIN" sudoZstd() { if [ -z "$EXE_PREFIX" ]; then @@ -1563,18 +1557,16 @@ then println "\n===> zstdmt environment variable tests " echo "multifoo" >> mt_tmp ZSTD_NBTHREADS=-3 zstd -f mt_tmp # negative value, warn and revert to default setting - ZSTD_NBTHREADS='' zstd -f mt_tmp # empty env var, warn and revert to default setting - ZSTD_NBTHREADS=- zstd -f mt_tmp # malformed env var, warn and revert to default setting - ZSTD_NBTHREADS=a zstd -f mt_tmp # malformed env var, warn and revert to default setting - ZSTD_NBTHREADS=+a zstd -f mt_tmp # malformed env var, warn and revert to default setting + ZSTD_NBTHREADS='' zstd -f mt_tmp # empty env var, warn and revert to default setting + ZSTD_NBTHREADS=- zstd -f mt_tmp # malformed env var, warn and revert to default setting + ZSTD_NBTHREADS=a zstd -f mt_tmp # malformed env var, warn and revert to default setting + ZSTD_NBTHREADS=+a zstd -f mt_tmp # malformed env var, warn and revert to default setting ZSTD_NBTHREADS=3a7 zstd -f mt_tmp # malformed env var, warn and revert to default setting ZSTD_NBTHREADS=50000000000 zstd -f mt_tmp # numeric value too large, warn and revert to default setting= ZSTD_NBTHREADS=2 zstd -f mt_tmp # correct usage ZSTD_NBTHREADS=1 zstd -f mt_tmp # correct usage: single worker - ZSTD_NBTHREADS=4 zstd -f mt_tmp -vv 2>&1 | grep "4 worker threads" # check message - zstd -tq mt_tmp.zst - ZSTD_NBTHREADS=0 zstd -f mt_tmp -vv 2>&1 | grep "core(s) detected" # check core count autodetection is triggered - zstd -tq mt_tmp.zst + ZSTD_NBTHREADS=4 zstd -f mt_tmp -vv 2>&1 | $GREP "4 worker threads" # check message + ZSTD_NBTHREADS=0 zstd -f mt_tmp -vv 2>&1 | $GREP "core(s) detected" # check core count autodetection is triggered # temporary envvar changes in the above tests would actually persist in macos /bin/sh unset ZSTD_NBTHREADS rm -f mt_tmp*