Multi-Threaded SDF Analysis

A previous post showed that, when compared to a couple of brute force approaches, using the sdfResponse command is the most computationally efficient approach to generating an earthquake response spectrum.

During an OpenSees Cafe, Dr. Silvia Mazzoni suggested taking a more intelligent approach by “batching” the brute force SDF analyses. Instead of analyzing one oscillator at a time, create all the oscillators in a single model and shake all the oscillators in a single analysis. Would this multi-threading (shown below) be faster than using the sdfResponse approach from the previous post?

import openseespy.opensees as ops
dTn = 0.02
Tno = dTn
Tnf = 3.0
Tgm = 30.0
ops.node(0,0); ops.fix(0,1)
i = 0
Tn = Tno
while Tn <= Tnf:
    i += 1
    ops.node(i,0); ops.mass(i,1.0) # m = 1
    ops.uniaxialMaterial('Elastic',i,(2*pi/Tn)**2) # k = m*omega**2    
    Tn += dTn
dt = 0.02
N = int(Tgm/dt)

The resulting model is multiple SDF oscillators connected to one base node.

Because the SDFs are uncoupled from each other, this is perhaps the only acceptable use of the Diagonal solver outside of explicit time integration with coupled systems. Also, note that the maximum displacement of each oscillator is dumped to a single file using the -nodeRange option to the EnvelopeNode recorder.

I didn’t make any plots, so you’ll have to take my word for it: the sdfResponse approach generates an elastic response spectrum about 2-3 times faster than the batched SDF approach. Note that the sdfResponse approach was 6-8 times faster than brute force approaches from the previous posts–that is a win in and of itself. Still, the overhead of a proper finite element analysis dominates SDF analysis.

The batched SDF approach is a good idea in many situations though, particularly using nonlinear hysteretic models where the oscillators can do their thing simultaneously or if you have simple (elastic or inelastic) systems that sdfResponse cannot handle, e.g., a two DOF SSI system. However, the drawbacks of “multi-threading” and SDF analysis are 1) the analysis cannot proceed to the next time step until all nonlinear oscillators have reached equilibrium and 2) non-convergence of one nonlinear oscillator will cause the analysis to stop for all oscillators.

One thought on “Multi-Threaded SDF Analysis

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.