GNU parallel call shell function make got wrong
up vote
0
down vote
favorite
In my real project ,something like the code blew, read servel modules from file,like a1 a2 a3,a2 depends a1 and a3 depends a2.In another function like b1 b2 b3,but nothing to do with a1 a2 a3,so they can be parallel.
#!/bin/bash
dir=/root/
code_dir="code"
doubleit()
{
local transfer_dir=$1
local moudles=`cat ${code_dir}/depend/$2`
for module in $ moudles;do
${code_dir}/build/build_module.sh $transfer_dir $module
transfer $transfer_dir
done
}
export -f doubleit
export -f transfer
export code_dir
parallel doubleit ::: $dir ::: $A $B
If in function douleit,I called example.sh,do I need to export all the function in example.sh?
I got a wrong msg,can't figure out why.
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
upgrade_col.cpp: In function ‘void increase_update_count(unsigned int)’:
upgrade_col.cpp:170:33: warning: narrowing conversion of ‘uptime’ from ‘time_t {aka long int}’ to ‘unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]
update_ctx_t uctx = {1, uptime};
^
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
parallel: This job failed:
build_packages_parallel /root/v2.5/code/build/eps_cloud basis
when I run the jobs manually,echo $? just output 0,how does the parallel judge if the job is failed.I am very glad if there is any suggestion although it is closely related to my projects.
another question,if I run the function like this
doubleit arg1 &
doubleit arg2 &
wait
does this use the differnt cpu cores to speed up?
if one job failed,how to exit the shell function and killed all the bg task,I know $!,and wait the array,but not work.
linux shell parallel-processing
add a comment |
up vote
0
down vote
favorite
In my real project ,something like the code blew, read servel modules from file,like a1 a2 a3,a2 depends a1 and a3 depends a2.In another function like b1 b2 b3,but nothing to do with a1 a2 a3,so they can be parallel.
#!/bin/bash
dir=/root/
code_dir="code"
doubleit()
{
local transfer_dir=$1
local moudles=`cat ${code_dir}/depend/$2`
for module in $ moudles;do
${code_dir}/build/build_module.sh $transfer_dir $module
transfer $transfer_dir
done
}
export -f doubleit
export -f transfer
export code_dir
parallel doubleit ::: $dir ::: $A $B
If in function douleit,I called example.sh,do I need to export all the function in example.sh?
I got a wrong msg,can't figure out why.
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
upgrade_col.cpp: In function ‘void increase_update_count(unsigned int)’:
upgrade_col.cpp:170:33: warning: narrowing conversion of ‘uptime’ from ‘time_t {aka long int}’ to ‘unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]
update_ctx_t uctx = {1, uptime};
^
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
parallel: This job failed:
build_packages_parallel /root/v2.5/code/build/eps_cloud basis
when I run the jobs manually,echo $? just output 0,how does the parallel judge if the job is failed.I am very glad if there is any suggestion although it is closely related to my projects.
another question,if I run the function like this
doubleit arg1 &
doubleit arg2 &
wait
does this use the differnt cpu cores to speed up?
if one job failed,how to exit the shell function and killed all the bg task,I know $!,and wait the array,but not work.
linux shell parallel-processing
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In my real project ,something like the code blew, read servel modules from file,like a1 a2 a3,a2 depends a1 and a3 depends a2.In another function like b1 b2 b3,but nothing to do with a1 a2 a3,so they can be parallel.
#!/bin/bash
dir=/root/
code_dir="code"
doubleit()
{
local transfer_dir=$1
local moudles=`cat ${code_dir}/depend/$2`
for module in $ moudles;do
${code_dir}/build/build_module.sh $transfer_dir $module
transfer $transfer_dir
done
}
export -f doubleit
export -f transfer
export code_dir
parallel doubleit ::: $dir ::: $A $B
If in function douleit,I called example.sh,do I need to export all the function in example.sh?
I got a wrong msg,can't figure out why.
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
upgrade_col.cpp: In function ‘void increase_update_count(unsigned int)’:
upgrade_col.cpp:170:33: warning: narrowing conversion of ‘uptime’ from ‘time_t {aka long int}’ to ‘unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]
update_ctx_t uctx = {1, uptime};
^
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
parallel: This job failed:
build_packages_parallel /root/v2.5/code/build/eps_cloud basis
when I run the jobs manually,echo $? just output 0,how does the parallel judge if the job is failed.I am very glad if there is any suggestion although it is closely related to my projects.
another question,if I run the function like this
doubleit arg1 &
doubleit arg2 &
wait
does this use the differnt cpu cores to speed up?
if one job failed,how to exit the shell function and killed all the bg task,I know $!,and wait the array,but not work.
linux shell parallel-processing
In my real project ,something like the code blew, read servel modules from file,like a1 a2 a3,a2 depends a1 and a3 depends a2.In another function like b1 b2 b3,but nothing to do with a1 a2 a3,so they can be parallel.
#!/bin/bash
dir=/root/
code_dir="code"
doubleit()
{
local transfer_dir=$1
local moudles=`cat ${code_dir}/depend/$2`
for module in $ moudles;do
${code_dir}/build/build_module.sh $transfer_dir $module
transfer $transfer_dir
done
}
export -f doubleit
export -f transfer
export code_dir
parallel doubleit ::: $dir ::: $A $B
If in function douleit,I called example.sh,do I need to export all the function in example.sh?
I got a wrong msg,can't figure out why.
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
upgrade_col.cpp: In function ‘void increase_update_count(unsigned int)’:
upgrade_col.cpp:170:33: warning: narrowing conversion of ‘uptime’ from ‘time_t {aka long int}’ to ‘unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]
update_ctx_t uctx = {1, uptime};
^
Makefile:18: warning: overriding recipe for target `install'
common.mk:100: warning: ignoring old recipe for target `install'
parallel: This job failed:
build_packages_parallel /root/v2.5/code/build/eps_cloud basis
when I run the jobs manually,echo $? just output 0,how does the parallel judge if the job is failed.I am very glad if there is any suggestion although it is closely related to my projects.
another question,if I run the function like this
doubleit arg1 &
doubleit arg2 &
wait
does this use the differnt cpu cores to speed up?
if one job failed,how to exit the shell function and killed all the bg task,I know $!,and wait the array,but not work.
linux shell parallel-processing
linux shell parallel-processing
edited Nov 18 at 8:48
asked Nov 18 at 4:11
52coder
765
765
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57
add a comment |
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357820%2fgnu-parallel-call-shell-function-make-got-wrong%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See if you can make an MCVE stackoverflow.com/help/mcve
– Ole Tange
Nov 18 at 9:57