It can, when the next version of the compiler decides it wants that symbol for its own purposes.Quote:
Does it lead to trouble
I used the mypowf function, but my program became slower.
I did not use "-ffast-math", as I did not know how. I am not a progammer, just an by exident scientist (not even that in my real live)
It is likely to run slower if you don't use -ffast-math. When you compile your code with gcc, you give it options, one of those would be -ffast-math - that will take some short cuts, but it's only really relevant when working in corner-cases - such as dealing with infinity as an input or result. For the use you have, -ffast-math should give the exact same result.
I had already figured you weren't a proficient programmer - the code is not that good [just like you would probably spot something similar if I started discussing economics, trading and such].
I tried to find it out myself, but how do I put compiler -ffast-math flags with gcc / code::Blocks?
I implemented the memcp, and its faster now!
Many thanks for the help and effort put.
At least, that's how I interpreted your question. The others seem to have interpreted it in terms of optimization. Thought I'd give an answer orthogonal to those.
...and to do that, use the command "nice" ("man nice" for details).Quote:
...you can adjust its priority to make it more "attractive" to the scheduler, which will cause it to be scheduled more often.
And it's only of use if there actually is a less important application stealing CPU time. It won't make your program run faster.
In other words, if your total CPU usage isn't at 100%, nice isn't going to help, since there is CPU power available; the program just doesn't use it.
No one said the program would run faster, it was only said it would be less interrupted (scheduled more often & longer) which was one of the OP requests.Quote:
It won't make your program run faster.
Any reference about that? because as far as I know it does modify the scheduling policy of the process, the only 'unknown' parameter being when the new policy is applied (depending on the process current state).Quote:
if your total CPU usage isn't at 100%, nice isn't going to help, since there is CPU power available;
The program has no choice, this is managed by the O/S.Quote:
the program just doesn't use it.
The system will always attempt to use the CPU to 100% - only if there is no runnable task will it be lower than that. nice does not change what happens to a process that is sleeping because it's waiting for data from the disk, for example.
In this case, the application will use as much CPU-time as it can (it is doing some disk IO at the start and end, but it's marginal in the overall runtime). Unless there are other tasks running on the same machine, there will be little or no benefit from using nice.
I investigated the pow thing further. It appears that even using -ffast-math it is slower. I suppose the reason is that I use x<1 e.G. mypow(15,0.25) as exponents.
The other things work well. Thank you.