New Upstream Snapshot - shapeit4

Ready changes

Summary

Merged new upstream version: 4.2.2+git20211217.2.d1f037a+ds (was: 4.2.2+git20211217.1.d1f037a).

Resulting package

Built on 2023-01-19T13:36 (took 11m41s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots shapeit4-dbgsymapt install -t fresh-snapshots shapeit4-exampleapt install -t fresh-snapshots shapeit4

Diff

diff --git a/debian/changelog b/debian/changelog
index 8d99428..363f3a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+shapeit4 (4.2.2+git20211217.2.d1f037a+ds-1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+  * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Thu, 19 Jan 2023 13:28:19 -0000
+
 shapeit4 (4.2.2+dfsg-1) unstable; urgency=medium
 
   * New upstream version
diff --git a/debian/patches/use_shared_libs.patch b/debian/patches/use_shared_libs.patch
index 46a0eb2..73567dc 100644
--- a/debian/patches/use_shared_libs.patch
+++ b/debian/patches/use_shared_libs.patch
@@ -2,9 +2,11 @@ Author: Dylan Aïssi
 Description: Use shared libs for Debian packaging.
 Last-Update: 2020-03-05
 
---- a/makefile
-+++ b/makefile
-@@ -3,12 +3,12 @@
+Index: shapeit4.git/makefile
+===================================================================
+--- shapeit4.git.orig/makefile
++++ shapeit4.git/makefile
+@@ -3,12 +3,12 @@ CXX=g++ -std=c++11
  
  #HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
  HTSLIB_INC=$(HOME)/Tools/htslib-1.11
@@ -20,7 +22,7 @@ Last-Update: 2020-03-05
  
  #HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
  #HTSLIB_INC=/software/UHTS/Analysis/samtools/1.4/include
-@@ -25,12 +25,11 @@
+@@ -25,12 +25,11 @@ BOOST_LIB_PO=/usr/lib/x86_64-linux-gnu/l
  #CXXFLAG=-O3 -march=native
  
  #Good performance and portable on most CPUs
diff --git a/tools/bingraphsample/makefile b/tools/bingraphsample/makefile
index 09fff00..acd8c96 100644
--- a/tools/bingraphsample/makefile
+++ b/tools/bingraphsample/makefile
@@ -29,7 +29,7 @@ CXXFLAG=-g
 LDFLAG=-O3
 
 #DYNAMIC LIBRARIES
-DYN_LIBS=-lz -lbz2 -lm -lpthread -llzma
+DYN_LIBS=-lz -lbz2 -lm -lpthread -llzma -lcurl -lcrypto
 
 #SHAPEIT SOURCES & BINARY
 BFILE=bin/bingraphsample
diff --git a/tools/bingraphsample/src/containers/genotype_set.cpp b/tools/bingraphsample/src/containers/genotype_set.cpp
index a3f0a32..01efc04 100644
--- a/tools/bingraphsample/src/containers/genotype_set.cpp
+++ b/tools/bingraphsample/src/containers/genotype_set.cpp
@@ -21,6 +21,26 @@
 ////////////////////////////////////////////////////////////////////////////////
 #include <containers/genotype_set.h>
 
+void * collapse_callback(void * ptr) {
+	genotype_set * S = static_cast< genotype_set * >( ptr );
+	int id_worker, id_job;
+	pthread_mutex_lock(&S->mutex_workers);
+	id_worker = S->i_workers ++;
+	pthread_mutex_unlock(&S->mutex_workers);
+	for(;;) {
+		pthread_mutex_lock(&S->mutex_workers);
+		id_job = S->i_jobs ++;
+		if (id_job < S->vecG.size()) vrb.bullet("Sample [" + stb.str(id_job+1) + "/" + stb.str(S->vecG.size()) + "]");
+		pthread_mutex_unlock(&S->mutex_workers);
+		if (id_job < S->vecG.size()) {
+			for (int n = 0 ; n < S->Nrep ; n++) {
+				S->vecG[id_job]->sample();
+				S->vecG[id_job]->storeCollapse();
+			}
+		} else pthread_exit(NULL);
+	}
+}
+
 genotype_set::genotype_set() {
 	n_site = 0;
 	n_ind = 0;
@@ -45,16 +65,22 @@ void genotype_set::solve() {
 	vrb.bullet("HAP solving (" + stb.str(tac.rel_time()*1.0/1000, 2) + "s)");
 }
 
+
 void genotype_set::sample() {
 	tac.clock();
 	for (int i = 0 ; i < vecG.size() ; i ++) vecG[i]->sample();
 	vrb.bullet("HAP sampling (" + stb.str(tac.rel_time()*1.0/1000, 2) + "s)");
 }
 
-void genotype_set::collapse(int N) {
+void genotype_set::collapse(int N, int T) {
 	tac.clock();
-	for (int i = 0 ; i < vecG.size() ; i ++) {
-		for (int n = 0 ; n < N ; n++) {
+	Nrep = N;
+	i_workers = 0; i_jobs = 0;
+	if (T > 1) {
+		for (int t = 0 ; t < T ; t++) pthread_create( &id_workers[t] , NULL, collapse_callback, static_cast<void *>(this));
+		for (int t = 0 ; t < T ; t++) pthread_join( id_workers[t] , NULL);
+	} else for (int i = 0 ; i < vecG.size() ; i ++) {
+		for (int n = 0 ; n < Nrep ; n++) {
 			vecG[i]->sample();
 			vecG[i]->storeCollapse();
 		}
diff --git a/tools/bingraphsample/src/containers/genotype_set.h b/tools/bingraphsample/src/containers/genotype_set.h
index ad16ad4..f9029cd 100644
--- a/tools/bingraphsample/src/containers/genotype_set.h
+++ b/tools/bingraphsample/src/containers/genotype_set.h
@@ -31,8 +31,16 @@ class genotype_set {
 public:
 	//DATA
 	int n_site, n_ind;					//Number of variants, number of individuals
+	int Nrep;
 	vector < genotype * > vecG;			//Vector of genotype graphs
 
+	//MULTI-THREADING
+	int i_workers, i_jobs;
+	vector < pthread_t > id_workers;
+	pthread_mutex_t mutex_workers;
+
+
+
 	//CONSTRUCTOR/DESTRUCTOR
 	genotype_set();
 	~genotype_set();
@@ -40,7 +48,7 @@ public:
 	void init();
 	void solve();
 	void sample();
-	void collapse(int);
+	void collapse(int, int);
 };
 
 #endif
diff --git a/tools/bingraphsample/src/sampler/sampler_finalise.cpp b/tools/bingraphsample/src/sampler/sampler_finalise.cpp
index 2d12c84..8354a18 100644
--- a/tools/bingraphsample/src/sampler/sampler_finalise.cpp
+++ b/tools/bingraphsample/src/sampler/sampler_finalise.cpp
@@ -42,13 +42,17 @@ void sampler::write_files_and_finalise() {
 		mode = MODE_SOL;
 	}
 	if (options.count("collapse")) {
-		G.collapse(options["collapse"].as < int > ());
+		G.collapse(options["collapse"].as < int > (), options["thread"].as < int > ());
 		mode = MODE_COL;
 	}
 
+
+
 	//step1: writing best guess haplotypes in VCF/BCF file
 	haplotype_writer(G, V).writeHaplotypes(options["output"].as < string > (), mode, options["seed"].as < int > ());
 
+	if (options["thread"].as < int > () > 1) pthread_mutex_destroy(&G.mutex_workers);
+
 	//step2: Measure overall running time
 	vrb.bullet("Total running time = " + stb.str(tac.abs_time()) + " seconds");
 }
diff --git a/tools/bingraphsample/src/sampler/sampler_initialise.cpp b/tools/bingraphsample/src/sampler/sampler_initialise.cpp
index 4ef9229..f365636 100644
--- a/tools/bingraphsample/src/sampler/sampler_initialise.cpp
+++ b/tools/bingraphsample/src/sampler/sampler_initialise.cpp
@@ -29,6 +29,14 @@ void sampler::read_files_and_initialise() {
 	//step0: Initialize seed and multi-threading
 	rng.setSeed(options["seed"].as < int > ());
 
+	if (options["thread"].as < int > () > 1) {
+		G.i_workers = 0;
+		G.i_jobs = 0;
+		G.id_workers = vector < pthread_t > (options["thread"].as < int > ());
+		pthread_mutex_init(&G.mutex_workers, NULL);
+	}
+
+
 	//step2: Read input files
 	graph_reader readerG(G, V);
 	readerG.readGraphs(options["input"].as < string > ());
diff --git a/tools/bingraphsample/src/sampler/sampler_parameters.cpp b/tools/bingraphsample/src/sampler/sampler_parameters.cpp
index 8257e8b..db6a98b 100644
--- a/tools/bingraphsample/src/sampler/sampler_parameters.cpp
+++ b/tools/bingraphsample/src/sampler/sampler_parameters.cpp
@@ -26,7 +26,8 @@ void sampler::declare_options() {
 	bpo::options_description opt_base ("Basic options");
 	opt_base.add_options()
 			("help", "Produce help message")
-			("seed", bpo::value<int>()->default_value(15052011), "Seed of the random number generator");
+			("seed", bpo::value<int>()->default_value(15052011), "Seed of the random number generator")
+			("thread,T", bpo::value<int>()->default_value(1), "Number of thread used");
 
 	bpo::options_description opt_input ("Input files");
 	opt_input.add_options()
@@ -89,6 +90,7 @@ void sampler::verbose_files() {
 void sampler::verbose_options() {
 	vrb.title("Parameters:");
 	vrb.bullet("Seed    : " + stb.str(options["seed"].as < int > ()));
+	vrb.bullet("Threads : " + stb.str(options["thread"].as < int > ()) + " threads");
 	if (options.count("sample")) vrb.bullet("MODE    : Sampling using seed [" + stb.str(options["seed"].as < int > ()) + "]");
 	if (options.count("solve")) vrb.bullet("MODE    : Solving");
 	if (options.count("collapse")) vrb.bullet("MODE    : Collpase haplotypes from [" + stb.str(options["collapse"].as < int > ()) + "] samplings");
diff --git a/tools/bingraphsample/test.vcf.gz b/tools/bingraphsample/test.vcf.gz
deleted file mode 100644
index 85786a2..0000000
Binary files a/tools/bingraphsample/test.vcf.gz and /dev/null differ

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/debug/.build-id/69/594826f28ddbdab9844dbbff5a97fbabf79b71.debug

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/debug/.build-id/d5/3fc06169c6f880ddbe1df7bb50095d0dbb08ac.debug

Control files of package shapeit4: lines which differ (wdiff format)

  • Depends: libboost-iostreams1.74.0 (>= 1.74.0+ds1), 1.74.0), libboost-program-options1.74.0 (>= 1.74.0+ds1), 1.74.0), libc6 (>= 2.34), libgcc-s1 (>= 3.0), libhts3 (>= 1.10), libstdc++6 (>= 11)

Control files of package shapeit4-dbgsym: lines which differ (wdiff format)

  • Build-Ids: d53fc06169c6f880ddbe1df7bb50095d0dbb08ac 69594826f28ddbdab9844dbbff5a97fbabf79b71

No differences were encountered between the control files of package shapeit4-example

More details

Full run details