Skip to content

Commit

Permalink
Fix 11-05-2021-Bach1-HillFunction divByZero problem (again)
Browse files Browse the repository at this point in the history
Appears when values are not initialized in param scan
when the sims are running remotely
  • Loading branch information
vcfrmgit committed Jun 6, 2021
1 parent c9bd997 commit ee5f4eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 8 additions & 2 deletions VCell/src/SimTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,13 +765,19 @@ void SimTool::start() {
return;
}
simulation->resolveReferences();
if (numSerialParameterScans == 0 ) { // only do it when not in messaging mode
if (numSerialParameterScans == 0 ) {
// Is Not paramScan, the .fvinput had no SERIAL_SCAN_PARAMETER_... section
start1();
} else if (SimulationMessaging::getInstVar()->getTaskID() >= 0) {
// Is paramScan, the .fvinput had 'SERIAL_SCAN_PARAMETER_...' section
// Is also a remote server (green-button) run , the .fvinput has 'JMS_PARAM_BEGIN' section
// Each paramScan is run as a separate job with serial jobIndex in the 'JMS_PARAM_BEGIN' section
SimulationExpression* sim = (SimulationExpression*)simulation;
sim->setParameterValues(serialScanParameterValues[SimulationMessaging::getInstVar()->getTaskID()]);
sim->setParameterValues(serialScanParameterValues[SimulationMessaging::getInstVar()->getJobIndex()]);
start1();
} else {
// Is paramScan, the .fvinput had SERIAL_SCAN_PARAMETER_... section
// Is also a local (blue-button) run where each paramScan is run in the following loop
SimulationExpression* sim = (SimulationExpression*)simulation;
for (int scan = 0; scan < numSerialParameterScans; scan ++) {
if (scan > 0) {
Expand Down
1 change: 1 addition & 0 deletions VCellMessaging/include/VCELL/SimulationMessaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class SimulationMessaging
return -1;
#endif
}
int getJobIndex();

#ifdef USE_MESSAGING
static SimulationMessaging* create(const char* broker, const char* smqusername, const char* passwd, const char* qname, const char* tname,
Expand Down
8 changes: 8 additions & 0 deletions VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,14 @@ void SimulationMessaging::start() {
#endif
}

int SimulationMessaging::getJobIndex() {
#ifdef USE_MESSAGING
return m_jobIndex;
#else
return 0;
#endif
}


void* startMessagingThread(void* lpParam){
SimulationMessaging::getInstVar()->setupConnection();
Expand Down

0 comments on commit ee5f4eb

Please sign in to comment.