| 10276 | |
| 10277 | |
| 10278 | extern "C" int |
| 10279 | EvalFileWithParameters(Tcl_Interp *interp, |
| 10280 | char *tclStartupFileScript, |
| 10281 | OpenSeesTcl_Parameter *theInputParameters, |
| 10282 | int currentParam, |
| 10283 | int rank, |
| 10284 | int np) |
| 10285 | { |
| 10286 | if (theInputParameters == 0) |
| 10287 | theInputParameters = theParameters; |
| 10288 | |
| 10289 | if (currentParam < numParam) { |
| 10290 | OpenSeesTcl_Parameter *theCurrentParam = theInputParameters; |
| 10291 | OpenSeesTcl_Parameter *theNextParam = theParameters->next; |
| 10292 | char *paramName = theCurrentParam->name; |
| 10293 | paramNames[currentParam] = paramName; |
| 10294 | |
| 10295 | OpenSeesTcl_ParameterValues *theValue = theCurrentParam->values; |
| 10296 | int nextParam = currentParam+1; |
| 10297 | while (theValue != 0) { |
| 10298 | char *paramValue = theValue->value; |
| 10299 | paramValues[currentParam] = paramValue; |
| 10300 | EvalFileWithParameters(interp, |
| 10301 | tclStartupFileScript, |
| 10302 | theNextParam, |
| 10303 | nextParam, |
| 10304 | rank, |
| 10305 | np); |
| 10306 | |
| 10307 | theValue=theValue->next; |
| 10308 | } |
| 10309 | } else { |
| 10310 | |
| 10311 | simulationInfo.start(); |
| 10312 | static int count = 0; |
| 10313 | |
| 10314 | if ((count % np) == rank) { |
| 10315 | Tcl_Eval(interp, "wipe"); |
| 10316 | |
| 10317 | |
| 10318 | for (int i=0; i<numParam; i++) { |
| 10319 | |
| 10320 | Tcl_SetVar(interp, paramNames[i], paramValues[i], TCL_GLOBAL_ONLY); |
| 10321 | |
| 10322 | simulationInfo.addParameter(paramNames[i], paramValues[i]); |
| 10323 | } |
| 10324 | |
| 10325 | count++; |
| 10326 | |
| 10327 | const char *pwd = getInterpPWD(interp); |
| 10328 | simulationInfo.addInputFile(tclStartupFileScript, pwd); |
| 10329 | |
| 10330 | int ok = Tcl_EvalFile(interp, tclStartupFileScript); |
| 10331 | |
| 10332 | simulationInfo.end(); |
| 10333 | |
| 10334 | return ok; |
| 10335 | } |
no test coverage detected