Simple Parameter Study: Difference between revisions

From OpenSeesWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
__NOTOC__
__NOTOC__
This example is intended for use with the OpenSeesMP interpreter. It performs a seqries of sequential analysis in parallel. The things of importance in the model are shown in the main script. These are:
This example is intended for use with the OpenSeesMP interpreter. It performs a series of sequential analysis in parallel. The things of importance in the model are shown in the main script. These are:
1) the use of for loops and variables to assign unique jobs to the individual processors.
1) the use of for loops and variables to assign unique jobs to the individual processors.
2) the use of unique names for the output files from the recorders.
2) the use of unique names for the output files from the recorders.

Latest revision as of 18:08, 22 February 2012

This example is intended for use with the OpenSeesMP interpreter. It performs a series of sequential analysis in parallel. The things of importance in the model are shown in the main script. These are: 1) the use of for loops and variables to assign unique jobs to the individual processors. 2) the use of unique names for the output files from the recorders. 3) clean up of any extra files that are generated but not needed.

The model and analysis are of little importance to the parallel processing knowledge this article is trying to get across and so are not included. They could be any model and any analysis.

The following is the main script set. This script is run by each of the interpreters when the user starts the parallel computation.


set pid [getPID]
set numP  [getNP]
set count 0;

source ReadRecord.tcl
set g 386.4

foreach scaleFactor {0.5 0.75 1.0 1.5 2.0} {
   foreach gMotion [glob -nocomplain -directory ./ *.AT2] {

     if {[expr $count % $numP] == $pid}  {

        source model.tcl
        source analysis.tcl

        set ok [doGravity]

        loadConst -time 0.0

        if {$ok == 0} {
            set gMotionName [string range $gMotion 0 end-4]
            ReadRecord $gMotion $gMotionName$scaleFactor.dat dT nPts

            timeSeries Path 1 -filePath $gMotionName$scaleFactor.dat -dT $dT -factor [expr $g*$scaleFactor]

            recorder EnvelopeNode -file $gMotionName$scaleFactor.out -node 100 -dof 1
            doDynamic $dT $nPts

            file delete $gMotionName$scaleFactor.dat
        }
     }
     incr count 1
   }
}