In article <1732F11C93S85.LOPEZJ@vm.ci.uv.es>, LOPEZJ@vm.ci.uv.es (Jose Agustin Lopez Bueno) writes: >From: LOPEZJ@vm.ci.uv.es (Jose Agustin Lopez Bueno) >Newsgroups: comp.unix.osf.misc >Subject: I need more CPU > >Hello, all. > > I am making a program in Ansi C on Alpha OSF/1 with 32 Mb RAM. >This program is a simulation of biological populations and I need >the most memory and % of processor. This system is used only by me. >But when I launch big programs (many memory) and the system swap to >disk, my % of CPU is minimized (96 % ---> 4 %) (I check this with >syd, a system monitor program). How could I get more % of CPU? I probed >with nice, but dont work much. > > > Thanks you very much for your time� > Agustin > Easy: 0) nice won't do anything. If you're the only user and paging, it is useless. 1) increase the amount of memory (I don't mean VM, but real RAM). You are seeing an execess of paging which is what degrades your CPU performance: it is waiting for the disk all the time. 2) Program a little better. Use locality of reference to ensure that you are accessing your memory in an efficient way, so that you can reduce the need for continuous paging. e.g.: int my_array[15000][15000]; for (i = 0; i < 10000; i++) for (j = 0; j < 10000; j++) my_array[i][j] = compute_something(); is different from for (i = 0; i < 10000; i++) for (j = 0; j < 10000; j++) my_array[j][i] = compute_something(); ^ ^ Depending on how your compiler allocates the arrays, you see a lot of swapping with one method and very little with the other. If I remember it well, the first one was better for C. Look for the properties of your computation that allow you to reduce paging, for example if each element computation is independent: int my_array[BIGSIZE]; for (i = 0; i < NUM_ITERATIONS; i++) process_the_entire_array(my_array); is completelly different from for (i = 0; i < BIGNUM; i++) do_all_iterations_on_element(&my_array[i]); or say, do_all_iterations_on_a_secion_of_the_array(my_array, beg, end); which would do if an element's computation depends on a limited set of neighbours... And more, if your arrays are sparse, you can select better algorithms or special representations that will require much less memory. And so on... If your program can't be optimized in any way to use locality of reference, then go for more RAM memory. But it would be a strange program if you can't rearrange it. 3) Consider running simulations with less elements if possible and later combining the results of the partial simulations. 4) If everything else fails go for an account in a computer with more memory, or in one of the supercomputers of CICA, Santiago, or the Annella in Catalonia. They'll surely be glad to help you. >************************************************************************** >JOSE AGUSTIN LOPEZ BUENO >System Operator >Valencia Univ. Computer Center, Dr.Moliner 50, Burjassot, Valencia, SPAIN >INTERNET: LOPEZJ@vm.ci.uv.es BITNET: LOPEZJ AT EVALUN11 >X400: C=es;A='mensatex';P=iris;O=uv;OU1=ci;OU2=vm;SN=lopezj > >Dep. of Genetics, Fac. of Biology, Dr.Moliner 50, Burjassot,Valencia,SPAIN >INTERNET: LBUENO@evalga.geneti.uv.es >************************************************************************** > Maybe I can help you a bit more. Just write to me directly. jr Jose R. Valverde European Bioinformatics Institute Hinxton. Cambridge U. K. ---- P.D.: Saluda a Andres Moya de mi parte. Gracias.