summaryrefslogtreecommitdiff
path: root/training
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-01-27 10:39:36 +0100
committerPatrick Simianer <p@simianer.de>2014-01-27 10:39:36 +0100
commite12ec2d3599bafd5042841c87b9c5323d587f176 (patch)
treea89bcb660f668aec30196478615478a5c94fa2ff /training
parenta1f3f7fb262b6efefb106a7bddaf81d2a3a6df93 (diff)
parentf7e051a05d65ef25c2ada0b84cd82bfb375ef265 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'training')
-rw-r--r--training/liblbfgs/Makefile.am7
-rwxr-xr-xtraining/utils/parallelize.pl16
2 files changed, 16 insertions, 7 deletions
diff --git a/training/liblbfgs/Makefile.am b/training/liblbfgs/Makefile.am
index 272d6f56..aa3af377 100644
--- a/training/liblbfgs/Makefile.am
+++ b/training/liblbfgs/Makefile.am
@@ -1,10 +1,9 @@
-TESTS = ll_test
-noinst_PROGRAMS = ll_test
+noinst_LIBRARIES = liblbfgs.a
+noinst_PROGRAMS = ll_test
ll_test_SOURCES = ll_test.cc
ll_test_LDADD = liblbfgs.a -lz
-
-noinst_LIBRARIES = liblbfgs.a
+TESTS = ll_test
liblbfgs_a_SOURCES = \
lbfgs.c \
diff --git a/training/utils/parallelize.pl b/training/utils/parallelize.pl
index 4197e0e5..c9ab88ce 100755
--- a/training/utils/parallelize.pl
+++ b/training/utils/parallelize.pl
@@ -45,11 +45,22 @@ my $numnodes = 8;
my $user = $ENV{"USER"};
my $pmem = "9g";
my $basep=50300;
-my $randp=300;
my $tryp=50;
my $no_which;
my $no_cd;
+if (-r '/dev/urandom') {
+ open(RR,'</dev/urandom') or die "Failed to read /dev/urandom: $!";
+ my $buffer;
+ die "Failed to read 4 bytes of entropy" unless read(RR,$buffer,4) == 4;
+ close RR;
+ my ($val) = unpack 'L1', $buffer;
+ srand($val);
+} else {
+ srand();
+}
+my $randp=4000;
+
my $DEBUG=$ENV{DEBUG};
print STDERR "DEBUG=$DEBUG output enabled.\n" if $DEBUG;
my $verbose = 1;
@@ -206,8 +217,7 @@ chomp $host;
# find open port
-srand;
-my $port = 50300+int(rand($randp));
+my $port = $basep+int(rand($randp));
my $endp=$port+$tryp;
sub listening_port_lines {
my $quiet=$verbose?'':'2>/dev/null';