Spinach on Octave

Topics related to Spinach package
Post Reply
faq_user
Posts: 49
Joined: Tue Jul 13, 2021 8:33 am

Spinach on Octave

Post by faq_user »

I'm looking at running Spinach in Octave, which would make it much easier for me to scale out. Do you have any suggestions?

Also, I've found some variances:

examples/esr_solids/deer_gadolinium_3.m
MISSING end TO LOOP for k=1:1000

kernel/spin.m
MISSING end TO FUNCTION spin

kernel/step.m
MISSING OUTER PARENTHESES IN if (size(M,2)>1)&&(~isempty(gcp('nocreate')))

kernel/external/combnk.m
MISSING end TO FUNCTION c

kernel/optimal_control/fminlbfgs.m
NON-UTF-8 CHARACTERS IN "Broyden*Fletcher*Goldfarb*Shanno"
TAB CHARACTERS IN WHITESPACE

kernel/overloads/@ttclass/diag.m
MISSING end TO FUNCTION diag
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

Re: Spinach on Octave

Post by kuprov »

Not possible, that's the quick answer. We use so much of Matlab's advanced functionality that it would never run on Octave.
faq_user
Posts: 49
Joined: Tue Jul 13, 2021 8:33 am

Re: Spinach on Octave

Post by faq_user »

I have it working on Octave, with not too many changes. It's currently single-threaded, and runs deer_3p in a couple of hours with a 16 GB working set.

Since the 3-pules simulation takes less than 10 seconds/orientation, it seems to me that the fastest way to speed up the simulation is to (a) reduce the grid and (b) parallelize over orientations.

Are there simplifying assumptions that would make the individual orientations much smaller or much faster? I preserved the code that truncates the Hamiltonian at spin_system.tols.inter_cutoff and eps.
kuprov
Posts: 201
Joined: Mon Mar 29, 2021 4:26 pm

Re: Spinach on Octave

Post by kuprov »

Wow! I did not think this would be possible -- or I guess didn't know quite enough about the progress Octave seems to have made.

If there was a way to accelerate that DEER further, it would have been implemented in Spinach. :) Unfortunately the grid used is the minimum (you can see that the pattern changes if the grid is reduced) and I am not aware of any general ways to accelerate those simulations further. There are case-specific tweaks one could apply to each individual spin system, and there are various diagonalization-based fast powder averaging tricks, but those do not scale.

Be very careful with the tolerances -- some simulations might go faster if they are loosened, but others would break completely. DNP and relaxation theory are particularly sensitive.
Post Reply