Menu

Commit [r23880]  Maximize  Restore  History

Large increase in speed for model TSMFK01 by changing target functions to use multidimensional numpy arrays in calculation.

This is done by restructuring data into multidimensional arrays of dimension [NE][NS][NM][NO][ND], which are
number of spins, number of magnetic field strength, number of offsets, maximum number of dispersion point.

The speed comes from using numpy ufunc operations.

The new version is 2.4X as fast per spin calculation, and 54X as fast for clustered analysis.

The different in timings for 3 spectrometer frequencies, calculated for 1 spin or 100 clustered spins with 1000 iterations are:

----
VERSION 3.2.2
----
1 spin:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.262 0.262 <string>:1(<module>)
100 spin:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 25.391 25.391 <string>:1(<module>)
----
New version
---

1 spin:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.111 0.111 <string>:1(<module>)
100 spin:
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.468 0.468 <string>:1(<module>)

Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis.

tlinnet 2014-06-12

changed /branches/disp_spin_speed/target_functions/relax_disp.py
/branches/disp_spin_speed/target_functions/relax_disp.py Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.