wiki:FAQ

Version 25 (modified by dtodd, 10 years ago) (diff)

--

Vespa - Simulation FAQ Page

At the moment, only the Simulation application has been released for beta testing. Thus we have chosen to put all FAQs here at the top level of the project to make them more accessible for users. As all three applications are release, questions specific to each application will be relocated to a FAQ on the application's wiki.


Index

How do I download Vespa?

How do I install Vespa?

Where do I find the Simulation User Manual?

Where can I read more about NMR simulation and processing?

Why does Simulation appear to hang or slow down for large spin systems?

My PYGAMMA Program Is Unstable or Behaves Badly and Yet it Looks Fine?


Questions and Answers

How do I download Vespa?

You can download Vespa from the Downloads page.

How do I install Vespa?

Complete instructions for installing Vespa are on the Installation? page.

Where do I find the Simulation User Manual?

The User Manual documentation for the Simulation application is included in PDF format under the docs/ directory in the package that you downloaded. It can also be accessed directly here.

Where can I read more about NMR simulation and processing?

Here is a list of references for spectral simulation and processing?

Why does Simulation appear to hang or slow down for large spin systems?

When doing calculations with a spin of 8,9, or 10, your system may appear to slow down or even hang. A likely explanation is that for larger spins it take a much longer time for the spectral calculations in the underlying GAMMA package. For example, at a spin count of 7, a single FID experiment takes GAMMA 0.4 seconds, but at spin 10 it takes 1 hour and 24 minutes (on a 2.66 GHz Intel machine). Here is a list of GAMMA timing results for various spin sizes. The "slow down" may be compounded if doing a large number of individual simulations for different timings, or spacial locations.

Note: The time it takes to run these specific jobs is virtually identical in GAMMA versus Simulation - as there is little overhead (e.g. converting arrays between python and C++) when compared to the overall time of the calculations.

My PYGAMMA Program Is Unstable or Behaves Badly and Yet it Looks Fine?

Under certain circumstances your pyGamma code can be written in perfectly good Python style yet give unpredictable errors (or no error at all).

We created pyGamma by applying SWIG to GAMMA. In this treatment we did not apply any special code for handling return values that are pointers or references. This has caused non-pythonic behavior to be observed in some situations.

If you have written code that involves subroutines, like this pseudocode,

import pygamma as pg

def binning()
   # do something interesting
   pass

def my_pulse_sequence()
    sys = pg.spin_system()
    # do something else interesting
    ACQ = pg.acquire1D(pygamma.gen_op(D), H, 0.000001)
    mx = ACQ.table(sigma0)
    return mx

mxa = my_pulse_sequence()

# About to have a problem...
binning(mxa, field, spin_count)

then you are at risk of having one of a number of problems.

This is because mxa points to a an object that is contained within another object that has been made available for deletion. In this example we are returning a transition table (TTable1D), which is an object that is contained within ACQ (an acquire1D object). The ACQ object will be released at the end of my_pulse_function() and therefore so will mx. When you try to use the return value, in this case mxa, in some other process (e.g. binning(mxa,...)), the behavior is unpredictable and usually bad.

So far in our research we have see this situation cause these errors:

  • Segfault
  • Bus Errors
  • Pointers to uninitialized data
  • An error box saying something bad happened
  • Pointer to the correct value with no notification that it may not be valid the next time you look

We list here a detailed description of the problem and suggest some simple work arounds.