Problem about "sfepy.mesh.mesh_tools.smooth_mesh" module for large datasets
Hi everyone,
I have a problem about "sfepy.mesh.mesh_tools.smooth_mesh" module, when it comes to large data size, the running time is very long. I have a model with about 300,000 cells, now already taken more than 10 hours, but still not finished yet.
So I wonder, if anyone has experience know the some tricks to make it running faster?
Thanks for your time. BR, Xiaogai
Hi!
On 04/26/2012 10:59 AM, Xiaogai Li wrote:
Hi everyone,
I have a problem about "sfepy.mesh.mesh_tools.smooth_mesh" module, when it comes to large data size, the running time is very long. I have a model with about 300,000 cells, now already taken more than 10 hours, but still not finished yet.
This code was written by Vladimir, so take my advice with a grain of salt: There are several Python for-loops, one e.g. in get_volume() function, which contains a python for-loop over all elements. Did you run the code with volume_corr=True? If yes, try setting it to False. Then there is a loop over edges (line 531), which could be avoided by setting weights=None.
So I wonder, if anyone has experience know the some tricks to make it running faster?
If the above does not help and/or you need to use the options, I do not know how to speed it up, apart from writing the loops in Cython. But I do not understand that code, so there might be room for improvements on the Python side as well.
Anyway, it would help us to know which parts of the function take most of the time - could you run it on a smaller mesh and provide some timings? Using time.clock() will do, or try [1]...
Thanks, r.
Hi! Thanks a lot for your suggestions. I will try and let you know the results later. BR, Li
On Thu, Apr 26, 2012 at 11:30 AM, Robert Cimrman <cimr...@ntc.zcu.cz>wrote:
Hi!
On 04/26/2012 10:59 AM, Xiaogai Li wrote:
Hi everyone,
I have a problem about "sfepy.mesh.mesh_tools.smooth_**mesh" module, when it comes to large data size, the running time is very long. I have a model with about 300,000 cells, now already taken more than 10 hours, but still not finished yet.
This code was written by Vladimir, so take my advice with a grain of salt: There are several Python for-loops, one e.g. in get_volume() function, which contains a python for-loop over all elements. Did you run the code with volume_corr=True? If yes, try setting it to False. Then there is a loop over edges (line 531), which could be avoided by setting weights=None.
So I wonder, if anyone has experience know the some tricks to make it
running faster?
If the above does not help and/or you need to use the options, I do not know how to speed it up, apart from writing the loops in Cython. But I do not understand that code, so there might be room for improvements on the Python side as well.
Anyway, it would help us to know which parts of the function take most of the time - could you run it on a smaller mesh and provide some timings? Using time.clock() will do, or try [1]...
Thanks, r.
[1] http://packages.python.org/**line_profiler/<http://packages.python.org/line_profiler/>
-- You received this message because you are subscribed to the Google Groups "sfepy-devel" group. To post to this group, send email to sfepy...@googlegroups.com. To unsubscribe from this group, send email to sfepy-devel+unsubscribe@** googlegroups.com <sfepy-devel%...@googlegroups.com>. For more options, visit this group at http://groups.google.com/** group/sfepy-devel?hl=en <http://groups.google.com/group/sfepy-devel?hl=en> .
participants (2)
-
Robert Cimrman
-
Xiaogai Li