LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-15-2017, 01:28 AM   #1
dejavu
LQ Newbie
 
Registered: Jun 2017
Posts: 3

Rep: Reputation: Disabled
DejaGnu - compile & execute the source file in parallel


Hi,
I am using the DejaGNU Testsuite to compile & execute a series of source files.
As the compilation & execution happens sequentially in DejaGNU testsuite, it takes some amount of time to complete the run for one set of compiler options. The problem is if I need to add few more compiler option sets then the testsuite completion time multiples as per the number of option sets. Is there a way to parallelize the whole process ?.

Thanks in advance.
 
Old 06-16-2017, 07:10 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,999

Rep: Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714
Before you run dejagnu, you could try
Code:
alias make='make -j<number>'
e.g. alias make='make -j4'

and if you can point it at several targets simultaneously, you can run
<command 1> & <command 2> & ...<command n>
which has the effect of invoking them together. It starts the first, then the second without waiting for the first to finish, etc.

YMMV. These are more resource hungry and error prone ways of speeding life up. Is that what you want?
 
Old 06-16-2017, 07:19 AM   #3
dejavu
LQ Newbie
 
Registered: Jun 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi,
Thanks for the response.

I did not get you fully. FYI, I am invoking the "runtest" via a shell script, do you mean use makefile to do the job ?
Could you please detail.
 
Old 06-16-2017, 02:44 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,999

Rep: Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714
An alias simply is an environment variable of sorts. Every time you run 'make' it actually causes 'make -j<number>' to be run, allowing <number> simultaneous processes. Personally, I never run more than make -j2, but it depends on your box. In other terminals, make runs as normal. You are very economical with your facts, and you need to tell me relevant stuff if I am to help. To use all my optimizations, open a terminal and type something like
Code:
alias make='make -j4
shell_script dir_1 & shell_script dir_2
That would run 2 instances of the shellscript running up to 8 make processes in two directories. I have no clue if the syntax would work because you have told me nothing, but the idea works in principle.

Last edited by business_kid; 06-16-2017 at 02:46 PM.
 
Old 06-19-2017, 12:37 AM   #5
dejavu
LQ Newbie
 
Registered: Jun 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up

Hi,
If my posts made you assume that it has very less info, sorry for that.

I am trying to invoke dejagnu runtest.exp using a shell script, that will get input from a global *.exp file which has different testsuite options/commands for compiling & linking the source files present in the path dejagnu-testsuite/config/global.exp

Command to invoke runtest:
"dejagnu/runtest --tool 'dir_names'"

'dir_names' is the set of source file directories present in the dejagnu-testsuite folder.

Execution is explained below:
Lets say I have 5 source files each in 2 dirs in dejagnu-testsuite folder & 2 option sets dejagnu-testsuite/config/global.exp, then
option set1 + source_file1 in dir1 => result written in *.log file
option set1 + source_file2 in dir1 => result appended in *.log file
.
.
option set1 + source_file5 in dir1 => result appended in *.log file
then again,
option set1 + source_file1 in dir2 => result appended in *.log file
option set1 + source_file2 in dir2 => result appended in *.log file
.
.
option set1 + source_file5 in dir2 => result appended in *.log file.

The same is repeated for option set2 also.


Does that gives more insight ? Your suggestions are most welcome.
 
Old 06-19-2017, 02:00 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, RPi OS, Mint & Android
Posts: 12,999

Rep: Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714Reputation: 1714
Code:
Does that gives more insight ?
Frankly, no. But it's been a long day.

What happens if you run
Code:
alias make='make -j2
dejagnu/runtest --tool 'dir_name_1 & dejagnu/runtest --tool 'dir_name_2
Presuming there are 2 separate directories to be tested. If not, you can hardly run that sort of thing.
and in a separate location
Code:
pgrep make
and count the process ids.
 
  


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
calc source in dejagnu jyunker Linux - Newbie 4 09-24-2014 09:01 AM
Parallel Shell scripts to execute using LAM?? vallme2003 Programming 6 03-12-2009 05:49 PM
How to execute two shell scripts in parallel Pavitra.v Linux - General 4 09-16-2006 05:59 AM
how to download a EXE file on ram & execute it sapna pandey Linux - General 1 08-30-2006 12:10 AM
How to compile and execute Doom 1.10 source code sharathkv Linux - Newbie 1 08-26-2003 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:57 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
Open Source Consulting | Domain Registration