mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 15:37:56 +00:00
parallel: $XDG_*
This commit is contained in:
parent
4548ebd756
commit
c63881c4cc
|
@ -131,6 +131,7 @@ git diff
|
||||||
YYYYMMDD=`yyyymmdd`
|
YYYYMMDD=`yyyymmdd`
|
||||||
TAG=MyTag
|
TAG=MyTag
|
||||||
echo "Released as $YYYYMMDD ('$TAG')." | grep MyTag && (STOP;STOP;STOP)
|
echo "Released as $YYYYMMDD ('$TAG')." | grep MyTag && (STOP;STOP;STOP)
|
||||||
|
echo "$TAG" | grep ' ' && (STOP;STOP;STOP)
|
||||||
|
|
||||||
git commit -a -m "Released as $YYYYMMDD ('$TAG')"
|
git commit -a -m "Released as $YYYYMMDD ('$TAG')"
|
||||||
git tag -s -u 88888888 -m "Released as $YYYYMMDD ('$TAG')" $TAG
|
git tag -s -u 88888888 -m "Released as $YYYYMMDD ('$TAG')" $TAG
|
||||||
|
@ -198,26 +199,27 @@ to:parallel@gnu.org, bug-parallel@gnu.org
|
||||||
stable-bcc: Jesse Alama <jessealama@fastmail.fm>
|
stable-bcc: Jesse Alama <jessealama@fastmail.fm>
|
||||||
|
|
||||||
|
|
||||||
Subject: GNU Parallel 20170922 ('Mexico City') released <<[stable]>>
|
Subject: GNU Parallel 20171022 ('Peter Madsen/Catalonia/Las Vegas') released <<[stable]>>
|
||||||
|
|
||||||
GNU Parallel 20170922 ('Mexico City') <<[stable]>> has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/
|
GNU Parallel 20171022 ('Peter Madsen') <<[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:
|
||||||
|
|
||||||
--limit can
|
<<>>
|
||||||
limit jobs dynamic'ly
|
|
||||||
given a command
|
|
||||||
--ole-tange
|
--ole-tange
|
||||||
|
|
||||||
New in this release:
|
New in this release:
|
||||||
|
|
||||||
* Use '--limit myprog' to make a dynamic job limit. Just return 0 to spawn another job, 1 to not spawn another job, and 2 to kill the youngest job.
|
*
|
||||||
|
https://www.turing.ac.uk/events/masterclass-cluster-computing/
|
||||||
|
|
||||||
* PARALLEL_RSYNC_OPTS and --rsync-opts sets the options for rsync (Default: -rlDzR).
|
https://openwetware.org/wiki/Butlin:Unix_for_Bioinformatics_-_advanced_tutorial
|
||||||
|
|
||||||
* Download all of humble bundle books in parallel https://til.hashrocket.com/posts/ggt1jaes4y-download-all-of-humble-bundle-books-in-parallel
|
https://veer66.wordpress.com/2017/09/02/use-multi-core/
|
||||||
|
|
||||||
|
https://gist.github.com/drmalex07/de8ff1379a560f6d84a0d863e60ae378
|
||||||
|
|
||||||
<<Citation not OK: BAMClipper: removing primers from alignments to minimize false-negative mutations in amplicon next-generation sequencing https://www.nature.com/articles/s41598-017-01703-6>>
|
<<Citation not OK: BAMClipper: removing primers from alignments to minimize false-negative mutations in amplicon next-generation sequencing https://www.nature.com/articles/s41598-017-01703-6>>
|
||||||
|
|
||||||
|
|
|
@ -168,6 +168,7 @@ function env_parallel
|
||||||
s/\n/\001/g'
|
s/\n/\001/g'
|
||||||
end;
|
end;
|
||||||
)
|
)
|
||||||
|
# If --record-env: exit
|
||||||
perl -e 'exit grep { /^--record-env$/ } @ARGV' -- $argv; and parallel $argv;
|
perl -e 'exit grep { /^--record-env$/ } @ARGV' -- $argv; and parallel $argv;
|
||||||
set _parallel_exit_CODE $status
|
set _parallel_exit_CODE $status
|
||||||
set -e PARALLEL_ENV
|
set -e PARALLEL_ENV
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
$Global::progname="niceload";
|
$Global::progname="niceload";
|
||||||
$Global::version = 20170922;
|
$Global::version = 20170923;
|
||||||
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) {
|
||||||
|
|
68
src/parallel
68
src/parallel
|
@ -1381,7 +1381,7 @@ sub check_invalid_option_combinations {
|
||||||
|
|
||||||
sub init_globals {
|
sub init_globals {
|
||||||
# Defaults:
|
# Defaults:
|
||||||
$Global::version = 20170922;
|
$Global::version = 20170923;
|
||||||
$Global::progname = 'parallel';
|
$Global::progname = 'parallel';
|
||||||
$Global::infinity = 2**31;
|
$Global::infinity = 2**31;
|
||||||
$Global::debug = 0;
|
$Global::debug = 0;
|
||||||
|
@ -1458,7 +1458,30 @@ sub init_globals {
|
||||||
::warning("\$HOME not set. Using /tmp.");
|
::warning("\$HOME not set. Using /tmp.");
|
||||||
$ENV{HOME} = "/tmp";
|
$ENV{HOME} = "/tmp";
|
||||||
}
|
}
|
||||||
$ENV{'PARALLEL_HOME'} ||= $ENV{'HOME'} . "/.parallel";
|
# no warnings to allow for undefined $XDG_*
|
||||||
|
no warnings 'uninitialized';
|
||||||
|
# $xdg_config_home is needed to make env_parallel.fish stop complaining
|
||||||
|
my $xdg_config_home = $ENV{'XDG_CONFIG_HOME'};
|
||||||
|
# config_dirs = $PARALLEL_HOME, $XDG_CONFIG_HOME/parallel,
|
||||||
|
# $(each XDG_CONFIG_DIRS)/parallel, $HOME/.parallel
|
||||||
|
# Keep only dirs that exist
|
||||||
|
@Global::config_dirs =
|
||||||
|
(grep { -d $_ }
|
||||||
|
$ENV{'PARALLEL_HOME'},
|
||||||
|
(map { "$_/parallel" }
|
||||||
|
$xdg_config_home,
|
||||||
|
split /:/, $ENV{'XDG_CONFIG_DIRS'}),
|
||||||
|
$ENV{'HOME'} . "/.parallel");
|
||||||
|
# Use first dir as config dir
|
||||||
|
$Global::config_dir = $Global::config_dirs[0] ||
|
||||||
|
$ENV{'HOME'} . "/.parallel";
|
||||||
|
# cache_dirs = $PARALLEL_HOME, $XDG_CACHE_HOME/parallel,
|
||||||
|
# Keep only dirs that exist
|
||||||
|
@Global::cache_dirs =
|
||||||
|
(grep { -d $_ }
|
||||||
|
$ENV{'PARALLEL_HOME'}, $ENV{'XDG_CACHE_HOME'}."/parallel");
|
||||||
|
$Global::cache_dir = $Global::cache_dirs[0] ||
|
||||||
|
$ENV{'HOME'} . "/.parallel";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub parse_halt {
|
sub parse_halt {
|
||||||
|
@ -1633,7 +1656,7 @@ sub parse_semaphore {
|
||||||
sub record_env {
|
sub record_env {
|
||||||
# Record current %ENV-keys in $PARALLEL_HOME/ignored_vars
|
# Record current %ENV-keys in $PARALLEL_HOME/ignored_vars
|
||||||
# Returns: N/A
|
# Returns: N/A
|
||||||
my $ignore_filename = $ENV{'PARALLEL_HOME'} . "/ignored_vars";
|
my $ignore_filename = $Global::config_dir . "/ignored_vars";
|
||||||
if(open(my $vars_fh, ">", $ignore_filename)) {
|
if(open(my $vars_fh, ">", $ignore_filename)) {
|
||||||
print $vars_fh map { $_,"\n" } keys %ENV;
|
print $vars_fh map { $_,"\n" } keys %ENV;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1905,18 +1928,16 @@ sub read_options {
|
||||||
# Add options from $PARALLEL_HOME/config and other profiles
|
# Add options from $PARALLEL_HOME/config and other profiles
|
||||||
my @config_profiles = (
|
my @config_profiles = (
|
||||||
"/etc/parallel/config",
|
"/etc/parallel/config",
|
||||||
$ENV{'PARALLEL_HOME'}."/config",
|
(map { "$_/config" } @Global::config_dirs),
|
||||||
$ENV{'HOME'}."/.parallelrc");
|
$ENV{'HOME'}."/.parallelrc");
|
||||||
my @profiles = @config_profiles;
|
my @profiles = @config_profiles;
|
||||||
if(@opt::profile) {
|
if(@opt::profile) {
|
||||||
# --profile overrides default profiles
|
# --profile overrides default profiles
|
||||||
@profiles = ();
|
@profiles = ();
|
||||||
for my $profile (@opt::profile) {
|
for my $profile (@opt::profile) {
|
||||||
if(-r $profile) {
|
# Look for the $profile in . and @Global::config_dirs
|
||||||
push @profiles, $profile;
|
push @profiles, grep { -r $_ }
|
||||||
} else {
|
map { "$_/$profile" } ".", @Global::config_dirs;
|
||||||
push @profiles, $ENV{'PARALLEL_HOME'}."/".$profile;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for my $profile (@profiles) {
|
for my $profile (@profiles) {
|
||||||
|
@ -3116,16 +3137,19 @@ sub expand_slf_shorthand {
|
||||||
if($file eq "-") {
|
if($file eq "-") {
|
||||||
# skip: It is stdin
|
# skip: It is stdin
|
||||||
} elsif($file eq "..") {
|
} elsif($file eq "..") {
|
||||||
$file = $ENV{'PARALLEL_HOME'}."/sshloginfile";
|
$file = $Global::config_dir."/sshloginfile";
|
||||||
} elsif($file eq ".") {
|
} elsif($file eq ".") {
|
||||||
$file = "/etc/parallel/sshloginfile";
|
$file = "/etc/parallel/sshloginfile";
|
||||||
} elsif(not -r $file) {
|
} elsif(not -r $file) {
|
||||||
if(not -r $ENV{'PARALLEL_HOME'}."/".$file) {
|
for(@Global::config_dirs) {
|
||||||
|
if(not -r $_."/".$file) {
|
||||||
# Try prepending $PARALLEL_HOME
|
# Try prepending $PARALLEL_HOME
|
||||||
::error("Cannot open $file.");
|
::error("Cannot open $file.");
|
||||||
::wait_and_exit(255);
|
::wait_and_exit(255);
|
||||||
} else {
|
} else {
|
||||||
$file = $ENV{'PARALLEL_HOME'}."/".$file;
|
$file = $_."/".$file;
|
||||||
|
last;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $file;
|
return $file;
|
||||||
|
@ -4049,7 +4073,7 @@ sub citation_notice {
|
||||||
or
|
or
|
||||||
not -t $Global::original_stderr
|
not -t $Global::original_stderr
|
||||||
or
|
or
|
||||||
-e $ENV{'PARALLEL_HOME'}."/will-cite") {
|
grep { -e "$_/will-cite" } @Global::config_dirs) {
|
||||||
# skip
|
# skip
|
||||||
} else {
|
} else {
|
||||||
::status
|
::status
|
||||||
|
@ -4158,15 +4182,15 @@ sub citation {
|
||||||
"mentioned in the release notes of next version of GNU Parallel.",
|
"mentioned in the release notes of next version of GNU Parallel.",
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
while(not -e $ENV{'PARALLEL_HOME'}."/will-cite") {
|
while(not grep { -e "$_/will-cite" } @Global::config_dirs) {
|
||||||
print "\nType: 'will cite' and press enter.\n> ";
|
print "\nType: 'will cite' and press enter.\n> ";
|
||||||
my $input = <STDIN>;
|
my $input = <STDIN>;
|
||||||
if(not defined $input) {
|
if(not defined $input) {
|
||||||
exit(255);
|
exit(255);
|
||||||
}
|
}
|
||||||
if($input =~ /will cite/i) {
|
if($input =~ /will cite/i) {
|
||||||
mkdir $ENV{'PARALLEL_HOME'};
|
mkdir $Global::config_dir;
|
||||||
if(open (my $fh, ">", $ENV{'PARALLEL_HOME'}."/will-cite")) {
|
if(open (my $fh, ">", $Global::config_dir."/will-cite")) {
|
||||||
close $fh;
|
close $fh;
|
||||||
::status(
|
::status(
|
||||||
"",
|
"",
|
||||||
|
@ -4917,11 +4941,11 @@ sub new {
|
||||||
'control_path' => undef,
|
'control_path' => undef,
|
||||||
'time_to_login' => undef,
|
'time_to_login' => undef,
|
||||||
'last_login_at' => undef,
|
'last_login_at' => undef,
|
||||||
'loadavg_file' => $ENV{'PARALLEL_HOME'} . "/tmp/sshlogin/" .
|
'loadavg_file' => $Global::cache_dir . "/tmp/sshlogin/" .
|
||||||
$no_slash_string . "/loadavg",
|
$no_slash_string . "/loadavg",
|
||||||
'loadavg' => undef,
|
'loadavg' => undef,
|
||||||
'last_loadavg_update' => 0,
|
'last_loadavg_update' => 0,
|
||||||
'swap_activity_file' => $ENV{'PARALLEL_HOME'} . "/tmp/sshlogin/" .
|
'swap_activity_file' => $Global::cache_dir . "/tmp/sshlogin/" .
|
||||||
$no_slash_string . "/swap_activity",
|
$no_slash_string . "/swap_activity",
|
||||||
'swap_activity' => undef,
|
'swap_activity' => undef,
|
||||||
}, ref($class) || $class;
|
}, ref($class) || $class;
|
||||||
|
@ -7762,7 +7786,7 @@ sub sshlogin_wrap {
|
||||||
local $/ = "\n";
|
local $/ = "\n";
|
||||||
# --env _
|
# --env _
|
||||||
# Include all vars that are not in a clean environment
|
# Include all vars that are not in a clean environment
|
||||||
if(open(my $vars_fh, "<", $ENV{'PARALLEL_HOME'} . "/ignored_vars")) {
|
if(open(my $vars_fh, "<", $Global::config_dir . "/ignored_vars")) {
|
||||||
my @ignore = <$vars_fh>;
|
my @ignore = <$vars_fh>;
|
||||||
chomp @ignore;
|
chomp @ignore;
|
||||||
my %ignore;
|
my %ignore;
|
||||||
|
@ -10113,7 +10137,7 @@ sub max_length {
|
||||||
# number of chars on the longest command line allowed
|
# number of chars on the longest command line allowed
|
||||||
if(not $Limits::Command::line_max_len) {
|
if(not $Limits::Command::line_max_len) {
|
||||||
# Disk cache of max command line length
|
# Disk cache of max command line length
|
||||||
my $len_cache = $ENV{'PARALLEL_HOME'} . "/tmp/sshlogin/" . ::hostname() .
|
my $len_cache = $Global::cache_dir . "/tmp/sshlogin/" . ::hostname() .
|
||||||
"/linelen";
|
"/linelen";
|
||||||
my $cached_limit;
|
my $cached_limit;
|
||||||
if(-e $len_cache) {
|
if(-e $len_cache) {
|
||||||
|
@ -11348,7 +11372,7 @@ sub new {
|
||||||
my $count = shift;
|
my $count = shift;
|
||||||
$id =~ s/([^-_a-z0-9])/unpack("H*",$1)/ige; # Convert non-word chars to hex
|
$id =~ s/([^-_a-z0-9])/unpack("H*",$1)/ige; # Convert non-word chars to hex
|
||||||
$id = "id-".$id; # To distinguish it from a process id
|
$id = "id-".$id; # To distinguish it from a process id
|
||||||
my $parallel_locks = $ENV{'PARALLEL_HOME'}."/semaphores";
|
my $parallel_locks = $Global::cache_dir . "/semaphores";
|
||||||
-d $parallel_locks or ::mkdir_or_die($parallel_locks);
|
-d $parallel_locks or ::mkdir_or_die($parallel_locks);
|
||||||
my $lockdir = "$parallel_locks/$id";
|
my $lockdir = "$parallel_locks/$id";
|
||||||
|
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ B<-l 0> is an alias for B<-l 1>.
|
||||||
Implies B<-X> unless B<-m>, B<--xargs>, or B<--pipe> is set.
|
Implies B<-X> unless B<-m>, B<--xargs>, or B<--pipe> is set.
|
||||||
|
|
||||||
|
|
||||||
=item B<--limit> "I<command> I<args>" (alpha testing)
|
=item B<--limit> "I<command> I<args>" (beta testing)
|
||||||
|
|
||||||
Dynamic job limit. Before starting a new job run I<command> with
|
Dynamic job limit. Before starting a new job run I<command> with
|
||||||
I<args>. The exit value of I<command> determines what GNU B<parallel>
|
I<args>. The exit value of I<command> determines what GNU B<parallel>
|
||||||
|
@ -1085,9 +1085,9 @@ Similar to B<--memfree>.
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
|
||||||
=item B<--line-buffer> (beta testing)
|
=item B<--line-buffer>
|
||||||
|
|
||||||
=item B<--lb> (beta testing)
|
=item B<--lb>
|
||||||
|
|
||||||
Buffer output on line basis. B<--group> will keep the output together
|
Buffer output on line basis. B<--group> will keep the output together
|
||||||
for a whole job. B<--ungroup> allows output to mixup with half a line
|
for a whole job. B<--ungroup> allows output to mixup with half a line
|
||||||
|
@ -1915,7 +1915,7 @@ You can even use multiple matches:
|
||||||
See also: B<{= perl expression =}> B<--parens>
|
See also: B<{= perl expression =}> B<--parens>
|
||||||
|
|
||||||
|
|
||||||
=item B<--rsync-opts> I<options> (alpha testing)
|
=item B<--rsync-opts> I<options> (beta testing)
|
||||||
|
|
||||||
Options to pass on to B<rsync>. Setting B<--rsync-opts> takes
|
Options to pass on to B<rsync>. Setting B<--rsync-opts> takes
|
||||||
precedence over setting the environment variable $PARALLEL_RSYNC_OPTS.
|
precedence over setting the environment variable $PARALLEL_RSYNC_OPTS.
|
||||||
|
@ -2188,7 +2188,8 @@ B<ssh-copy-id>, and B<sshpass> may help with that).
|
||||||
The sshlogin ':' is special, it means 'no ssh' and will therefore run
|
The sshlogin ':' is special, it means 'no ssh' and will therefore run
|
||||||
on the local computer.
|
on the local computer.
|
||||||
|
|
||||||
The sshlogin '..' is special, it read sshlogins from ~/.parallel/sshloginfile
|
The sshlogin '..' is special, it read sshlogins from ~/.parallel/sshloginfile or
|
||||||
|
$XDG_CONFIG_HOME/parallel/sshloginfile
|
||||||
|
|
||||||
The sshlogin '-' is special, too, it read sshlogins from stdin
|
The sshlogin '-' is special, too, it read sshlogins from stdin
|
||||||
(standard input).
|
(standard input).
|
||||||
|
|
|
@ -1288,6 +1288,18 @@ GNU B<parallel> can be used as a poor-man's version of ClusterSSH:
|
||||||
|
|
||||||
B<parallel --nonall -S server-a,server-b do_stuff foo bar>
|
B<parallel --nonall -S server-a,server-b do_stuff foo bar>
|
||||||
|
|
||||||
|
=head2 coshell
|
||||||
|
|
||||||
|
B<coshell> only accepts full commands on standard input. Any quoting
|
||||||
|
needs to be done by the user.
|
||||||
|
|
||||||
|
Commands are run in B<sh> so any B<bash>/B<tcsh>/B<zsh> specific
|
||||||
|
syntax will not work.
|
||||||
|
|
||||||
|
Output can be buffered by using B<-d>. Output is buffered in memory,
|
||||||
|
so big output can cause swapping and therefore be terrible slow or
|
||||||
|
even cause out of memory.
|
||||||
|
|
||||||
|
|
||||||
=head2 Todo
|
=head2 Todo
|
||||||
|
|
||||||
|
|
2
src/sql
2
src/sql
|
@ -576,7 +576,7 @@ $Global::Initfile && unlink $Global::Initfile;
|
||||||
exit ($err);
|
exit ($err);
|
||||||
|
|
||||||
sub parse_options {
|
sub parse_options {
|
||||||
$Global::version = 20170922;
|
$Global::version = 20170923;
|
||||||
$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
|
||||||
|
|
|
@ -62,9 +62,9 @@ par_linebuffer_matters_compress_tag() {
|
||||||
|
|
||||||
testfunc() {
|
testfunc() {
|
||||||
linebuffer="$1"
|
linebuffer="$1"
|
||||||
# Sleep 2 sec to give time to linebuffer-print the first part
|
# Sleep 3 sec to give time to linebuffer-print the first part
|
||||||
parallel -j0 $linebuffer --compress --tag \
|
parallel -j0 $linebuffer --compress --tag \
|
||||||
"shuf $randomfile; sleep 2; shuf $randomfile; true" ::: {0..10} |
|
"shuf $randomfile; sleep 3; shuf $randomfile; true" ::: {0..10} |
|
||||||
perl -ne '/^(\S+)\t/ and print "$1\n"' | uniq | sort
|
perl -ne '/^(\S+)\t/ and print "$1\n"' | uniq | sort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -349,13 +349,13 @@ echo '{##} bug #45841: Replacement string for total no of jobs'
|
||||||
3 3
|
3 3
|
||||||
parallel -k -S 8/: -X --plus echo {#} {##} ::: {1..15}
|
parallel -k -S 8/: -X --plus echo {#} {##} ::: {1..15}
|
||||||
1 15 15
|
1 15 15
|
||||||
2 15 15
|
2 14 14
|
||||||
3 15 15
|
3 14 14
|
||||||
4 15 15
|
4 14 14
|
||||||
5 15 15
|
5 14 14
|
||||||
6 15 15
|
6 14 14
|
||||||
7 15 15
|
7 14 14
|
||||||
8 15
|
8 14
|
||||||
echo '**'
|
echo '**'
|
||||||
**
|
**
|
||||||
echo 'bug #47002: --tagstring with -d \n\n'
|
echo 'bug #47002: --tagstring with -d \n\n'
|
||||||
|
|
Loading…
Reference in a new issue