Skip to content

Commit

Permalink
min message interval 5->30 seconds, data/progress non-persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Mar 13, 2018
1 parent 5f85bed commit 7282ad6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")


if (OPTION_TARGET_MESSAGING)
if (APPLE OR MINGW)
message(FATAL_ERROR "TARGET_SOLVERS_WITH_MESSAGING is not supported on MAC OS X and MINGW")
endif(APPLE OR MINGW)
# if (APPLE OR MINGW)
# message(FATAL_ERROR "TARGET_SOLVERS_WITH_MESSAGING is not supported on MAC OS X and MINGW")
# endif(APPLE OR MINGW)

#don't need graphics for server side solvers
set(OPTION_USE_OPENGL OFF CACHE BOOL "")
Expand Down
11 changes: 6 additions & 5 deletions VCellMessaging/src/SimulationMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ using std::endl;
static const char* TIMETOLIVE_PROPERTY = "JMSTimeToLive";
static const char* DELIVERYMODE_PROPERTY = "JMSDeliveryMode";
static const char* DELIVERYMODE_PERSISTENT_VALUE = "persistent";
static const char* DELIVERYMODE_NONPERSISTENT_VALUE = "nonpersistent";
static const char* PRIORITY_PROPERTY = "JMSPriority";
static const char* PRIORITY_DEFAULT_VALUE = "5";

static const char* MESSAGE_TYPE_PROPERTY = "MessageType";
static const char* MESSAGE_TYPE_WORKEREVENT_VALUE = "WorkerEvent";
static const char* MESSAGE_TYPE_STOPSIMULATION_VALUE = "StopSimulation";

static const char* USERNAME_PROPERTY = "UserName";
static const char* HOSTNAME_PROPERTY = "HostName";
Expand All @@ -37,8 +37,8 @@ static const char* WORKEREVENT_PROGRESS = "WorkerEvent_Progress";
static const char* WORKEREVENT_TIMEPOINT = "WorkerEvent_TimePoint";
static const char* WORKEREVENT_STATUSMSG = "WorkerEvent_StatusMsg";

static const int CONNECTION_RETRY_PERIOD = 10 * ONE_SECOND;
static const int CONNECTION_PING_PERIOD = 30 * ONE_SECOND;
static const double WORKEREVENT_MESSAGE_MIN_TIME_SECONDS = 30.0;

#endif

SimulationMessaging *SimulationMessaging::m_inst = NULL;
Expand Down Expand Up @@ -217,11 +217,12 @@ void SimulationMessaging::sendStatus() {
case JOB_DATA:
ss_url << PRIORITY_PROPERTY << "=" << PRIORITY_DEFAULT_VALUE << "&";
ss_url << TIMETOLIVE_PROPERTY << "=" << m_ttl_lowPriority << "&";
ss_url << DELIVERYMODE_PROPERTY << "=" << DELIVERYMODE_PERSISTENT_VALUE << "&";
ss_url << DELIVERYMODE_PROPERTY << "=" << DELIVERYMODE_NONPERSISTENT_VALUE << "&";
break;
case JOB_PROGRESS:
ss_url << PRIORITY_PROPERTY << "=" << PRIORITY_DEFAULT_VALUE << "&";
ss_url << TIMETOLIVE_PROPERTY << "=" << m_ttl_lowPriority << "&";
ss_url << DELIVERYMODE_PROPERTY << "=" << DELIVERYMODE_NONPERSISTENT_VALUE << "&";
break;
case JOB_STARTING:
ss_url << PRIORITY_PROPERTY << "=" << PRIORITY_DEFAULT_VALUE << "&";
Expand Down Expand Up @@ -351,7 +352,7 @@ void SimulationMessaging::setWorkerEvent(WorkerEvent* arg_workerEvent) {
const int dProgress = arg_workerEvent->progress;
if (dProgress % 25 != 0) {
time_t currTime = time(0);
if (currTime - lastSentEventTime < 5) {
if (difftime(currTime, lastSentEventTime) < WORKEREVENT_MESSAGE_MIN_TIME_SECONDS){
ifset = false;
}
}
Expand Down

0 comments on commit 7282ad6

Please sign in to comment.