C program in Unix / Linux - Time differences


 
Thread Tools Search this Thread
Top Forums Programming C program in Unix / Linux - Time differences
# 1  
Old 09-04-2005
C program in Unix / Linux - Time differences

Hi Friends,

When Iam running c program in redhat linux 7.3 version and PCQ Linux 8.0 version, its taking around 20 seconds. But when Iam running it in HP-UX Release 11i, its taking around 3 minutes. Can anyone throw light on this.

Thanks in advance,
Praveen.
# 2  
Old 09-05-2005
Error

Are all hardware configuations same for different boxes?
# 3  
Old 09-05-2005
It does not just depend on the hardware configuration. You have to account for the load on the box as well.
By the way, it is highly unlikely that the linux boxes and the HP box have the same hardware configuration.
# 4  
Old 09-05-2005
Thanks for your replies. To my surprise ,even my program is occupying 70 - 80% of CPU time and load on server is not high its taking 3 minutes in UNIX.
# 5  
Old 09-05-2005
the scheduler is different between Linux and UNIX . Smilie
# 6  
Old 09-06-2005
Can you suggest me a way so that I can bring down the excution time in HP Unix down to that of Linux time. Whether this issue may be related to buffering of files. At present I didn't enforced buffering files in my c program. Whether using setvbuf() or setbuf()commands during file i/o can increase the performance.
# 7  
Old 09-06-2005
Before jumping off the deep end into a quagmire, do this on HP UX:
Code:
cc -g -p mycode.c -o mycode
.....next let your code run...........
prof mycode

prof will give you a display of where your program's functions are spending time.
By the way, -p links a few monitoring functions into your code, so don't think something is broken whn you see them in your display.

Go from there, don't just guess that setbuf() is the problem - unless you called setbuf() to turn off buffering completely.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

differences in linux and unix shell

hi all, can any one plz tell me that what is the difference between linux shell scripting and unix shell scripting. is there any difference at all?? if yes that what are the differences and how could it be combatted thanks in advance (1 Reply)
Discussion started by: nasir_khan
1 Replies

2. UNIX for Dummies Questions & Answers

Differences between time command and usr/bin/time

I wondered if someone could point out the differences between the time commmand and usr/bin/time and the accuracy one might have over another. Also, is there a website or two a person could maybe link for me to describe the differences? Thank you for your time. (2 Replies)
Discussion started by: icedrake
2 Replies

3. Windows & DOS: Issues & Discussions

XP as a program on Unix/Linux system?

I am sure this question has been asked and answered before, also, if it is the wrong catergory, please let me know. I would like to know how, if possible to run Unix/Linux as my operating system, and then load XP as a program? (I am open to other operating systems, but it has to be able to... (3 Replies)
Discussion started by: mountainwolf
3 Replies

4. UNIX for Dummies Questions & Answers

Socket Handling Differences Between Linux & Unix?

Sorry if this is a stupid question! I have been developing a Java application that I am deploying on both Unix and Linux servers, which uses lots of socket handling. When the server side connection is dropped by the server un-gracefully I have been seeing close_waits and null connections. ... (0 Replies)
Discussion started by: Vinnie
0 Replies

5. Solaris

difficult time differences

:rolleyes: Hi, How to take the time diffence between start and finish time from a log file? It is like ..... started at Jun 20 23:20 . . ..... finished at Jun 21 01:40 Tryed so many ways but failed to ger exact way. :confused: Your help will be honoured. Ta........Lokesha (1 Reply)
Discussion started by: Lokesha
1 Replies

6. Shell Programming and Scripting

Date/time differences

A thanks to all ahead of time. I've checked previous posts about this subject and can't find any that quite fit what I need. If I've missed the post could you point me there. When I do an ls -al I get the following output: -rw-r--r-- 1 staff staff 855 July 24 20:05 ... (4 Replies)
Discussion started by: gillr
4 Replies

7. Shell Programming and Scripting

Working out time differences

Hi everyone, I need to be able to write into a ksh script, a function that can look at 2 24 hour time variables and work out the difference between them. e.g job1 runs at 21:00 job2 runs at 01:00 diff = 04:00 hours I would also need negative numbers i.e where job1 runs after job2 ... (1 Reply)
Discussion started by: rik1551
1 Replies

8. Programming

Program in linux for all unix os

Hello there, I have the following mission for my internship: - Take an existing program which uses OpenGL writen in Delphi, for Windows. - Write this program in C++ for all operating systems from which the name end on a "X" So, what kind of features does this program need. - There... (1 Reply)
Discussion started by: lmnt22
1 Replies
Login or Register to Ask a Question