Skip to content

Commit

Permalink
Only display RT warnings if RT is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Apr 12, 2016
1 parent a35737a commit a17aa0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SimulationRuntime/c/simulation/solver/real_time_sync.c
Expand Up @@ -39,6 +39,12 @@ void omc_real_time_sync_init(threadData_t *threadData, DATA *data)
{
data->real_time_sync.maxLate = INT64_MIN;

omc_real_time_sync_update(data, data->real_time_sync.scaling);

if (data->real_time_sync.enabled == 0) {
return;
}

#if defined(__linux__)
if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) {
warningStreamPrint(LOG_RT, 0, __FILE__ ": mlockall failed (recommended to run as root to lock memory into RAM while doing real-time simulation): %s\n", strerror(errno));
Expand All @@ -48,12 +54,6 @@ void omc_real_time_sync_init(threadData_t *threadData, DATA *data)
warningStreamPrint(LOG_RT, 0, __FILE__ ": sched_setscheduler failed: %s\n", strerror(errno));
}
#endif

omc_real_time_sync_update(data, data->real_time_sync.scaling);

if (data->real_time_sync.enabled == 0) {
return;
}
}

void omc_real_time_sync_update(DATA *data, double scaling)
Expand Down

0 comments on commit a17aa0e

Please sign in to comment.