parallel: code cleanup.

This commit is contained in:
Ole Tange 2016-08-23 00:08:10 +02:00
parent ec9e90e529
commit 9689682674
9 changed files with 106 additions and 49 deletions

12
NEWS
View file

@ -1,5 +1,17 @@
20160822 20160822
* --tmuxpane opens jobs in panes in tmux. Useful if you want to
monitor progress of less than 100 simultaneous jobs.
* --linebuffer now treats \r as line ending, too.
* Perl changes forces use of floats to be given with leading zero, so
0.1 and not .1
* --xapply renamed to --link.
* Support for pdksh will fade until someone packages it for Ubuntu 16.
* GNU Parallel was cited in: Exome sequencing of geographically * GNU Parallel was cited in: Exome sequencing of geographically
diverse barley landraces and wild relatives gives insights into diverse barley landraces and wild relatives gives insights into
environmental adaptation environmental adaptation

View file

@ -4,7 +4,7 @@
Check that documentation is updated (compare to web): Check that documentation is updated (compare to web):
Fixet for 20160222 Fixet for 20160922
git diff last-release-commit git diff last-release-commit
Unmodified beta since last version => production Unmodified beta since last version => production
Unmodified alpha since last version => beta Unmodified alpha since last version => beta
@ -221,21 +221,19 @@ cc:Tim Cuthbertson <tim3d.junk@gmail.com>,
Subject: GNU Parallel 20160822 ('Og Nomekop') released <<[stable]>> Subject: GNU Parallel 20160822 ('Og Nomekop') released <<[stable]>>
GNU Parallel 20160822 ('Og Nomekop') <<[stable]>> has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ GNU Parallel 20160822 ('Og Nomekop') <<[stable]>> has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/
<<No new functionality was introduced so this is a good candidate for a stable release.>> <<No new functionality was introduced so this is a good candidate for a stable release.>>
Haiku of the month: Haiku of the month:
<<>> Want to monitor
-- Ole Tange many job outputs at once:
--tmuxpane
--ole-tange
New in this release: New in this release:
* GNU Parallel was cited in: Exome sequencing of geographically diverse barley landraces and wild relatives gives insights into environmental adaptation http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.3612.html?WT.feed_name=subjects_genetics#references
* GNU Parallel was cited in: Vision-Enhanced Lidar Odometry and Mapping https://www.ri.cmu.edu/pub_files/2016/8/DLL-thesis.pdf
* <<Possibly http://link.springer.com/chapter/10.1007%2F978-3-319-22053-6_46>> * <<Possibly http://link.springer.com/chapter/10.1007%2F978-3-319-22053-6_46>>
* <<Possibly http://link.springer.com/article/10.1007/s12021-015-9290-5>> * <<Possibly http://link.springer.com/article/10.1007/s12021-015-9290-5>>
@ -268,13 +266,7 @@ for Big Data Applications https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumb
* <<Possible: http://link.springer.com/article/10.1007/s12021-015-9290-5 http://link.springer.com/protocol/10.1007/978-1-4939-3578-9_14>> * <<Possible: http://link.springer.com/article/10.1007/s12021-015-9290-5 http://link.springer.com/protocol/10.1007/978-1-4939-3578-9_14>>
* Easy parallelization with GNU parallel http://mpharrigan.com/2016/08/02/parallel.html * Chown Ceph OSD data directory using GNU Parallel http://blog.widodh.nl/2016/08/chown-ceph-osd-data-directory-using-gnu-parallel/
* Facebook V: Predicting Check Ins, Winner's Interview: 2nd Place, Markus Kliegl http://blog.kaggle.com/2016/08/02/facebook-v-predicting-check-ins-winners-interview-2nd-place-markus-kliegl/
* Parallel import http://www.manitou-mail.org/blog/2016/07/parallel-import/
* Large file batch processing using NodeJs and GNU Parallel http://www.zacorndorff.com/2016/07/27/large-file-batch-processing-using-nodejs-and-gnu-parallel/
* Bug fixes and man page updates. * Bug fixes and man page updates.

View file

@ -24,7 +24,7 @@
use strict; use strict;
use Getopt::Long; use Getopt::Long;
$Global::progname="niceload"; $Global::progname="niceload";
$Global::version = 20160822; $Global::version = 20160823;
Getopt::Long::Configure("bundling","require_order"); Getopt::Long::Configure("bundling","require_order");
get_options_from_array(\@ARGV) || die_usage(); get_options_from_array(\@ARGV) || die_usage();
if($opt::version) { if($opt::version) {

View file

@ -1210,7 +1210,7 @@ sub check_invalid_option_combinations {
sub init_globals { sub init_globals {
# Defaults: # Defaults:
$Global::version = 20160822; $Global::version = 20160823;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -1745,29 +1745,24 @@ sub read_args_from_command_line {
push @group, $arg; push @group, $arg;
} }
} }
if($group_sep eq $Global::arg_sep."+") { my $is_linked = ($group_sep =~ /\+$/) ? 1 : 0;
# :::+ my $is_file = ($group_sep eq $Global::arg_file_sep
push @opt::linkinputsource, 1; or
} elsif($group_sep eq $Global::arg_file_sep."+") { $group_sep eq $Global::arg_file_sep."+");
# ::::+ if($is_file) {
for(@group) { # :::: / ::::+
push @opt::linkinputsource, 1; push @opt::linkinputsource, map { $is_linked } @group;
}
} else { } else {
push @opt::linkinputsource, 0; # ::: / :::+
push @opt::linkinputsource, $is_linked;
} }
if($is_file
if($group_sep eq $Global::arg_file_sep
or
$group_sep eq $Global::arg_file_sep."+"
or ($opt::internal_pipe_means_argfiles and $opt::pipe) or ($opt::internal_pipe_means_argfiles and $opt::pipe)
) { ) {
# Group of file names on the command line. # Group of file names on the command line.
# Append args into -a # Append args into -a
push @opt::a, @group; push @opt::a, @group;
} elsif($group_sep eq $Global::arg_sep } else {
or
$group_sep eq $Global::arg_sep."+") {
# Group of arguments on the command line. # Group of arguments on the command line.
# Put them into a file. # Put them into a file.
# Create argfile # Create argfile
@ -1779,11 +1774,10 @@ sub read_args_from_command_line {
exit_if_disk_full(); exit_if_disk_full();
# Append filehandle to -a # Append filehandle to -a
push @opt::a, $outfh; push @opt::a, $outfh;
} else {
::die_bug("Unknown command line group: $group_sep");
} }
if(defined($arg)) { if(defined($arg)) {
# $arg is ::: or :::: # $arg is ::: :::+ :::: or ::::+
# so there is another group
redo; redo;
} else { } else {
# $arg is undef -> @ARGV empty # $arg is undef -> @ARGV empty

View file

@ -1004,9 +1004,9 @@ limiting factor.
See also: B<--group> B<--ungroup> See also: B<--group> B<--ungroup>
=item B<--xapply> (alpha testing) =item B<--xapply> (beta testing)
=item B<--link> (alpha testing) =item B<--link> beta testing)
Link input sources. Read multiple input sources like B<xapply>. If Link input sources. Read multiple input sources like B<xapply>. If
multiple input sources are given, one argument will be read from each multiple input sources are given, one argument will be read from each
@ -2105,7 +2105,7 @@ Use B<tmux> for output. Start a B<tmux> session and run each job in a
window in that session. No other output will be produced. window in that session. No other output will be produced.
=item B<--tmuxpane> (alpha testing) =item B<--tmuxpane> (beta testing)
Use B<tmux> for output but put output into panes in the first window. Use B<tmux> for output but put output into panes in the first window.
Useful if you want to monitor the progress of less than 100 concurrent Useful if you want to monitor the progress of less than 100 concurrent

View file

@ -566,7 +566,7 @@ $Global::Initfile && unlink $Global::Initfile;
exit ($err); exit ($err);
sub parse_options { sub parse_options {
$Global::version = 20160822; $Global::version = 20160823;
$Global::progname = 'sql'; $Global::progname = 'sql';
# This must be done first as this may exec myself # This must be done first as this may exec myself

View file

@ -54,10 +54,11 @@ prereqremote: installparallel startvm
startvm: startvm:
# Make sure we can reach the virtual machines # Make sure we can reach the virtual machines
#sudo ifconfig wlp13s0:0 192.168.1.72 || sudo ifconfig wlan0:0 192.168.1.72 #sudo ifconfig wlp13s0:0 192.168.1.72 || sudo ifconfig wlan0:0 192.168.1.72
sudo ifconfig enp14s0 192.168.1.72 || sudo ifconfig eth0:0 192.168.1.72 sudo ifconfig enp14s0:0 192.168.1.72 || sudo ifconfig eth0:0 192.168.1.72
# If they are already running: Don't fail # If they are already running: Don't fail
VBoxManage startvm CentOS3-root:centos3 || VBoxManage controlvm CentOS3-root:centos3 resume || true VBoxManage startvm CentOS3-root:centos3 || VBoxManage controlvm CentOS3-root:centos3 resume || true
VBoxManage startvm RedHat9-root:redhat9 || VBoxManage controlvm RedHat9-root:redhat9 resume || true VBoxManage startvm RedHat9-root:redhat9 || VBoxManage controlvm RedHat9-root:redhat9 resume || true
parallel ping -c 3 ::: redhat9.tange.dk centos3.tange.dk oracle11.tange.dk
stopvm: stopvm:
# || true - because this should not fail if the VM is not running # || true - because this should not fail if the VM is not running

View file

@ -635,7 +635,9 @@ echo '**'
echo '### bug #48745: :::+ bug' echo '### bug #48745: :::+ bug'
parallel -k echo ::: 11 22 33 ::::+ <(seq 3) <(seq 21 23) ::: c d e :::+ cc dd ee parallel -k echo ::: 11 22 33 ::::+ <(seq 3) <(seq 21 23) ::: a b c :::+ aa bb cc
parallel -k echo :::: <(seq 3) <(seq 21 23) :::+ a b c ::: aa bb cc
parallel -k echo :::: <(seq 3) :::: <(seq 21 23) :::+ a b c ::: aa bb cc
echo '**' echo '**'

View file

@ -1691,16 +1691,72 @@ echo '**'
** **
echo '### bug #48745: :::+ bug' echo '### bug #48745: :::+ bug'
### bug #48745: :::+ bug ### bug #48745: :::+ bug
parallel -k echo ::: 11 22 33 ::::+ <(seq 3) <(seq 21 23) ::: c d e :::+ cc dd ee parallel -k echo ::: 11 22 33 ::::+ <(seq 3) <(seq 21 23) ::: a b c :::+ aa bb cc
11 1 21 a aa
11 1 21 b bb
11 1 21 c cc 11 1 21 c cc
11 1 21 d dd 22 2 22 a aa
11 1 21 e ee 22 2 22 b bb
22 2 22 c cc 22 2 22 c cc
22 2 22 d dd 33 3 23 a aa
22 2 22 e ee 33 3 23 b bb
33 3 23 c cc 33 3 23 c cc
33 3 23 d dd parallel -k echo :::: <(seq 3) <(seq 21 23) :::+ a b c ::: aa bb cc
33 3 23 e ee 1 21 a aa
1 21 a bb
1 21 a cc
1 22 b aa
1 22 b bb
1 22 b cc
1 23 c aa
1 23 c bb
1 23 c cc
2 21 a aa
2 21 a bb
2 21 a cc
2 22 b aa
2 22 b bb
2 22 b cc
2 23 c aa
2 23 c bb
2 23 c cc
3 21 a aa
3 21 a bb
3 21 a cc
3 22 b aa
3 22 b bb
3 22 b cc
3 23 c aa
3 23 c bb
3 23 c cc
parallel -k echo :::: <(seq 3) :::: <(seq 21 23) :::+ a b c ::: aa bb cc
1 21 a aa
1 21 a bb
1 21 a cc
1 22 b aa
1 22 b bb
1 22 b cc
1 23 c aa
1 23 c bb
1 23 c cc
2 21 a aa
2 21 a bb
2 21 a cc
2 22 b aa
2 22 b bb
2 22 b cc
2 23 c aa
2 23 c bb
2 23 c cc
3 21 a aa
3 21 a bb
3 21 a cc
3 22 b aa
3 22 b bb
3 22 b cc
3 23 c aa
3 23 c bb
3 23 c cc
echo '**' echo '**'
** **
### 1 .par file from --files expected ### 1 .par file from --files expected