Click here to Skip to main content
16,004,507 members

Comments by merano99 (Top 200 by date)

merano99 yesterday View    
+5 A REST API is an uncomplicated and relatively easy to implement with Python.
merano99 5-Aug-24 9:30am View    
Is Moharram Bagheri the same identity as Moharram? If so, why are there two different identities here?
If it is really only about the minimum of f, it would be enough to search for the smallest value in each array.
You don't have to calculate an insane number of combinations in nested slices.
First of all, expand the original question with all the relevant information, or create a new question in which you describe what you intend to do. In addition to the programming language, it would also be helpful to specify which compilers and operating systems are involved.
merano99 4-Aug-24 12:40pm View    
I have recently applied omp collapse on a server with 48 cores to tackle this problem. Since the task finished extremely quickly, I added a counter count in the inner for loop and included it in the reduction clause for verification. Indeed, the count did not show the expected value for N=20. For smaller values of N, however, count produced the expected result and the computation completed swiftly. My conclusion is that something goes wrong with collapse when N=20. I then merged the first two outer loops and set N to 10. The runtime with 48 threads was 400.8 seconds.
merano99 4-Aug-24 8:05am View    
Hello Rick. My guess is that this is only about improving the runtime, not about concrete values. Neither are the arrays initialised, nor is anything actually done with the result in f.
If you switch on the compiler optimisation, the compiler notices that there is nothing to do. See my comment in Solution 4.
I applied OMP to this task and realised that you would need a lot of logical processors for 12 nested loops. From the 8th loop it takes too long to wait on a desktop system with 8 logical processors even with OMP.
In my opinion, the calculation must be distributed to additional computers, unless you have a server with a huge number of logical processors available.
merano99 30-Jul-24 13:17pm View    
Unfortunately, beginners in particular use auto because they assume that the compiler will use the right one. However, the auto data type is not necessarily the problem here. I actually wanted to suggest staying with C at first, as that might be easier for beginners.