-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue on MacOS-10.13 #69
Comments
Following up on this issue - can someone please provide some guidance? Should I expect slow performance when installing FF++ on Mac using the binary package? Thanks |
You are comparing apples and oranges here. What are you exactly interested in: performance of your loops in the .edp, or in the .cpp? My general advice is to do as little as possible in your .edp, and offload as much computation as possible in your .cpp. |
I know diff of speed between windows and unix (mac and linux) |
Thank you for the advice. I have been trying to couple my code with a c++ script, following the Dynamical Link example in Appendix C of the FF++ doc. I assume this will allow me to use a .edp script to call upon a (much faster) precompiled c++ script for mesh node calculations. To learn, I wish to replicate the myfunction example from the doc., by compiling/linking myfunction.cpp myself (using the ff-c++, g++ commands in the doc). I found myfunction.cpp from some source code, along with ff++.hpp and dependencies (they are not included in the binary installation). I can compile and link myfunction.cpp without error, but I get the following error when executing load.edp:
I suspect that I made a mistake when coordinating the ff++.hpp file and all its dependencies. Do you have a working example (with all the necessary files) of how to compile and link a c++ file to be called in FF++? Once I can recreate a working example, I think moving all heavy computation from my .edp to a c++ script will be trivial. Thank you, |
Using |
Hello,
I am a long-time FF++ user (developing .edp scripts to model solid mechanics problems), and I just installed FreeFem++ on a new MacOS-10.13. I am noticing a strange performance issue on my Mac compared to my old Windows7 PC, and my troubleshooting attempts are below. Note that I have installed FreeFem++ v3.61-1 on both Mac and Windows using the respective binary packages, and these troubleshooting attempts are all executed in serial.
When I run a .edp script that computes a simple addition problem 1e6 times (speed_test.edp below), the execution time is almost 3 seconds on my Mac, while on my Windows7 computer, execution is 0.1 seconds. Much much slower on my Mac.
When I compile and run a C++ script with the same purpose (simple addition 1e6 times), the execution time is 0.004 seconds on my Mac, and 0.01 seconds on my Windows PC. Much faster on my Mac.
When I run a .edp script that re-computes a varf on a 100x100 mesh 1e4 times (ts.edp below), execution time is ~45 seconds on my Mac, and ~55 seconds on my Windows PC. If I reduce the mesh size to 25x25, and run the same varf calculation 1e4 times, execution time is ~3.5 sec on my Mac and ~4.0 sec on my Windows PC. A bit faster on my Mac. (I found this script on a previous FF++ forum, and altered slightly to test performance)
Basically, execution is faster on my Mac when using the C++ loop script and the FF++ mesh varf script, as expected. However, when accomplishing simple addition, the Mac is remarkably slower than my Windows PC. My solid mechanics scripts use many looped calculations, and as a result their performance on my Mac is quite poor.
Note my Mac CPU is 6-core Intel Xeon E5, 3.5 GHz, 16 GB memory. My Windows CPU is 4-core Intel i7, 2.7 GHz, 8 GB memory. I should also point out that I installed FreeFem++ on a friend’s Mac (similar specs), using binary installation, and found the same performance issue.
Is there a way I can specify compilers, optimization flags, etc. within the FreeFem++ executable, to enhance performance? Do I need to install FreeFem++ from scratch using the compilation files to achieve good performance on a Mac? I have not found other FF++ forum posts discussing this problem, so my problem seems very strange.
Please let me know if you have any suggestions, or need further information.
Thanks,
Nathan
The text was updated successfully, but these errors were encountered: