gnu-parallel

Accessing Associative Arrays in GNU Parallel

巧了我就是萌 提交于 2019-12-01 10:58:55
Assume the following in Bash: declare -A ar='([one]="1" [two]="2" )' declare -a ari='([0]="one" [1]="two")' for i in ${!ari[@]}; do echo $i ${ari[i]} ${ar[${ari[i]}]} done 0 one 1 1 two 2 Can the same be done with GNU Parallel, making sure to use the index of the associative array, not the sequence? Does the fact that arrays can't be exported make this difficult, if not impossible? A lot has happened in 4 years. GNU Parallel 20190222 comes with env_parallel . This is a shell function that makes it possible to export the most of the environment to the commands run by GNU Parallel. It is

GNU parallel --jobs option using multiple nodes on cluster with multiple cpus per node

吃可爱长大的小学妹 提交于 2019-11-30 09:25:21
I am using gnu parallel to launch code on a high performance (HPC) computing cluster that has 2 CPUs per node. The cluster uses TORQUE portable batch system (PBS). My question is to clarify how the --jobs option for GNU parallel works in this scenario. When I run a PBS script calling GNU parallel without the --jobs option, like this: #PBS -lnodes=2:ppn=2 ... parallel --env $PBS_O_WORKDIR --sshloginfile $PBS_NODEFILE \ matlab -nodiplay -r "\"cd $PBS_O_WORKDIR,primes1({})\"" ::: 10 20 30 40 it looks like it only uses one CPU per core, and also provides the following error stream: bash: parallel:

OpenMP/__gnu_parallel for an unordered_map

独自空忆成欢 提交于 2019-11-29 15:14:55
At some point in my code I have to make operations on all elements in an unordered_map. In order to accelerate this process I want to use openMP, but the naive approach does not work: std::unordered_map<size_t, double> hastTable; #pragma omp for for(auto it = hastTable.begin(); it != hastTable.end(); it ++){ //do something } The reason for this is, that the iterator of an unordered_map is no random access iterator. As an alternative I have tried the __gnu_parallel directives working on for_each. But the following code #include <parallel/algorithm> #include <omp.h> __gnu_parallel::for_each

GNU parallel --jobs option using multiple nodes on cluster with multiple cpus per node

痴心易碎 提交于 2019-11-29 14:21:00
问题 I am using gnu parallel to launch code on a high performance (HPC) computing cluster that has 2 CPUs per node. The cluster uses TORQUE portable batch system (PBS). My question is to clarify how the --jobs option for GNU parallel works in this scenario. When I run a PBS script calling GNU parallel without the --jobs option, like this: #PBS -lnodes=2:ppn=2 ... parallel --env $PBS_O_WORKDIR --sshloginfile $PBS_NODEFILE \ matlab -nodiplay -r "\"cd $PBS_O_WORKDIR,primes1({})\"" ::: 10 20 30 40 it

GNU Parallel and Bash functions: How to run the simple example from the manual

寵の児 提交于 2019-11-28 23:23:12
I'm trying to learn GNU Parallel because I have a case where I think I could easily parallelize a bash function. So in trying to learn, I went to the GNU Parallel manual where there is an example ...but I can't even get it working! To wit: (232) $ bash --version GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (233) $ cat tpar.bash #!

OpenMP/__gnu_parallel for an unordered_map

喜夏-厌秋 提交于 2019-11-28 09:15:05
问题 At some point in my code I have to make operations on all elements in an unordered_map. In order to accelerate this process I want to use openMP, but the naive approach does not work: std::unordered_map<size_t, double> hastTable; #pragma omp for for(auto it = hastTable.begin(); it != hastTable.end(); it ++){ //do something } The reason for this is, that the iterator of an unordered_map is no random access iterator. As an alternative I have tried the __gnu_parallel directives working on for

GNU parallel not working at all

妖精的绣舞 提交于 2019-11-26 20:19:19
I have been trying to use GNU parallel for some time, but I have never been able to get it to function at all! For example, running (in a non-empty directory!): ls | parallel echo # Outputs single new line ls | parallel echo echo echo # Outputs three new lines. ls | parallel echo {} # /bin/bash: {}: command not found ls | parallel echo '{}' # /bin/bash: {}: command not found ls | parallel 'echo {}' # Outputs: {} ls | parallel -IMM 'echo MM' # Outputs: MM It seems that it is simply executing each argument as a command, which makes no sense. I have tried bash, zsh, tcsh, csh, and sh, to no avail