From eaedef99373550b3c622589a439ada2d3196c58f Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 18 Sep 2014 22:09:20 +0200 Subject: [PATCH] src/parallel: Small disk full optimization. src/parallel.pod: --tollef elaboration (Thanks to Robin Neatherway). --- doc/release_new_version | 4 ++++ src/parallel | 6 +++--- src/parallel.pod | 34 ++++++++++++++++++++-------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index 071035ee..61018fa7 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -240,8 +240,12 @@ New in this release: * OCRmyPDF uses GNU Parallel https://github.com/fritz-hh/OCRmyPDF/ +* GNU Parallel was presented at Balti and Bioinformatics "On-Air" http://youtu.be/UtXlr19xTh8?t=2h5m0s + * GNU Parallel (Sebuah Uji Coba) http://pr4ka5a.wordpress.com/2014/09/04/gnu-parallel-sebuah-uji-coba/ +* GNU Parallel: 并行执行Linux命令 http://blog.csdn.net/xzz_hust/article/details/39183837 + * Bug fixes and man page updates. GNU Parallel - For people who live life in the parallel lane. diff --git a/src/parallel b/src/parallel index ce91f4ec..def387ae 100755 --- a/src/parallel +++ b/src/parallel @@ -724,7 +724,7 @@ sub get_options_from_array { sub parse_options { # Returns: N/A # Defaults: - $Global::version = 20140827; + $Global::version = 20140914; $Global::progname = 'parallel'; $Global::infinity = 2**31; $Global::debug = 0; @@ -5998,7 +5998,6 @@ sub set_exitsignal { unlink $name; $b8193 = "x"x8193; } - my $pos = tell $disk_full_fh; # Linux does not discover if a disk is full if writing <= 8192 # Tested on: # bfs btrfs cramfs ext2 ext3 ext4 ext4dev jffs2 jfs minix msdos @@ -6018,12 +6017,13 @@ sub set_exitsignal { print $disk_full_fh $b8193; if(not $disk_full_fh or - tell $disk_full_fh == $pos) { + tell $disk_full_fh == 0) { ::error("Output is incomplete. Cannot append to buffer file in $ENV{'TMPDIR'}. Is the disk full?\n"); ::error("Change \$TMPDIR with --tmpdir or use --compress.\n"); ::wait_and_exit(255); } truncate $disk_full_fh, 0; + seek($disk_full_fh, 0, 0) || die; } } diff --git a/src/parallel.pod b/src/parallel.pod index b4ff9222..7c317dc2 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -647,9 +647,9 @@ infinite loop. This will likely be fixed in a later release. =item B<--gnu> -Behave like GNU B. If B<--tollef> and B<--gnu> are both set, -B<--gnu> takes precedence. B<--tollef> is retired, but B<--gnu> is -kept for compatibility. +Behave like GNU B. This option historically took precedence +over B<--tollef>. The B<--tollef> option is now retired, and therefore +may not be used. B<--gnu> is kept for compatibility. =item B<--group> @@ -3215,20 +3215,26 @@ must be one argument. =head1 DEFAULT PROFILE (CONFIG FILE) -The file ~/.parallel/config (formerly known as .parallelrc) will be -read if it exists. Lines starting with '#' will be ignored. It can be -formatted like the environment variable $PARALLEL, but it is often -easier to simply put each option on its own line. +The global configuration file /etc/parallel/config, followed by user +configuration file ~/.parallel/config (formerly known as .parallelrc) +will be read in turn if they exist. Lines starting with '#' will be +ignored. The format can follow that of the environment variable +$PARALLEL, but it is often easier to simply put each option on its own +line. -Options on the command line takes precedence over the environment -variable $PARALLEL which takes precedence over the file -~/.parallel/config. +Options on the command line take precedence, followed by the +environment variable $PARALLEL, user configuration file +~/.parallel/config, and finally the global configuration file +/etc/parallel/config. +Note that no file that is read for options, nor the environment +variable $PARALLEL, may contain retired options such as B<--tollef>. =head1 PROFILE FILES -If B<--profile> set, GNU B will read the profile from that file instead of -~/.parallel/config. You can have multiple B<--profiles>. +If B<--profile> set, GNU B will read the profile from that +file rather than the global or user configuration files. You can have +multiple B<--profiles>. Example: Profile for running a command on every sshlogin in ~/.ssh/sshlogins and prepend the output with the sshlogin: @@ -3425,7 +3431,7 @@ supports (See REPORTING BUGS). =head2 DIFFERENCES BETWEEN xargs AND GNU Parallel -B offer some of the same possibilities as GNU B. +B offers some of the same possibilities as GNU B. B deals badly with special characters (such as space, ' and "). To see the problem try this: @@ -3948,7 +3954,7 @@ B deals badly with filenames containing " and newline, and it fails for o =head3 EXAMPLES FROM ladon MANUAL It is assumed that the '--rpl's above are put in B<~/.parallel/config> -and that it is run under a shell that support '**' globbing (such as B): +and that it is run under a shell that supports '**' globbing (such as B): B<1> ladon "**/*.txt" -- echo RELPATH