LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2009, 12:09 AM   #1
vallme2003
LQ Newbie
 
Registered: Dec 2008
Posts: 5

Rep: Reputation: 0
Thumbs up Parallel Shell scripts to execute using LAM??


Guys i want to know whether we can write a shell script which can utilize 2 CPU's of a cluster...I heard its possible through C Shell ( Ref : http://www.gnu-darwin.org/gdc/ccp4/parallelization/ ) But im familiar with bourne shell only....So is there a possibility to write Parallel Scripts..Expecting ur Answer.....
 
Old 01-27-2009, 05:00 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
You can be interested in "PPSS - Parallel Processing Shell Script". It is a single bash script spawning multiple threads on multiple cores.

Last edited by colucix; 01-27-2009 at 05:07 PM. Reason: typo corrected
 
Old 01-28-2009, 01:11 AM   #3
vallme2003
LQ Newbie
 
Registered: Dec 2008
Posts: 5

Original Poster
Rep: Reputation: 0
My Case

I have a doubt again...I already heard about PPSH script..Guess it was written to utilize the multicores...In my case i have build a beowulf cluster which is originally 2 Cpu's but virtually a single CPU...Plus i use a live distro to setup my cluster..So not sure how the script will detect it? (May be as Single Cluster CPU or as Single Node)...Ur Suggestions Guys?
 
Old 01-28-2009, 01:41 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Indeed, looking at the source code, the script ppss.sh has a weak method to retrieve the number of CPUs:
Code:
cat /proc/cpuinfo | grep "cpu cores" | cut -d ":" -f 2 | uniq | sed -e s/\ //g
on a system with multiple CPUs this will detetct only the number of cores for each CPU, resulting in a number of available parallel threads which is less than the total sum of the cores. I tested it on a 2 XEON QUAD CORE machine, and obviously it detects only 4 cores instead of the actual 8. You can try to modify the code to reveal the actual number of cores using a method specific to your beowulf build.
 
Old 03-09-2009, 06:50 PM   #5
Louwrentius
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Indeed, looking at the source code, the script ppss.sh has a weak method to retrieve the number of CPUs:
Code:
cat /proc/cpuinfo | grep "cpu cores" | cut -d ":" -f 2 | uniq | sed -e s/\ //g
on a system with multiple CPUs this will detetct only the number of cores for each CPU, resulting in a number of available parallel threads which is less than the total sum of the cores. I tested it on a 2 XEON QUAD CORE machine, and obviously it detects only 4 cores instead of the actual 8. You can try to modify the code to reveal the actual number of cores using a method specific to your beowulf build.
Hi,

I'm the author of PPSS and I'd like to inform you that this bug has been fixed, in my opinion in the new (distributed) version of PPSS.

If you find such bugs in the future, it would be a great help if an issue is created at the website of ppss.

http://code.google.com/p/ppss

With regards.
 
Old 03-09-2009, 07:02 PM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Nice to meet you, Louwrentius. Indeed I was too focused on replying to this thread and did not think about reporting a bug to the developer's site. I will accomplish in the future. Thank you.
 
Old 03-12-2009, 05:49 PM   #7
Louwrentius
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Nice to meet you, Louwrentius. Indeed I was too focused on replying to this thread and did not think about reporting a bug to the developer's site. I will accomplish in the future. Thank you.
Never mind and thanks anyway
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute two shell scripts in parallel Pavitra.v Linux - General 4 09-16-2006 05:59 AM
execute shell-scripts at kde startup supersucker Linux - Newbie 10 10-28-2005 10:47 AM
Execute Shell Scripts on startup dragoroberto Linux - Software 9 02-28-2005 08:46 AM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 01:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration