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!!
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.
(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!
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,
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 you:(
Best wishes!
It may be disk-bound, not reading fast enough to keep both cores busy most of the time. You could try -j3.