(misintepreted and not exist) Overhead in ccall due to unsafe_convert of pointers

I’ve found that the performance difference may have nothing to do with ccall. However, I suspect I still have to resort to C for better performance, which is another story and completely off topic.

In case you are interested, the python code is a simple wrapper for a complex C library with many layers of function calls. I’ve found the most important part and translated it into Julia, but I’ve missed a presceening part which quickly returns for some terms. This may be the main reason for performance differences.

offtopic part


But I still have difficulty in translating it into Julia. The most important problem is that I get some trouble in Julia multithreading, as shown in my previous post. (In fact, my user case in this post is exactly the piece of code in that post, despite of some optimization due to symmetry I’ve made recently, and that I’m now calculating larger molecules than the simple water molecule in that post) I’ve finally found a solution in that post, but the solution needs to split the workload into different threads BEFORE actually doing the work.

Since now I need to use the prescreening function to enhance performance, there is no chance that I can split the workload well beforehand. I thus suspect that the load balance of my Julia code will be much worse than the original C code, which I can find no solution.