IDA Analysis Using OpenSeesMP

This forum is for issues related to parallel processing
and OpenSees using the new interpreters OpenSeesSP and OpenSeesMP

Moderator: selimgunay

Post Reply
Posts: 7
Joined: Fri Nov 25, 2016 11:04 pm

IDA Analysis Using OpenSeesMP

Post by samansadeghii » Wed Nov 30, 2016 1:25 pm


I have a structure and an earthquake record.
I want to analyze my structure under two intensities of earthquake (i=1,2), the first analysis should be done on the first processor (processor id =0) and the second one should be done on the second processor (processor id = 1) simultaneously.

here is my code:

set np [getNP]
set pid [getPID]

set count 0
for {set i 1} {$i<=2} {incr i 1} {
if {[expr $num % $np]==$pid} {


set ScaleFactor [expr $i]
set accelx "Series -dt $dt -filePath earthquake.txt -factor [expr $ScaleFactor*$g]"

pattern UniformExcitation 1 1 -accel $accelx


incr count 1

command for start running in the
mpiexec -np 2 OpenSeesMP code.tcl

But it seems that both processors are running with the same intensity and results are equal.
what is the problem?


Posts: 1
Joined: Wed Apr 29, 2015 10:35 pm
Location: University of Wollongong

Re: IDA Analysis Using OpenSeesMP

Post by JMaguire » Thu Dec 15, 2016 3:07 pm

Hi samansadeghii,

It seems that you have an error in your script. You have given your counter the name of `count`, but when assigning the pid, you used:
``` if {[expr $num % $np]==$pid} { ```

You should change it to:
``` if {[expr $count % $np]==$pid} { ```

This should solve the problem. I could also suggest using a foreach structure (rather than for) similar to this:
set Scalefactors {1 2}

foreach Scalefactor $Scalefactors {
if {[expr $count % $np] == $pid} {
# modelScript
# gravityAnalysis
set accelx "Series -dt $dt -filePath earthquake.txt -factor [expr $ScaleFactor*$g]"
pattern UniformExcitation 1 1 -accel $accelx
# dynamicAnalysis
incr count 1

I think it has the advantage of being easier to read, you can reduce the lines of code (you don't have to set Scalefactor within the loop) and it will be easier to add scalefactors if you decide to in the future.

Hope this can help,

Post Reply