[med-svn] [Git][med-team/libcolt-free-java][master] Replaced the dependency on the old oswego concurrent library with the standard...

Emmanuel Bourg gitlab at salsa.debian.org
Wed Sep 16 12:43:20 BST 2020



Emmanuel Bourg pushed to branch master at Debian Med / libcolt-free-java


Commits:
12a00f67 by Emmanuel Bourg at 2020-09-16T13:39:51+02:00
Replaced the dependency on the old oswego concurrent library with the standard Java 7 Fork/Join framework

- - - - -


6 changed files:

- debian/changelog
- debian/control
- − debian/manifest
- + debian/patches/fork-join.patch
- debian/patches/series
- − debian/patches/use_debian_packaged_concurrent_jar.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libcolt-free-java (1.2.0+dfsg-8~exp1) experimental; urgency=medium
+
+  * Team upload.
+  * Replaced the dependency on the old oswego concurrent library
+    with the standard Java 7 Fork/Join framework
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Wed, 16 Sep 2020 13:37:35 +0200
+
 libcolt-free-java (1.2.0+dfsg-7) unstable; urgency=medium
 
   [ Matthias Klose ]


=====================================
debian/control
=====================================
@@ -6,8 +6,7 @@ Priority: optional
 Build-Depends: debhelper (>= 11~),
                javahelper,
                default-jdk,
-               ant,
-               libconcurrent-java
+               ant
 Standards-Version: 4.3.0
 Vcs-Browser: https://salsa.debian.org/med-team/libcolt-free-java
 Vcs-Git: https://salsa.debian.org/med-team/libcolt-free-java.git


=====================================
debian/manifest deleted
=====================================
@@ -1,2 +0,0 @@
-/usr/share/java/colt.jar:
- Class-Path: /usr/share/java/concurrent.jar


=====================================
debian/patches/fork-join.patch
=====================================
@@ -0,0 +1,165 @@
+Description: Replaces the old oswego concurrent library with the standard Java 7 Fork/Join framework
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/src/cern/colt/matrix/linalg/Smp.java
++++ b/src/cern/colt/matrix/linalg/Smp.java
+@@ -9,12 +9,11 @@
+ package cern.colt.matrix.linalg;
+ 
+ import cern.colt.matrix.DoubleMatrix2D;
+-import EDU.oswego.cs.dl.util.concurrent.FJTask;
+-import EDU.oswego.cs.dl.util.concurrent.FJTaskRunnerGroup;
++import java.util.concurrent.*;
+ /*
+ */
+ class Smp {
+-	protected FJTaskRunnerGroup taskGroup; // a very efficient and light weight thread pool
++	protected ForkJoinPool taskGroup; // a very efficient and light weight thread pool
+ 
+ 	protected int maxThreads;	
+ /**
+@@ -24,7 +23,7 @@
+ 	maxThreads = Math.max(1,maxThreads);
+ 	this.maxThreads = maxThreads;
+ 	if (maxThreads>1) {
+-		this.taskGroup = new FJTaskRunnerGroup(maxThreads);
++		this.taskGroup = new ForkJoinPool(maxThreads);
+ 	}
+ 	else { // avoid parallel overhead
+ 		this.taskGroup = null;
+@@ -34,31 +33,29 @@
+  * Clean up deamon threads, if necessary.
+  */
+ public void finalize() {
+-	if (this.taskGroup!=null) this.taskGroup.interruptAll();
++	if (this.taskGroup!=null) this.taskGroup.shutdownNow();
+ }
+ protected void run(final DoubleMatrix2D[] blocksA, final DoubleMatrix2D[] blocksB, final double[] results, final Matrix2DMatrix2DFunction function) {
+-	final FJTask[] subTasks = new FJTask[blocksA.length];
++	final ForkJoinTask[] subTasks = new ForkJoinTask[blocksA.length];
+ 	for (int i=0; i<blocksA.length; i++) {
+ 		final int k = i;
+-		subTasks[i] = new FJTask() { 
++		subTasks[i] = ForkJoinTask.adapt(new Runnable() {
+ 			public void run() {
+ 				double result = function.apply(blocksA[k],blocksB != null ? blocksB[k] : null);
+ 				if (results!=null) results[k] = result; 
+ 				//System.out.print("."); 
+ 			}
+-		};
++		});
+ 	}
+ 
+ 	// run tasks and wait for completion
+-	try { 
+ 		this.taskGroup.invoke(
+-			new FJTask() {
++			ForkJoinTask.adapt(new Runnable() {
+ 				public void run() {	
+-					coInvoke(subTasks);	
++					ForkJoinTask.invokeAll(subTasks);
+ 				}
+-			}
++			})
+ 		);
+-	} catch (InterruptedException exc) {}
+ }
+ protected DoubleMatrix2D[] splitBlockedNN(DoubleMatrix2D A, int threshold, long flops) {
+ 	/*
+@@ -190,6 +187,6 @@
+  * Prints various snapshot statistics to System.out; Simply delegates to {@link EDU.oswego.cs.dl.util.concurrent.FJTaskRunnerGroup#stats}.
+  */
+ public void stats() {
+-	if (this.taskGroup!=null) this.taskGroup.stats();
++	if (this.taskGroup!=null) System.out.println(this.taskGroup.toString());
+ }
+ }
+--- a/src/cern/colt/matrix/linalg/SmpBlas.java
++++ b/src/cern/colt/matrix/linalg/SmpBlas.java
+@@ -10,7 +10,7 @@
+ 
+ import cern.colt.matrix.DoubleMatrix1D;
+ import cern.colt.matrix.DoubleMatrix2D;
+-import EDU.oswego.cs.dl.util.concurrent.FJTask;
++import java.util.concurrent.*;
+ /**
+ Parallel implementation of the Basic Linear Algebra System for symmetric multi processing boxes.
+ Currently only a few algorithms are parallelised; the others are fully functional, but run in sequential mode.
+@@ -198,7 +198,7 @@
+ 	
+ 	// set up concurrent tasks
+ 	int span = width/noOfTasks;
+-	final FJTask[] subTasks = new FJTask[noOfTasks];
++	final ForkJoinTask[] subTasks = new ForkJoinTask[noOfTasks];
+ 	for (int i=0; i<noOfTasks; i++) {
+ 		final int offset = i*span;
+ 		if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
+@@ -217,24 +217,22 @@
+ 			CC = C.viewPart(offset,0,span,p);
+ 		}
+ 				
+-		subTasks[i] = new FJTask() { 
++		subTasks[i] = ForkJoinTask.adapt(new Runnable() { 
+ 			public void run() { 
+ 				seqBlas.dgemm(transposeA,transposeB,alpha,AA,BB,beta,CC); 
+ 				//System.out.println("Hello "+offset); 
+ 			}
+-		};
++		});
+ 	}
+ 	
+ 	// run tasks and wait for completion
+-	try { 
+ 		this.smp.taskGroup.invoke(
+-			new FJTask() {
++			ForkJoinTask.adapt(new Runnable() {
+ 				public void run() {	
+-					coInvoke(subTasks);	
++					ForkJoinTask.invokeAll(subTasks);
+ 				}
+ 			}
+-		);
+-	} catch (InterruptedException exc) {}
++		));
+ }
+ public void dgemv(final boolean transposeA, final double alpha, DoubleMatrix2D A, final DoubleMatrix1D x, final double beta, DoubleMatrix1D y) {
+ 	/*
+@@ -271,7 +269,7 @@
+ 	
+ 	// set up concurrent tasks
+ 	int span = width/noOfTasks;
+-	final FJTask[] subTasks = new FJTask[noOfTasks];
++	final ForkJoinTask[] subTasks = new ForkJoinTask[noOfTasks];
+ 	for (int i=0; i<noOfTasks; i++) {
+ 		final int offset = i*span;
+ 		if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
+@@ -280,24 +278,22 @@
+ 		final DoubleMatrix2D AA = A.viewPart(offset,0,span,n);
+ 		final DoubleMatrix1D yy = y.viewPart(offset,span);
+ 				
+-		subTasks[i] = new FJTask() { 
++		subTasks[i] = ForkJoinTask.adapt(new Runnable() { 
+ 			public void run() { 
+ 				seqBlas.dgemv(transposeA,alpha,AA,x,beta,yy); 
+ 				//System.out.println("Hello "+offset); 
+ 			}
+-		};
++		});
+ 	}
+ 	
+ 	// run tasks and wait for completion
+-	try { 
+ 		this.smp.taskGroup.invoke(
+-			new FJTask() {
++			ForkJoinTask.adapt(new Runnable() {
+ 				public void run() {	
+-					coInvoke(subTasks);	
++					ForkJoinTask.invokeAll(subTasks);
+ 				}
+ 			}
+-		);
+-	} catch (InterruptedException exc) {}
++		));
+ }
+ public void dger(double alpha, DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix2D A) {
+ 	seqBlas.dger(alpha,x,y,A);


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,3 @@
-use_debian_packaged_concurrent_jar.patch
 freehep-aida.patch
 fix_invalid_encoding.patch
+fork-join.patch


=====================================
debian/patches/use_debian_packaged_concurrent_jar.patch deleted
=====================================
@@ -1,14 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Description: Use Debian packaged version if concurrent
---- a/build.xml
-+++ b/build.xml
-@@ -62,6 +62,9 @@ See the target "usage" further below for
- 		<include name="*.jar"/>
- 		<exclude name="${jar.filename}"/>
- 	</fileset>
-+	<fileset dir="/usr/share/java">
-+		<include name="concurrent.jar"/>
-+        </fileset>
- 	<!-- <pathelement location="${build.home}/classes"/> -->
- </path>
- 



View it on GitLab: https://salsa.debian.org/med-team/libcolt-free-java/-/commit/12a00f67053e48699b374d9aacdb9e56b2f7fa85

-- 
View it on GitLab: https://salsa.debian.org/med-team/libcolt-free-java/-/commit/12a00f67053e48699b374d9aacdb9e56b2f7fa85
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200916/6088e3ec/attachment-0001.html>


More information about the debian-med-commit mailing list