ns2 simulator with gcc compiler using only 1 processor(?)


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ns2 simulator with gcc compiler using only 1 processor(?)
# 1  
Old 09-02-2010
ns2 simulator with gcc compiler using only 1 processor(?)

Hi!
I am using the ns2.31 simulator in Ubuntu 9.04.
I have developed my program and when I simulate it (calling ns2 from Ubuntu default shell, that uses gcc), I notice that only 1 of the 2 processors available in my notebook seems to be used (simulations are very heavy and my notebook stays around 25 minutes with the processor usage at 50%, but for example if I try opening firefox or open office, it requires minutes to do it and it blocks frequently).

I am not an expert and I'd like to understand why the processors are not at 100% (maybe only 1 of the 2 processors is used? Is there some way to force shell/gcc to use both?).

Maybe I didn't get the real problem, I hope someone can help!
Thank you a lot!!Smilie
# 2  
Old 09-02-2010
Quote:
Originally Posted by Alice236
I have developed my program and when I simulate it (calling ns2 from Ubuntu default shell, that uses gcc)
I take it you're building ns2 in the background, then? (otherwise I wouldn't have a clue why a network simulator would be using gcc.) If so you can just run make -j2 to have it use both cores. -j4 for quad core, etc.

As for why it's slow, what's your disk doing while it's building? Maybe it's low on memory and eating into swap, which would slow everything down.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 09-02-2010
(I guess it's not a problem of memory: only half of the memory is used and no swap)
Anyway, make -j2 was really the option I was looking for: finally now I see 100% of processor used. Thanks!
# 4  
Old 11-16-2010
Hi there,

I had similar problem with the ns2 simulator. I mean I also noticed that only 1 of the 2 processors available in my machine seems to be used. But I did the "make -j2" and problem still persist. So, I would like to ask you.

(1) Did you run the command "make -j2" for compiling ns2, gcc or the kernel linux?


The hardware configuration is as follow (command output "uname -a" :
Linux VMServer1 2.6.31-14-server #48-Ubuntu SMP XXXX-XX-XX UTC 2009 x86_64 GNU/Linux

Could you help me?

Thanks,
# 5  
Old 11-16-2010
Hi!
If I remember correctly I used the -j2 option for gcc (sorry I cannot give you more details since I am on holiday for the next 2 weeks and I don't have my pc with me, anyway I think I used ubuntu 9.04 with a desktop edition at that time).

The option was effective in compiling ns2 while I was implementing my code, then, once I compiled my code and solved some problems, when I run ns2 simulations calling ns2 directly from the shell, my simulations were not anymore heavy and so I didn't look for some way to use both processors also when running simulations, since it was not necessary in my case.

Sorry: I hope that someone more expert that me will be able to help youSmilie

Best wishes!
# 6  
Old 11-17-2010
It may be disk-bound, not reading fast enough to keep both cores busy most of the time. You could try -j3.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

2. Fedora

gcc arm compiler

think only compile is required I wish to compile a sample code int main() { int a=5,b=8,c; c=a+b; } compile using gcc -Wall -g -march=arm922t main.c -o hello I got an error :bad value(arm922t) for -march=switch instead of using march i used mcpu options ,the same... (1 Reply)
Discussion started by: sujith4u87
1 Replies

3. Programming

gcc compiler

Which gcc compiler release had the Arm 9 multicore support?Whether the compiler that used for the single Arm 9 core can be used for its multicore systems ? If gcc not support,please tell me which are the compilers that are available for Arm 9 multicore systems (including commerical).Whether... (0 Replies)
Discussion started by: sujith4u87
0 Replies

4. Shell Programming and Scripting

gcc compiler

I am using open suse linux. I want to install gcc compiler in my machine. I ahve checked man gcc and man cc. But it's not there. Can someone help me (4 Replies)
Discussion started by: pritish.sas
4 Replies

5. Ubuntu

gcc compiler

where to download gcc compiler for ubuntu? how to install? how to build and run "c programs"? screen shots if possible.....:b::D tutorials too:cool: (5 Replies)
Discussion started by: villanarun
5 Replies

6. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

7. Programming

gcc compiler

i write c++ code it run perfectely with g++ compiler but same code when i compile with GCC compiler it gives linker error , followed these linker error /tmp/ccfZtXOQ.o(.text+0x22): In function `main': conf_system.cpp: undefined reference to `operator new(unsigned int)'... (5 Replies)
Discussion started by: munnu
5 Replies

8. UNIX for Dummies Questions & Answers

cc compiler / gcc

:confused: I have a question concerning gcc. IŽd like to install the gcc on my Mac OS X, but when I try to run the configure command I get the following message: floriant% ./configure ./configure: read-only variable: PWD Configuring for a powerpc-apple-darwin5.4 host. *** This configuration... (2 Replies)
Discussion started by: florian.turck
2 Replies
Login or Register to Ask a Question