Commit Graph

411 Commits

Author SHA1 Message Date
Derek Bankieris
27bf0b030b Dequeue timed-out runs if the slave later returns
Fixes #569
2018-02-28 14:13:05 -06:00
Derek Bankieris
8bdcd28631 Don't use TRICK_HOST_CPU in MonteCarlo SHH command
Fixes #564
2018-02-27 09:38:12 -06:00
Alex Lin
0936cee67e Separate verbosity levels for Monte Carlo dispatches and parametrizations #548
Changed verbosity check from INFORMATIONAL to ALL as requested.
2018-02-20 09:56:14 -06:00
Alex Lin
15bfd75b32 Don't resize active event array size with every operation #562
Started the active event allocation at 100 events.  If more are needed, we
add 100 allocations each time.  The array is never reduced in size if
events are deleted, events are moved to the front of the array and the
remaining elements are set to NULL.
2018-02-14 17:28:21 -06:00
Alex Lin
bc8d1a3796 The total overruns printout at sim exit prints the wrong parameter. #560
Changed the printout to print the total number of overruns.
2018-02-08 16:18:11 -06:00
Pappy Van Winkle
d7e8d48a8a Creating additional C-interface routines for UnitTest. #511 2018-02-03 19:56:08 -06:00
Alex Lin
8f76605f3b Create Message client that writes to screen on a separate thread #553
Created a new message class that will copy incoming messages to a
buffer area.  The buffer area is pre allocated during simulation
initialization.  On a separate thread the buffer area is written
to std::cout.
2018-01-25 15:59:19 -06:00
Alex Lin
c4b872c26e Don't start or wait for disabled threads in the executive #549
Added check to see if thread is enabled when starting it and waiting
for it to finish.  If it is disabled, skip it.
2018-01-23 09:37:02 -06:00
Alex Lin
12c7dbd4cf Trick's new variable server address is hard to debug if you don't know it changed #546
Created a second multicast socket to broadcast the sims variable server information
on the old address.
2018-01-19 16:49:08 -06:00
Alex Lin
d4ffa4002b Add NULL pointer check to remove_event. #545
Added the NULL pointer check and return immediately if the pointer is NULL.
2018-01-18 13:23:38 -06:00
Nick Kapliev
c8619dbea7 Fixed MonteCarlo EOF problem. #459 (#531)
* Added tests for MonteCarlo varfile eof line problem

* Remove redundant variables in MonteCarlo varfile test

* Fixed MonteCarlo varfile eof line problem. #459
2017-12-13 12:01:31 -06:00
Christopher LaChance
6184aa6cd9
Some unit test warnings addressed. (#515)
* Removed purple warnings from unit test compilation.

* "Fixed const corectness bug. Added more warning fixes."

* Fixed warning issue.

* Removed null checking and (char*) casting.

* Changed sizeof parameter to variable from data structure.
2017-11-29 15:35:16 -06:00
Christopher LaChance
0e772525c7 Fixed the MC 'file failed to open' error. 2017-11-22 12:51:34 -06:00
Christopher LaChance
21e3804638 Removed outdated MonteVarFile exception unit test. 2017-11-02 11:40:28 -05:00
Christopher LaChance
5ea826c67b Modified unit test to account for new logic. 2017-11-01 09:00:59 -05:00
Christopher LaChance
a68ea46f14
Fixed issue with open file being reopened. 2017-10-31 13:56:04 -05:00
Christopher LaChance
cf75a15be8 Removed redundant checks and this-> keywords. 2017-10-31 13:17:14 -05:00
Christopher LaChance
0dbdc2d7b9 Changed streampos comparison from NULL to 0. 2017-10-31 10:02:10 -05:00
Christopher LaChance
0a90c11541 Implemented a fix for multiple concurrent file handles. 2017-10-27 14:35:54 -05:00
Alex Lin
6271283c31 Revert Trick::Clock::clock_spin shouldn't call RELEASE() #489
Added a stub exec_get_rt_nap function in the test directory that
always returns false.  That is the cleanest way to satisfy the
call for the unit tests.
2017-10-20 15:03:31 -05:00
Christopher LaChance
c8f916e818 Merge pull request #488 from nasa/NonNumericValues
Non-numerical values can now be used in Monte Carlo data files.
2017-10-17 08:40:29 -05:00
Christopher LaChance
db4e0dd024 Returned brace style to K&R at John's behest. 2017-10-16 14:03:48 -05:00
Christopher LaChance
f81d7b0c16 Swapped line read in to std::getline(). 2017-10-16 12:56:45 -05:00
Alex Lin
56ddfab6a5 Revert Trick::Clock::clock_spin shouldn't call RELEASE() #489
Reverting change, adding back RELEASE call in clock_spin loop.
2017-10-16 10:39:31 -05:00
Christopher LaChance
ebe4174b5c Converted data file traversal from strtold to strtok. 2017-10-12 10:00:54 -05:00
Christopher LaChance
24894ea08a Merge pull request #487 from nasa/VariableInformation
Added additional variable information to the Monte_Runs data file.
2017-10-11 09:48:42 -05:00
Christopher LaChance
1efedefdf7 Added additional variable information to the Monte_Runs data file. 2017-10-10 11:12:33 -05:00
Alex Lin
8aa8f31e3d Frame logging for child threads not working. #484
Prepended "trick_" to the frame scheduled time variable name.
2017-10-06 10:22:38 -05:00
John M. Penn
db2f00cc4e Changed 'git' to 'trick-gte'. Ref #475 2017-09-13 14:46:28 -05:00
Thadeus Fleming
bf2759c5c0 Remove deprecated dynamic exception specifiers.
Resolves #461
2017-07-28 20:49:42 -05:00
John M. Penn
841473583c Updated var server multicast address to 239.3.14.15. Ref #452 2017-07-05 16:40:22 -05:00
John M. Penn
d0b9cda9f2 Fixed variable server debug messages. Ref #447 2017-06-26 17:50:54 -05:00
Christopher LaChance
345971e31a Replaced socket_init calls with tc_init.
Some classes were still calling socket_init which had been removed. Replaced those calls with tc_init.

Make compiled and make test successfully ran all tests. Jenkins should be happy now.
2017-06-21 08:59:22 -05:00
Christopher LaChance
34cc3ae8e5 Removed default_port_flag and socket_init. 2017-06-16 15:20:04 -05:00
Derek Bankieris
39aef15a8e Infer TRICK_HOME automatically
Refs #358
2017-06-02 13:37:28 -05:00
John M. Penn
2edd7b986d Add include of errno.h to MonteVarFile.cpp. Ref #431 2017-05-22 14:07:25 -05:00
John M. Penn
d7e3aa4b5c Make failed ifstream error message more informative. Ref#431 2017-05-22 13:47:25 -05:00
Alex Lin
dce161ad94 Suppress units conversion messages in input file. #414
Added a routine to shoot_the_units_conversion_messenger.
2017-04-20 11:34:50 -05:00
John M. Penn
9a5bbb160a Get rid of yyset_lineno in the parsers. Ref #404 2017-03-30 19:53:33 -05:00
John M. Penn
56ce1c75cc Fix yyset_out, yyset_lineno calls and remove yyset_in calls in parsers. Ref #404 2017-03-30 16:14:28 -05:00
John M. Penn
a7039aea61 Create va_list versions of Integrator state load and unload member functions. Ref #401 2017-03-28 17:55:27 -05:00
Derek Bankieris
2335f6bb69 Correct Monte Carlo compiler error on CentOS 7
Also change the Cannon sim monte_post jobs to use mc_read/write instead
of tc_read/write

Refs #396
2017-03-24 08:11:32 -05:00
Derek Bankieris
80ab0767e2 Combine command and data sockets in Monte Carlo
Refs #396
2017-03-23 12:22:40 -05:00
Derek Bankieris
17a5028e43 Infer TRICK_HOME automatically
Refs #358
2017-03-21 10:24:02 -05:00
Derek Bankieris
47847a8aef Add ability to pass options to slave sims
Refs #395
2017-03-20 10:46:10 -05:00
Alex Lin
2450f51781 Add name of parameter to error message coming out of MemoryManager_restrore_stls #382
Printing the name now.
2017-02-15 09:00:34 -06:00
Derek Bankieris
4146b440b8 Make trick (Python package) a namespace package
Namespace packages are a mechanism for splitting a single Python
package across multiple directories on disk. With the addition of
$(TRICK_HOME)/pymods/trick, there now exists a package named 'trick' at
$(TRICK_HOME)/pymods and in each SIM_* directory. This change allows sims
to import modules from both locations.

Refs #365
2017-01-20 10:30:21 -06:00
Derek Bankieris
a6b68bb101 Infer TRICK_HOME automatically
Refs #358
2017-01-20 09:39:04 -06:00
Alex Lin
008337e69b Monte Carlo dry runs produce monte_input files #318
The input file that is created while running monte carlo runs is done
in 3 different places.  There was no easy way to collect all of those
lines in one place, so I duplicated the lines in the dryrun function.
2017-01-12 16:52:05 -06:00
Alex Lin
2c93f2ac75 Improve error handling when duplicate variable added to a DRHDF5 #353
Added a printout that shows the logging group and variable name that
had a problem when trying to add to the HDF5 recording.
2017-01-12 08:44:30 -06:00
Alex Lin
4b28951c1c When doing input file verification the exit code is always 1. #335
After doing verification of the input file we return the exit code
of the python processor.
2017-01-11 17:40:05 -06:00
Alex Lin
0197df7103 Test output xml does not validate. #372
Removed the parent attribute.
2017-01-09 09:52:48 -06:00
Alex Lin
a831cbfaa8 Merge pull request #366 from iamthad/use_stderr
Use std::cerr instead of std::cout for error messages
2016-12-20 15:02:23 -06:00
Derek Bankieris
7a08829d3d Introduce makefile variable TRICK_SYSTEM_LDFLAGS
Like other TRICK_SYSTEM variables, users should not modify this.

This renders TRICK_LDFLAGS and TRICK_USER_LINK_LIBS redundant. While we
would like to eventually remove TRICK_USER_LINK_LIBS, it's not likely to
ever actually happen.

Refs #369
2016-12-14 12:36:21 -06:00
Derek Bankieris
76f6a003b3 Add -std=c++11 to VariableServer Makefile
Refs #367
2016-12-14 10:06:01 -06:00
Derek Bankieris
634d561567 Fix VariableServerThread::var_units
Refs #367
2016-12-14 09:43:55 -06:00
Derek Bankieris
2c9181a896 Infer TRICK_HOME automatically
Refs #358
2016-12-13 15:29:15 -06:00
Thadeus Fleming
fb1925e0d8 Use std::cerr instead of std::cout for error messages 2016-12-10 11:49:44 -06:00
Derek Bankieris
d72a09fef7 Add ability to clear all variables from a DR group
Don't let "sys.exec.out.time" be removed

Refs #350
2016-11-29 13:38:32 -06:00
Derek Bankieris
d859ac8453 Add funciton to remove all data record groups
Refs #350
2016-11-29 11:47:10 -06:00
Derek Bankieris
ac3360e87f Add ability to remove variable from data recording
For the record, I'd like to point out that many of the DataRecordGroup
functions shouldn't be called after init, but we don't prevent anyone
from doing so. Bad Trick!

Refs #350
2016-11-18 08:53:24 -06:00
Michael Vetter
18f0d7e871 Remove trailing whitespaces
Makes it easier to edit the files. So if we press 'end of line' we are
really at the end of line.
2016-11-08 10:25:07 +01:00
John M. Penn
1f75034da2 Merge branch 'master' of https://github.com/nasa/trick 2016-11-02 14:22:08 -05:00
John M. Penn
99c8b11709 Fix a memory leak in VariableServerThread_commands. Ref #333 2016-11-02 14:12:31 -05:00
Alex Lin
d875f837f2 ICG produces non-compilable io_* code for this weird example #334
When saving the list of namespaces and classes a particular type is contained in
we have to save the class name and any template args it includes separately.  This
allows us to mangle the names easier.  And we now search for type names to see
if they follow this pattern template_name<template_args>::embedded_class.  If
we are using a template embedded class we need to create attributes for the embedded class.
2016-11-02 13:56:40 -05:00
Derek Bankieris
5484e39f11 Fix spacing in warning message 2016-10-21 10:50:11 -05:00
Derek Bankieris
4f49460a6f Clean up io_* code #330 2016-10-20 14:55:00 -05:00
Derek Bankieris
f161ddb18c Made everything about Trick's build process better 2016-10-06 13:54:06 -05:00
Dan D. Jordan
9e0f0ba85a Added MonteVar setters where appropriate
Added set_unit mechanism to MonteVar baseclass. Added MonteVar's derived
classes setters where appropriate to facilitate changing inputs after
the instance of MonteVar has already been constructed. Fleshed out
MonteVarFile destructor to remove memory leaks.
2016-10-03 14:57:11 -05:00
Alex Lin
5c117bcfe3 python3 execution of standalone monte_input #314
In the monte carlo input files I added a test for python 2/3.  If we are 3 run
exec(open("file").read()), else run execfile("file")
2016-09-26 09:26:43 -05:00
Derek Bankieris
ba59606b1d Added TRICK_PYTHON_PATH environment variable #313 2016-09-16 09:20:11 -05:00
Alex Lin
b88ff45f94 Bad units specification [dB] #312
Added a conversion of [dB] to [1] for use in udunits.
2016-09-15 15:24:19 -05:00
Dan D. Jordan
70a4ad9e24 Fixed indexing problem when reducing number of monte carlo runs
When runs reduced via successive calls to set_num_runs, instead of using
pop_front() and front(), use pop_back() and back()

Refs #304
2016-09-08 13:53:44 -05:00
Alex Lin
3be6715eba Merge tag '17.0.3'
Adding check for NULL char pointer before converting to string.
2016-09-06 13:58:54 -05:00
Alex Lin
c4a32600cc Trick View: Can't set variables with -- units #301
Test before trying to convert NULL char * to string.
2016-09-06 13:53:37 -05:00
Alex Lin
eaa6f796d9 Merge tag '17.0.3'
Converting units incoming from the variable server.
2016-09-06 13:22:09 -05:00
Alex Lin
b32015a1ad Trick View: Can't set variables with -- units #301
Called map_trick_units_to_udunits to convert incoming units to udunits.
2016-09-06 13:15:36 -05:00
John Penn
753d821329 Fix compilers warnings. Ref #300 2016-09-02 17:01:07 -05:00
Alex Lin
066554b2f7 Merge pull request #297 from ddj116/get_variable
MonteCarlo add_variable duplicate protection and get_variable functionality
2016-08-30 11:00:16 -05:00
Alex Lin
fa4664c4ea Move the loop that waits for scheduled threads to finish out of advance_sim_time #292
2 problems found.  Syncing scheduled threads was not happening at all because the job
was not being rescheduled.  Did not want to deal with changing job call times so I
called the new scheuduled_thread_sync routine from advance_sim_time.  That's where
it started, it'll be fine.

Also found that I was resetting job complete flags too aggressively.  The check to
test if the thread is ready to run was missing.  Added that check back in.
2016-08-30 10:56:18 -05:00
Dan D. Jordan
fdd442ba68 Added duplicate name protection on add_variable and get_variable
mechanism for getting MonteVar * derived types so that those dispersion
settings can be changed once they go out of scope.
2016-08-30 09:48:10 -05:00
Alex Lin
e3759ac594 Move the loop that waits for scheduled threads to finish out of advance_sim_time #292
When we moved the thread sync code, a loop to clear all job complete flags was left out
causing unit test errors.
2016-08-29 08:42:53 -05:00
Alex Lin
aeeaa7b3bc Move the loop that waits for scheduled threads to finish out of advance_sim_time #292
Forgot to introduce the new function.
2016-08-26 09:10:44 -05:00
Alex Lin
7c57c1d02d Move the loop that waits for scheduled threads to finish out of advance_sim_time #292
Created a new executive job that waits for the scheduled threads to finish.  We
run this right before advancing time.
2016-08-26 09:07:46 -05:00
Alex Lin
0072e7d6f0 Unintended performance issue with integ_loop at end of scheduled job classes #243
Created a new executive job that waits for threads to finish and readies them
for their next frame of execution.  Created a new job class system_thread_sync
after the top of frame jobs and before the input processor is run to sync the
threads.  Along the way cleaned up instrumentation jobs on the threads to fix #290.
2016-08-24 10:55:27 -05:00
Alex Lin
a32e1d7557 stack smash detected in add_recording_vars_for_frame #211
The character string used in the frame log needs to be stored as
a character string.  We were using a sprintf with a fixed size buffer.
The easiest change was to use asprintf which allocates a character
string big enough to hold the contents of the print.  We need to
save this char string as a char string so it works out.
2016-08-03 15:42:04 -05:00
Alex Lin
3a261929e8 Monte carlo AttributeError's caused by bad configuration still returns zero in master sim #269
If there were bad runs, the master will now exit with a non-zero status.
2016-08-03 15:01:03 -05:00
Alex Lin
ce1347de74 Remove sim_services/STL #275
Removed the sim object, directory and the entry in the Makefile to compile it.
2016-08-03 14:12:16 -05:00
Alex Lin
89fda63293 Remove doxygen documentation now housed on wiki #189
moved all of the design documentation to the wiki
2016-08-02 17:50:49 -05:00
Alex Lin
6848e31ddc Remove doxygen documentation now housed on wiki #189
moved the small amount of text we had in our "requirements" document
to the wiki.
2016-08-02 16:55:36 -05:00
Alex Lin
832679b7ee Remove doxygen documentation now housed on wiki #189
Verified all documentation deleted with this issue resides on
our wiki.  Nothing is lost.  Modified the doxygen makefile and
main page to point to the wiki where the user's guide used to be.

TODO: Need to move the requirements and design doxygen files.
2016-08-02 15:41:18 -05:00
Alex Lin
b2293a14ff CheckPointAgent.cpp has a noted memory leak (confirmed) and proposed optimization #232
Changed the vector to use instances of the VarNameElement instances.  Memory leak is gone.
2016-07-28 13:13:19 -05:00
Derek Bankieris
13b806c2f8 refs #272 allow the OS to choose an available port 2016-07-26 15:03:05 -05:00
Alex Lin
bc6cb589e3 Monte carlo AttributeError's caused by bad configuration still returns zero in master sim #269
The return code from parsing the monte carlo input was always set to zero and not checked.
Retured the return code from parsing the input. Added an exit if the input was not parsed
correctly.
2016-07-26 13:40:38 -05:00
Alex Lin
f90a76be6b We are redefining HOST_NAME_MAX in MonteCarlo.hh
Removed the redefinition.  Included climits and changed HOST_NAME_MAX to _POSIX_HOST_NAME_MAX
which should be defined on the systems we support.

refs #265
2016-07-06 14:56:05 -05:00
Alex Lin
3a7e756926 Unit test directories do not support gtest libs in lib64
Added library search dirs ${GTEST_HOME}/lib64 and ${GTEST_HOME}/lib
to the link line.

refs #264
2016-07-01 11:50:06 -05:00
Alex Lin
595feb280b Convert old units to udunits in test code
Found a couple more units to convert.

refs #261
2016-06-30 11:24:18 -05:00
Alex Lin
adfecdef11 Search for some optional packages in configure script.
Side effect of GSL included by default is that the monte carlo
test code needs to know that.  The test code did not include the HAVE_GSL
flag correctly, causing the tests to fail.  Fixed it.

refs #260
2016-06-30 09:59:09 -05:00
Alex Lin
4ab584ed55 Support using Python 3
Fixed the configure script to allow the user to specify using a python3
interpreter.  Had to change the the way to load the swig generated python modules.
Also had to change code dealing with python strings, oct, long, and
boolean operations.

refs #258
2016-06-28 13:44:21 -05:00
Alex Lin
268d3407df Set and use LD in our makefiles correctly.
Changed TRICK_LD to TRICK_CPPC in the unit test makefiles.  It
should be TRICK_CPPC on these lines.

refs #131
2016-06-28 08:58:33 -05:00
Alex Lin
bfdc491fe3 Output "--" if that was specified in the header file.
Unit tests failed sometimes.  Found that an attributes structure for time
in the data recording class was unintialized.  This led to the mods
field to have random data, and sometimes triggering sys.exec.out.time
to be assigned no units.  Fixed it by zeroing out the structure.

refs #254
2016-06-21 17:02:32 -05:00
Alex Lin
fcb63e0e06 Output "--" if that was specified in the header file.
Used the mods field in the attributes to indicate of "--" was specified in the header file.  We
still save the units as "1" to keep it compatible with udunits.  When outputting the variable
in data recording or variable server we check to see if the mods field for "--" is set.  We
output "--" if the mods field is set.  Also allowed "--" to persist in data products.

refs #254
2016-06-21 16:12:28 -05:00
Alex Lin
d9f1780939 exec_get_current_version returns string out of scope
Changed Trick::Executive::get_current_version to return a const reference
to the string that holds the version.  This avoids a copy of the string object
and avoids that object going out of scope.  As a string, the debug_command
had the same problem so I fixed that one as well.

refs #252
2016-06-21 16:03:15 -05:00
Alex Lin
8a9497a9bc Use udunits package for units conversions
removed udunits.h from makefile dependencies

refs #231
2016-05-17 09:55:12 -05:00
Alex Lin
a95e8e086b Use udunits package for units conversions
Copied the units_conv.c from 15 that includes the new units to master.

Swept through the code removing includes to Unit.hh and UCF.h where they
are no longer needed.  Remade makefile dependencies.

refs #231
2016-05-17 09:01:37 -05:00
Alex Lin
7e218a0472 Use udunits package for units conversions
Change the Variable Server to use udunits.

refs #231
2016-05-16 17:14:50 -05:00
Alex Lin
d7569bf9f2 Use udunits package for units conversions
Some individual tests in SIM_test_ip were still failing because the conversion
between lb and kg has a different number of digits now.

refs #231
2016-05-11 10:56:33 -05:00
Alex Lin
26cb44e946 Use udunits package for units conversions
So our unit tests did their job, they pointed to quite a few errors.
Fixed them all on my platform (CentOS 7).

refs #231
2016-05-11 09:01:54 -05:00
Alex Lin
684f0e6bdc Use udunits package for units conversions
Initial checkin of using udunits for measurement units conversions.  Replaced
our conversion code in ICG and swig code to use udunits.

Also added code to convert unit symbols that we used in Trick that are different
names in udunits.

Added a sim_object that will eventually allow users to specify a custom
set of files to read units information.

refs #231
2016-05-05 14:49:49 -05:00
Alex Lin
d144907b49 Use udunits package for units conversions
First thing is to move the misnamed Units directory to UnitsMap.

refs #231
2016-05-05 13:42:00 -05:00
Alex Lin
c307668fef All command line arguments that start with "-d" being matched by input processor.
Changed the string compare to match the whole argument to "-d".

refs #230
2016-04-26 15:57:33 -05:00
Alex Lin
83d96b4bcc HDF5 data recording broken
Need to enclose the HDF5 code in write_data with an ifdef.

refs #188
2016-04-25 10:04:58 -05:00
Alex Lin
8354546160 HDF5 data recording broken
Overrode the write_data routine for HDF5 recording.  The new routine writes
out all buffered values of an individual variable with one or two HDF5 calls.
This is much more efficient than before where we were making an HDF5 call
for a single value.

refs #188
2016-04-25 09:47:13 -05:00
Alex Lin
d503d52bd8 Debugger command on mac is now lldb not gdb
Added a test to set the debugger command to gdb or lldb depending
on availability.  Created a new script for lldb to run.  Modified
the script for gdb to backtrace all threads.

refs #227
2016-04-20 14:12:03 -05:00
Alex Lin
8c3e322ed1 Variable server restart issues
Added mutexes in the variable server listener thread and each variable server thread.
During checkpoint restart all of these mutexes are locked by the master thread to
stop accepting new connections and stop all read/writing to all variable server clients.
Communication is resumed after the checkpoint has been reloaded.

refs #168
2016-04-19 13:50:30 -05:00
Alex Lin
03d6105c6c Remove catches for non-Trick exceptions
Removed the catches for std:exceptions and unknown exceptions.  The best way
I found to provide a clue to where the exception comes from is to allow the
handler for unhandled exceptions execute.  This is std::terminate which calls
abort and trips a SIGABRT.  I added a signal handler for SIGABRT which like
SIGSEGV, we can print a stack trace or attach a debugger to the process before
exiting.  The stack trace print is on by default.  By default the signal
handler is on, stack trace is on, debugger is off.

refs #220
2016-04-15 15:01:14 -05:00
John M. Penn
f2dd53f0b5 Fix address arithmetic in MemoryManager_ref_assignment.cpp and add unit test. refs #224 2016-04-15 14:34:38 -05:00
Alex Lin
112cc780e0 checkpoint_safestore_set_enabled() has the worst name ever
renamed checkpoint_safestore to checkpoint_safestore_period
renamed checkpoint_safestore_set_enabled to checkpoint_safestore

refs #196
2016-04-15 09:41:28 -05:00
Alex Lin
c4df54e53e echo_jobs and debug_pause are not working
Changed the sim_object names in echo_jobs and debug_pase from "instrumentation"
to "trick_instrumentation"

refs #223
2016-04-14 13:22:25 -05:00
John M. Penn
fc98f6cf0a Fix address arithmetic in ClassicCheckPointerAgent::write_rvalue. Refs #221 2016-04-13 15:39:30 -05:00
Alex Lin
fb7432d096 Add direct STL checkpointing
Modified ICG to save the non-canonical name for STLs.  This is typically more readable
because it is shorter.  Added code to the variable server to filter out requests accessing
STLs, because those accesses will not currently work.

refs #206
2016-04-04 15:07:57 -05:00
Alex Lin
0b7e3e2dc9 STLs may be in std::__cxx11 namespace
When we parse header files and find std::basic_string we change that to std::string.
Added a check for std::__cxx11::basic_string to do the same.  We also carry a
list of STL names, added std::__cxx11::[template_name] to the list of possilbe STL
names we are searching for.

refs #214
2016-04-01 21:35:53 -04:00
Alex Lin
b1a69f2490 stack smash detected in add_recording_vars_for_frame
Changing size of char[256] to char[512] temporarily.  Will come back
to change all sprintf calls to use stringstreams.

refs #211
2016-04-01 09:02:46 -05:00
Alex Lin
617efa3a52 Merge pull request #210 from alexlin0/master
Merge STL checkpoint work
2016-04-01 08:18:37 -05:00
Alex Lin
ba6a00315e Add direct STL checkpointing
Fixing the unit tests that broke because of my changes.  Memory
Manager tests need to be compiled with c++11, and the STL unit test
was using a variable that did not exist anymore.

[Issue: x]
2016-03-31 17:30:00 -05:00
Alex Lin
c1eb4e6fc5 Add direct STL checkpointing
The typenames on the Mac need to be converted for strings.  The
templates are genererating the long form of the string type name.  I
wrote a function to catch test the template parameter types and
return std::string.

refs #206
2016-03-31 15:48:19 -05:00
Alex Lin
c8a39f4a44 Add direct STL checkpointing
Removed the previous attempts at STL checkpointing. Removed
the header files and sims.  Also simplified the names of some of
the templates.

refs #206
2016-03-31 14:50:27 -05:00
Derek Bankieris
52ff78ffa3 refs #209 Completely remove event in EventManager::remove_event 2016-03-31 12:36:05 -05:00
Alex Lin
06a405ef35 Add direct STL checkpointing
stl::stack code completed.

refs #206
2016-03-31 10:32:13 -05:00
Alex Lin
5368108723 Add direct STL checkpointing
Added queue and priority queue handling.

refs #206
2016-03-31 09:22:45 -05:00
Alex Lin
94febe62f2 Add direct STL checkpointing
Added the templates required for maps, multimaps, and pairs.

refs #206
2016-03-30 16:57:45 -05:00
John M. Penn
605ef1da0c fixed pointer declaration. Ooops! Refs #207 2016-03-30 16:48:10 -05:00
John M. Penn
145922667e In making reference attributes, set units to dash dash 2016-03-29 16:00:55 -05:00
Alex Lin
46aec08b80 Add direct STL checkpointing
Initial checkin of STL checkpointing.  This checkin only covers the sequential
STLs, vector, list, deque, set, and multiset.  This checkin does include the
changes in Trick header files to include/exclude our STLs properly to make a
restartable checkpoint.

refs #206
2016-03-29 09:26:49 -05:00
Alex Lin
26dfb3a000 Move the lock_memory function out of the Executive to RealtimeSync
Moved the lock memory function to the real time sync directory.  It doesn't need
to be part of the RealTimeSync class either so I left the lock/unlock code
in the C language calls for real time functions.

refs #195
2016-03-10 17:05:47 -06:00
John M. Penn
0f76eec7a1 Include stdlib.h in MemoryManager_ref_name.cpp. 2016-03-09 11:26:31 -06:00
John M. Penn
ced68e24b2 Keep track of and free the reference attr created by ref_var. Refs #154 2016-03-08 17:47:09 -06:00
John M. Penn
9b652d0a11 Back out free of attributes in assignment production. refs #154 2016-03-07 12:32:16 -06:00
John M. Penn
ec37898fb1 Fix memory leaks in CheckpointAgent input parser. refs #154 2016-03-03 17:38:41 -06:00
Alex Lin
3abf0b31c4 Add option to validate pointer addresses in variable server clients
Forgot I left the validate_address on for testing.  Turned if off now.

refs #193
2016-02-25 10:09:49 -06:00
Alex Lin
543bbc0585 Add option to validate pointer addresses in variable server clients
Added a flag called validate_address to each variable server thread.  When
activated each pointer address will be tested to see if it is in memory
the memory manager is tracking.  If it is then everything proceeds normally.
If it does not, then an error return value is returned for the value of this
variable.

refs #193
2016-02-25 08:56:04 -06:00
Alex Lin
2c5a46a8bc Trick::MemoryManager::add_attr_info improperly removes the const keyword
Changed the search from "const" to "const " because we're intersted in
removing the const keyword preceding a type name.

refs #184
2016-02-22 09:52:28 -06:00
Alex Lin
39868aba46 Functions with enumerated default arguments cause bad python code to be generated
OK, all the previous checkins were the wrong way to fix this issue.  The SWIG
compactdefaultargs feature and the shadow feature clash for our DRBinary class.
I turn off compactdefaultargs for the DRBinary class, leaving it on for
everything else.

refs #176
2016-02-18 11:04:07 -06:00
Alex Lin
4ab940a691 Revert "Functions with enumerated default arguments cause bad python code to be generated"
This reverts commit 30fbd682ee.
2016-02-18 10:59:36 -06:00
Alex Lin
30fbd682ee Functions with enumerated default arguments cause bad python code to be generated
Found a lot more data recording groups that have the same problem.

refs #176
2016-02-18 10:21:12 -06:00
Alex Lin
83572b20cb Print some timing statistics when the sim exits
Saved the timestamps on the default gettimeofday clock as close to
the beginning of the simulation, after initialization is finished and
at the end of shutdown.  Printed out the elapsed time as well as
the number of overruns counted by RealtimeSync.

refs #183
2016-02-17 16:27:37 -06:00
Alex Lin
4c3015851f Merge in the er7_utils integrators
Taking in the latest er7_utils directory and adding it into Trick in the
same location it was as an external repository.  Made one change to
the files_to_ICG.hh file in the repository to remove the CheckpointHelper
header files.  Those go in the Trick files_to_ICG.hh file.

refs #180
2016-02-10 09:32:53 -06:00
Alex Lin
6461b50d7d Setting framelog sample size does not work.
Setting the frame log size only resized the time line graph, not the normal
frame log groups.  Added code to change the size of the normal frame log
groups in addition to the time line.

refs #177
2016-02-04 16:13:05 -06:00
Alex Lin
692d962b90 Sending the variable server a variable name that lists a composite type causes core dump
Duplicating change from 15.1.1.
If a variable resolves to a class/structure type the variable server tries to free the
attributes associated with that variable name.  But the attributes usually point to
a fixed place in memory that is not allocated.  I removed the free statement.  I don't
believe this will lead to a memory leak.

refs #165
2016-01-26 16:02:15 -06:00
Alex Lin
7e542440d1 Add a time variable in seconds to the variable server
Added a time variable that is in seconds.  A created a special case
for var_add if you add "time" then this variable will be added to
the list of variables returned.

trick.var_add("time")

refs #151
2016-01-14 10:49:27 -06:00
Alex Lin
903ff05960 data record buffering optimizations
Added a loop to set each 1024th byte in the recording array to 1 once the
memory has been allocated.  Need to test if this is good enough to get Linux
to allocate the memory.

Added a current recording buffer pointer to use instead of using array offsets.
This should be more cpu cache efficient.

Changed the memcpy calls to direct casted integer assignments based on the size of the
parameter.  If the parameter is not size 1,2,4,or 8 we fall back to a memcpy.

refs #155
2016-01-14 08:31:13 -06:00
Alex Lin
ce1962b55d make doxygen broken
Updated the directory names in the doxygen files to match the new directory locations
of our source code files.  The documentation builds now.  But we still need to
remove the duplicate documentation that is now in the wiki, because the wiki is
more up to date.

refs #158
2016-01-13 09:18:09 -06:00
Alex Lin
ff39984568 Input processor crashes if second event with same name is created
When allocating a new event, if the same name is used, no allocation is
created and NULL is returned.  We start trying to use the returned value
which seg-faulted.  I added a check to only continue if the returned value
from the allocation is not NULL.

refs #149
2015-12-02 10:44:27 -06:00
Alex Lin
1afac18399 Add additional thread synchronization mechanisms
Created a thread trigger container class to hold all of the various thread triggering
mechanisms.  I wanted to avoid allocating/freeing trigger mechanisms.  I added
an eventfd and futex trigger types.  Updated SIM_threads_simple test sim to use
show how to set the thread trigger type.

refs #148
2015-12-02 10:35:25 -06:00
Derek Bankieris
aedd6b2be3 I'm not sure why we're padding floats and doubles in vs_format_ascii. It results in sending a bunch of useless spaces which hurts efficiency. Values are already tab-delimited, so fixed-width fields are unnecessary. We're not padding anything else, so don't pad these! 2015-11-17 14:18:59 -06:00
John M. Penn
fcb419d534 Add demonstration of getting units from MemoryManager::ref_attributes(). Fixes #132 2015-09-30 17:30:51 -05:00
Alex Lin
e58ba61d8e MTV/variable server crashes if checkpoint has less malfunctions then currently running sim
Did two things to stop the crash.  1.  When following an address path if we hit a NULL
address, stop processing and return the NULL.  2.  When trying to resolve addresses in
copy_sim_data, if a NULL address is returned then reset the reference to unresolved and
return a dummy value.

Need to fix MTV to handle dummy value returns.

refs #117
2015-09-14 11:33:11 -05:00
Alex Lin
80fb82e9f6 Add methods in base SimObject to turn whole sim object on/off.
Added enable/disable methods to the SimObject base class.  Used
enable/disable to be consistent with the JobData class that already
had these defined.

fixes #103
2015-08-05 15:17:32 -05:00
Alex Lin
119e7908d3 JITInput files not working
Added TRICK_SYSTEM_CXXFLAGS and TRICK_SYSTEM_CFLAGS to the gte list of
variables stored in a simulation.  These variables are used to
compile JIT input files.

refs #104
2015-08-05 14:15:39 -05:00
Alex Lin
e692b81fdb Setting initial sim time causes lockup
Found two issues.  First is that the next call times for
all of the jobs was not calculated correctly.  Second is
that the if the user wants to sync the sim to a real time
clock interval, the initial sync to the real time clock was pausing
the full starting sim time instead of syncing to the clock
interval.

refs #99
2015-08-04 16:36:19 -05:00
John M. Penn
5778add741 Ref #96 : Fix to many args warning. 2015-08-04 16:26:28 -05:00
John M. Penn
36cf0a72db Fixes #96 by adding space delimiters between values. 2015-08-04 15:51:47 -05:00
John M. Penn
c680c974f6 Refs #44 : Set precision to 15 for MonteVarFixed 2015-08-04 15:46:44 -05:00
John M. Penn
f2ca099baf Fixes #44: Changed the MonteRun values that are used and that are recorded to be the same precision. Also increased the precision from 10 to 15 significant digits. 2015-07-29 16:56:23 -05:00
Alex Lin
a2bc82f1e9 MemoryManager unit test needs -lpthread on Ubuntu
Added -lpthread to link line just because.

refs #91
2015-07-22 18:05:34 -05:00
Alex Lin
d72555f3cc Split CP up into components that can be called individually
After about 6 unsuccessful builds I decided to run the unit tests
before checking in these files.  I fixed the integrator unit
test that was failing from a previous issue along with problems
with the sims.

refs #86
2015-07-21 15:10:40 -05:00
Alex Lin
1bf08aeb55 Clock unit tests don't work on all platforms.
Clock unit tests don't work on virtual machine platforms.  I've
recommented them out until they can be reviewed.

refs #87
2015-07-21 14:45:19 -05:00
Alex Lin
13268aae32 Merge branch 'makeMaster' that splits up CP into several executable
components.
2015-07-21 09:58:15 -05:00
Alex Lin
e1c1bbaccf Split CP up into components that can be called individually
Initial rough checkin that partially works for the ball sim.

refs #86
2015-07-16 15:36:36 -05:00
John M. Penn
a5e7699d40 Fixes #81: Updated other Makefiles to get tests to link 2015-07-16 15:02:33 -05:00
John M. Penn
3a70ffb156 List libraries more than once to satisfy gcc linker 2015-07-15 17:29:10 -05:00
John M. Penn
619d60fff7 Fixes #81: Memory Manager tests still require libtrick.a to be linked in. 2015-07-08 14:37:17 -05:00
John M. Penn
5fb037aa00 Fixes #79: Get the Clock tests working 2015-07-01 18:21:56 -05:00
John M. Penn
63975d9f89 Fixes #78: Changed message about configure option for TPRO CTE card. 2015-07-01 18:10:53 -05:00
John M. Penn
5ecc7b2af0 Remove RELEASE call when rt_nap is set 2015-07-01 18:03:58 -05:00
John M. Penn
5d219d5e2e Fixes #76: Fixed shadowed ii index. 2015-07-01 13:16:34 -05:00
John M. Penn
03284bf97d Break the Memory Manager out of libtrick.a into libtrick_mm.a. 2015-06-30 17:57:26 -05:00
Alex Lin
cf3738d3fd Memory Manager tests trying to write io_src files in sim_services/include
Added 2 flags to trick-ICG. "-o" will specify an output directory.  Added this
option to the calls to trick-ICG for the Memory Manager tests.  Also added
a "-m" option to create the map files ICG creates for sims.  The memory manager
tests do not need these maps so we don't include the option.  Added the -m option
to the sim makefile and the master makefile so we do create the map when compile
Trick core and sims.

refs #72
2015-06-24 17:49:14 -05:00
Alex Lin
44736be398 Remove dupilcate stand-alone libraries
The test programs now need more than just -ltrick.

refs #71
2015-06-24 16:54:15 -05:00
Alex Lin
03979a2079 Memory manager test programs need libtrick_units.a
Added libtrick_units.a to the linking of memory manager test programs.

refs #71
2015-06-24 16:26:11 -05:00
Alex Lin
941eb5c1cc Remove duplicate stand-alone libraries
I changed trick comm so that there is only one version built, not a slightly different version
if you are in or out of a sim.  While I was in the trick comm code, I removed all of the
unnecessary system header file inclusions out of tc.h.   I modified each of the source files
to include the system files it requires.  Some sim_services files were including tc.h and
also had to be edited to add headers.  I removed the stand-alone makefiles out of all
of the trick_utils directories.  Finally I modified the master makefile to exclude the
trick_util directories comm, math, and units from being archived into libtrick.a.  Each of
those directories will create their own library and will be included when linking a Trick sim.

refs #71
2015-06-24 15:58:17 -05:00
Alex Lin
d3acfa5fc0 Test code does not work with new directory locations.
Adjusted all of the source code to point to the header files in their new
locations.  Adjusted the makefiles for the header locations as well.
Added .gitignore files in the test directories to ignore test object code.
2015-06-22 16:11:08 -05:00
Alex Lin
407040507d Standardize directory names
Tested without the er7_utils directory and found some makefile dependencies that depend on er7_tuils files.  Also found that I forgot to change the include directories for the trick_algorithm integrators.

refs #63
2015-06-09 08:44:45 -05:00
Alex Lin
d491c86b84 Standardize directory names
Some linux specific include files got into our dependency files.

refs #63
2015-06-09 08:44:44 -05:00
Alex Lin
60e3983344 Standardize directory names
Moved the io_src code created by sim_services to sim_servivces/include.  Also found some makefiles that needed to be changed to refer to the makefiles in their new locations.

refs #63
2015-06-09 08:44:44 -05:00
Alex Lin
24cfabbdef Standardize directory names
Added headers with previous path for backwards compatability.  Changed name of Exec_exception to ExecutiveException.

refs #63
2015-06-09 08:44:43 -05:00
Alex Lin
19025d77ad Standardize directory names
Reorganized.  Created a new top level include directory that will hold all of Trick's header files. Moved all of the Trick headers to this directory.  Created a libexec directory that holds all of the executables that users don't need to execute directly.  Changed all of the executables remaining in bin to start with "trick-".  In the sim_services directories changed all source files to find the Trick headers in their new location.  Since all of the include files are gone in sim_services, removed the src directories as well, moving all of the source files up a level.  Moved the makefiles, docs, man, and other architecture independent files into a top level share directory.  Renamed lib_${TRICK_HOST_CPU} to lib64 or lib depending on the platform we're currently on.

refs #63
2015-06-09 08:44:42 -05:00
John M. Penn
f6fed320c4 Fix #64: Fixed the call to register_group_with_mm in DRHDF5 constructor. 2015-06-03 19:32:23 -05:00
Alex Lin
366afd27dc Data Record binary endianness is determined by uninitialized variable
Initialized the variable that DRBinary is using to check for little/big
endianness.

fixes #60
2015-05-21 16:47:11 -05:00
Alex Lin
caf79f5e45 Monte Carlo shell command not set correctly when use shell used.
When a user shell is specified, the command is never written into
the buffer that is used to start a slave.

fixes #59
2015-05-21 16:40:01 -05:00
John M. Penn
205bda4375 Refs #58: Fixed generation of the monte_header file. 2015-05-19 17:30:26 -05:00
John M. Penn
899b0d3efe Merge branch 'master' of https://github.com/nasa/Trick 2015-05-15 10:41:36 -05:00
John M. Penn
bc9746db6c Fix #55: Fix problem in stringstream declaration 2015-05-15 10:41:08 -05:00
Alex Lin
24fe5adaec JITEvents are not checkpointable
Changed the way JITEvents are created and handled. Instead of taking a function pointer directly we save a name of a function to the JITEvent class.  The class will dynamically look up a function that matches the name both during event creation and during checkpoint restart.

Fixes #53
2015-05-14 13:41:17 -05:00
John M. Penn
eb46419951 Fix #55 : Use stringsstreams to build paths rather than a fixed size char array. 2015-05-12 18:00:49 -05:00
Alex Lin
24a081a32b Event messages not printing
After further discussion, it was revealed that the event printouts would stop
coming out if a new event was created.  Found that the constructor of the
event was clearing out the static info_msg flag all events used to test
for printing.  Removed the assignment in the constructor and set the
initial value of the info_msg flag to false at the declaration point.

Fixes #38
2015-04-06 08:19:16 -05:00
John M. Penn
c1619156a9 Fixed the way that Trick::MemoryManager::ref_dim() calculates the sizes of elements in an unconstrained array. Fixes #37. 2015-03-30 17:36:54 -05:00
Alex Lin
7544d9cca7 Remove overloaded fields in Integrator/trick_algorithms/ABM_Integrator.hh
Removed the overloaded fields.

Fixes #33
2015-03-26 08:04:17 -05:00
John M. Penn
8536208822 Removed erroneous stringstream declaration, which compiled on MacOSX but failed on Linux. 2015-03-25 15:47:36 -05:00
John M. Penn
f5334e07d7 Merge branch 'devel'
to fix issue #25.
2015-03-25 12:06:15 -05:00
John M. Penn
08be591e32 Replace message_publish calls with MemoryManager specific calls. fixes #25 2015-03-25 12:05:25 -05:00
Alex Lin
c5456fab2a Variable Server fails to establish listen port on restart under a specific circumstance.
Added a test in the variable server listen restart job to see if the the name of the
machine in the checkpoint file matches the machine that we are running on.  We
test all of the network names avaiable on the machine.  If the name is not found then
we assume that the checkpoint was taken on another machine and wipe out the machine
name.  This will default the machine name back to localhost.

Fixes #24.
2015-03-24 15:16:35 -05:00
John M. Penn
e2be23c269 Add emitMessage, emitError, and emitWarning member functions to MemoryMananger 2015-03-23 17:21:35 -05:00
Alex Lin
306dee18a3 Clean up once include variables
Missed a couple of files where message_publish is in an ifdef __APPLE__
section.  But I decided to put message_type.h back in message_proto.h
because taking it out would affect a lot of user code.

Adds to #14.
2015-03-23 17:01:40 -05:00
Alex Lin
14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00
Derek Bankieris
678cc4b877 Corrected erroneous prototype. 2015-03-17 13:45:42 -05:00
Alex Lin
d798792544 Removed protect_ip_hang.
This is obsolete code as we don't support RedHat 5 anymore. Removed
the ifdef check and conditional code.

Fixes #18
2015-03-11 08:42:42 -05:00
Alex Lin
2d5370100b Merge pull request #1 from excaliburtb/master
Added SWIG processing for IPPythonEvent class. Should fix current event ...
2015-03-02 12:56:34 -06:00
Alex Lin
87741062e0 Getting standalone to compile. Fixes #2 2015-03-02 12:48:17 -06:00
Thomas Brain
f15d324d40 Added SWIG processing for IPPythonEvent class. Should fix current event restart problem. 2015-03-02 10:11:45 -06:00
Alex Lin
f0c594f841 Initial commit of everything. 2015-02-26 09:02:31 -06:00