• Post Reply Bookmark Topic Watch Topic
  • New Topic

job speed and # of processors  RSS feed

 
Steve Yu
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I run a pgm "java MyPgm param_1" on my machine I find it takes 1 hour. Then I run "Java MyPgm param_2" it takes 1 hr. Then I have to run "java MyPgm param_3", etc. Instead of running them one after another, I want to invoke two background jobs simultaneously, ie. run
java MyPgm param_1
java MyPgm param_2
java MyPgm param_3
simultaneously.
Now how much time will it save ? Should it be ---
(sum of time of running one by one = 3hrs ) / number of processors ?
Thanks,
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,
It depends on where your bottleneck is. If the three processes are all being delayed by the speed of one hard drive, then running them simultaneously is unlikely to change anything. But if they are totally CPU bound, then I think a very rough approximation would be to divide by number of CPUs. I don't think you will get an exact division though.
Also if you only have 2 CPUs, then I dont think you will get all three jobs completed in 1.5 hours. Depending on your OS, you may find that 2 of the processes will be bound to 1 CPU, and 1 to the other CPU, and the OS may not rebind one process when the other one becomes free. So you may find in that case that one process will complete in 1 hour, and the other 2 take 2 hours to complete.
Regards, Andrew
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!