LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   how to speed up program? (https://www.linuxquestions.org/questions/linux-server-73/how-to-speed-up-program-766377/)

abhattacharya 11-02-2009 11:18 PM

how to speed up program?
 
Hello everybody,
i have a linux server. specification is as follows:


Form factor/height Tower/5U
Processor (max) Quad-Core Intel® Xeon Processor E5430 up
to 2.66 GHz and up to 1333 MHz front-side
bus
Number of processors (std/max) 4
L2 cache 2x6 MB (dual-core) or 2x12 MB (quad-core)
Memory1(std/max) 4 GB Fully Buffered DIMM 667 MHz
via 8 DIMM slots
Expansion slots 3 PCI-Express, 2 PCI-X and 1 PCI
Disk bays (total/hot-swap) 4/0 or 8/8 (model dependent)
Maximum internal storage 1, 2 6.0 TB hot-swap SATA, 2.4 TB hot-swap SAS, or 3.0 TB simple-swap SATA
Network interface Integrated Gigabit Ethernet
Power supply (std/max) 670W 1/1 or 835W 1/2
Hot-swap components Power supply, fans and hard disk drives
RAID support Integrated RAID-0/-1/-10, optional RAID-5


Operating system installed: Fedora 9 x86_64

I wanted to know that when i run only one program on this machine one of its four processor is used. To use all the processor i have to run 4 programs. Is it possible that for one program the process is distributed in all the 4 processor simultaneously so that the total time reduces. If it is possible then please tell me how should i do that? I mean i want parallel processing of all the processor to get faster results.


Thanx in advance

raskin 11-02-2009 11:50 PM

If you run program, nobody can be sure which parts assume that they are run sequentially. Some programs are already split into parallel exuction units (sometimes threads, sometimes processes) - this is especially true for server programs like Apache. If the program is not prepared to be run by multiple processors - there is nothing you can do. For servers it is usually not relevant anyway.

chrism01 11-03-2009 01:15 AM

Just to point out that F9 is officially obsolete; current vers F10, F11. NB: F12 is due out soon, which means F10 will be come obsolete (no more updates).

salasi 11-04-2009 03:36 AM

Quote:

Originally Posted by abhattacharya (Post 3742140)
Is it possible that for one program the process is distributed in all the 4 processor simultaneously so that the total time reduces.

Well, if you, or someone else, can re-write the program in a parallizeable form (and don't take this as a trivial problem, because, in ther general case, it is anything but), then you should be able to run that form in parallel.

Otherwise, the problem is that you can't parallize the program.

johnsfine 11-04-2009 08:07 AM

Quote:

Originally Posted by abhattacharya (Post 3742140)
i have a linux server. specification is as follows:

Why are there two different choices for many of the details? Have you not yet purchased it and still have some choices?

If you are considering a new system and care a lot about performance, why is the ram 667MHz? Is this a Dell system (they tend to select slow ram, especially when selling you ECC, which I think is a bad idea)?

Quote:

I wanted to know that when i run only one program on this machine one of its four processor is used.
Have you tried it (are you asking or telling us that only one core is used)?

Quote:

Is it possible that for one program the process is distributed in all the 4 processor simultaneously so that the total time reduces.
Programs can be written such that one program can use multiple processors. Those are called multi threaded programs.

Depending on the algorithms needed inside the program, it might be a simple task for a programmer to convert a single threaded version to multi threaded or it might be nearly impossible or anywhere in between.

Depending on the algorithms needed inside the program, making the program multi threaded might greatly reduce the total time, or the multiple threads might contend so badly for the shared L2 cache and/or shared front side bus and shared slow ram that the multi threaded version takes more total time (each thread runs more than four times slower than it would alone).

If the multi threaded version runs slow having a larger L2 cache might break the contention (for ram as well as for L2 itself) and make the multi threading run dramatically faster. Or it might do nothing. That is hard to predict before trying it.

If the multi threaded version runs slow, faster ram will speed it up but at most by the factor that the ram itself is faster.

abhattacharya 11-04-2009 11:45 PM

Quote:

Originally Posted by johnsfine (Post 3744170)
Why are there two different choices for many of the details? Have you not yet purchased it and still have some choices?

If you are considering a new system and care a lot about performance, why is the ram 667MHz? Is this a Dell system (they tend to select slow ram, especially when selling you ECC, which I think is a bad idea)?

I already bought the server. The specification given here is just copied from IBM site. The actual RAM in my machine is 4GB.


Quote:

Originally Posted by johnsfine (Post 3744170)
Have you tried it (are you asking or telling us that only one core is used)?

Yes i have tried it and i see that for a single program only 1 processor is running and if i run four simultaneous program then only all the processor start working.


Quote:

Originally Posted by johnsfine (Post 3744170)
Programs can be written such that one program can use multiple processors. Those are called multi threaded programs.

Depending on the algorithms needed inside the program, it might be a simple task for a programmer to convert a single threaded version to multi threaded or it might be nearly impossible or anywhere in between.

Depending on the algorithms needed inside the program, making the program multi threaded might greatly reduce the total time, or the multiple threads might contend so badly for the shared L2 cache and/or shared front side bus and shared slow ram that the multi threaded version takes more total time (each thread runs more than four times slower than it would alone).

If the multi threaded version runs slow having a larger L2 cache might break the contention (for ram as well as for L2 itself) and make the multi threading run dramatically faster. Or it might do nothing. That is hard to predict before trying it.

If the multi threaded version runs slow, faster ram will speed it up but at most by the factor that the ram itself is faster.


Please consider my ignorance and suggest me how to write a program in multi thread. I use to write program in fortran 77....can i do that in fortran? if yes then how?


anyway Thanks a lot for your quick reply......

GrapefruiTgirl 11-05-2009 11:30 PM

Quote:

Originally Posted by abhattacharya (Post 3745247)
...
Please consider my ignorance and suggest me how to write a program in multi thread. I use to write program in fortran 77....can i do that in fortran? if yes then how?

anyway Thanks a lot for your quick reply......

Hi there!

Please allow me to suggest that if you plan to engage in further discussion of how to write a multi-threaded program in Fortran (or any other language, for that matter) kindly start a new thread in the "Programming" forum, as such a topic would not really belong in the "Server" forum; plus, you would get better exposure to other programmers, in the "Programming" forum. If you wish, you could leave a link here, directing interested people to your new thread once it's created (probably a good idea).

Kind regards,

Sasha


All times are GMT -5. The time now is 06:32 AM.