@@ -686,6 +686,12 @@ static void printVersion(void)
686
686
DISPLAYOUT ("lz4 version %s\n" , FIO_lz4Version ());
687
687
DISPLAYOUT ("lzma version %s\n" , FIO_lzmaVersion ());
688
688
689
+ #ifdef ZSTD_MULTITHREAD
690
+ DISPLAYOUT ("supports Multithreading \n" );
691
+ #else
692
+ DISPLAYOUT ("single-thread operations only \n" );
693
+ #endif
694
+
689
695
/* posix support */
690
696
#ifdef _POSIX_C_SOURCE
691
697
DISPLAYOUT ("_POSIX_C_SOURCE defined: %ldL\n" , (long ) _POSIX_C_SOURCE );
@@ -779,6 +785,11 @@ static int init_cLevel(void) {
779
785
static unsigned init_nbWorkers (void ) {
780
786
#ifdef ZSTD_MULTITHREAD
781
787
const char * const env = getenv (ENV_NBWORKERS );
788
+ if (env == NULL ) {
789
+ DISPLAYLEVEL (1 , "Failed Reading environment variable %s \n" , ENV_NBWORKERS );
790
+ } else {
791
+ DISPLAYLEVEL (1 , "Reading environment variable %s : %s \n" , ENV_NBWORKERS , env );
792
+ }
782
793
if (env != NULL ) {
783
794
const char * ptr = env ;
784
795
if ((* ptr >='0' ) && (* ptr <='9' )) {
@@ -793,6 +804,7 @@ static unsigned init_nbWorkers(void) {
793
804
DISPLAYLEVEL (2 , "Ignore environment variable setting %s=%s: not a valid unsigned value \n" , ENV_NBWORKERS , env );
794
805
}
795
806
807
+ DISPLAYLEVEL (1 , "returning default nbThreads = %i \n" , ZSTDCLI_NBTHREADS_DEFAULT );
796
808
return ZSTDCLI_NBTHREADS_DEFAULT ;
797
809
#else
798
810
return 1 ;
@@ -1336,7 +1348,7 @@ int main(int argCount, const char* argv[])
1336
1348
1337
1349
#ifdef ZSTD_MULTITHREAD
1338
1350
if ((nbWorkers == NBWORKERS_AUTOCPU ) && (!singleThread )) {
1339
- /* automatically set # workers based on # of reported cpus */
1351
+ /* automatically set # workers based on # of reported cpu cores */
1340
1352
if (defaultLogicalCores ) {
1341
1353
nbWorkers = (unsigned )UTIL_countLogicalCores ();
1342
1354
DISPLAYLEVEL (3 , "Note: %d logical core(s) detected \n" , nbWorkers );
@@ -1345,8 +1357,7 @@ int main(int argCount, const char* argv[])
1345
1357
DISPLAYLEVEL (3 , "Note: %d physical core(s) detected \n" , nbWorkers );
1346
1358
}
1347
1359
}
1348
- if (operation != zom_bench )
1349
- DISPLAYLEVEL (4 , "Compressing with %u worker threads \n" , nbWorkers );
1360
+ DISPLAYLEVEL (1 , "Compressing with %u worker threads \n" , nbWorkers );
1350
1361
#else
1351
1362
(void )singleThread ; (void )nbWorkers ; (void )defaultLogicalCores ;
1352
1363
#endif
0 commit comments