Commit Graph

503 Commits

Author SHA1 Message Date
John M. Penn
eef5b14fbf Add tweaks that speed up matrix multiplication routines. ref #386 2017-02-27 12:51:35 -06:00
Derek Bankieris
e6ad95f493 Grand Make Dependency Graph, part 1
Refs #360
2017-02-23 13:26:28 -06: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
d965f4b0a8 Infer TRICK_HOME automatically
Refs #358
2017-02-10 10:29:56 -06:00
Alex Lin
337139cacb S_overrides.mk is included twice when building #360
A different approach.  Instead of trying to limit the number of times
S_overrides.mk is included, combine the makefiles so only one
call to make is made.
2017-02-09 09:46:58 -06:00
Alex Lin
38d2b10b9e Forward-declared classes aren't fully populated in S_sie.resource #378
I chose the wrong call when trying to support clang 3.9 and it's
removal of getRBraceLoc.  The best equivalent call in 3.9 is
getBraceRange().getEnd().
2017-01-23 17:48:16 -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
8a0653fa09 Detect when TRICK_ICG is used in header files and compensate for it. #375
clang call to addPPCallbacks changed between clang versions 3.5 and 3.6.
2017-01-12 08:42:16 -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
9f01209316 ICG generates non-compilable io_* code for std::vector::iterator members #331
Added a test if our field is an iterator type.  If it is we cannot create io_src
code for it.  We skip it once identified.
2017-01-11 16:07:02 -06:00
Alex Lin
b60320464a Detect when TRICK_ICG is used in header files and compensate for it. #375
Always differences between clang versions.
2017-01-11 15:59:10 -06:00
Alex Lin
ba47c2048c Detect when TRICK_ICG is used in header files and compensate for it. #375
Created a hook for the clang preprocessor.  The hook does 2 things.  It
keeps track to which header files we have entered and exited.  Second it
searches for the use of TRICK_ICG.  If we find an instance of TRICK_ICG we
mark all of the included files from this point up the chain as requiring
compensation.  To compensate for using TRICK_ICG we write out the older
offset statements to get the location of variables in classes/structures.
2017-01-11 15:02:21 -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
3600e3880a Infer TRICK_HOME automatically
Refs #358
2016-11-30 14:12:34 -06:00
Derek Bankieris
9fa76d8e78 Use std::strerror to report system call errors
Refs #357
2016-11-30 13:25:52 -06:00
Derek Bankieris
4d7ea87a43 Fix typo
Refs #355
2016-11-30 11:47:56 -06:00
Derek Bankieris
9fdb5d4c51 Merge input and error streams for plotting apps
Refs #355
2016-11-29 15:59:36 -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
4281b92141 Fix MonteMonitor
Refs #354
2016-11-29 11:28:15 -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
Derek Bankieris
eedd0783cd Replace multiple radian units with single instance
One of the constructor parameters enables automatic creation of
SI-prefixed versions of the root unit, which obviates the need to
create them individually.

Refs #345
2016-11-07 08:22:55 -06:00
Derek Bankieris
2248b5bcfa Remove unused variables. Normalize formatting.
Refs # 345
2016-11-04 15:56:51 -05:00
Derek Bankieris
de69363cbd Improve formatting
Remove trailing whitespace. Replace tabs with spaces.

Refs #345
2016-11-04 15:48:29 -05:00
Derek Bankieris
245389182d Automatically determine TRICK_HOME in makefile
Refs #344
2016-11-04 14:49:52 -05:00
Derek Bankieris
d61fe5f3c3 Removed unused file Simcom.java #343 2016-11-04 14:49:52 -05:00
John M. Penn
0a19eeb602 Removed un-needed null pointer checks in DPX code. Ref #16 2016-11-02 15:34:06 -05: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
664797e391 Move one-time-use variables into their call site #341 2016-10-31 10:00:48 -05:00
Derek Bankieris
29b0d2d223 Alex doesn't like auto #341
Granted, there are times you shouldn't hide the type.
2016-10-31 09:51:44 -05:00
Derek Bankieris
5898f3fdec Improve loop efficiency #341
Calling getTemplateArgs() every iteration is wasteful. This should
be done once outside of the loop. Even better, use a foreach loop and
get rid of the index varible!
2016-10-31 09:34:24 -05:00
Derek Bankieris
bdcfbb4e3a Restore debug functions #341 2016-10-31 09:10:33 -05:00
Derek Bankieris
ef1405c3be Refactor ICG
Hey buddy. I wanted to tell you this before you heard it from someone
else...

I refactored ICG.

Now, it's gonna look a little scary at first. But I promise you'll like
it when you get used to it. It'll be fine. You can trust me. #341
2016-10-28 14:37:12 -05:00
Alex Lin
ba75f6ff37 ICG does not compile using llvm 3.9 #339
The call getRBraceLoc to find the ending source location of things is gone.  Replaced
it with getting the source range and get the end of that range.  Also the way to
get clang/llvm 3.9 to process c++11 code required some reordering of calls in main as
well as adding some more features to be turned on.
2016-10-28 13:21:21 -05:00
Derek Bankieris
cde7c02d22 Use 1/0 instead of True/False in TVBoolean.java
The use of True/False prevents the plotting of booleans, as those values
cannot be parsed as doubles. While it's conceptually more pleasing to
use the actual Python keywords for booleans, numbers will work just as
well and allow plotting. #337
2016-10-26 13:38:58 -05:00
Derek Bankieris
90eb381987 Fix indentation 2016-10-26 13:35:20 -05:00
Derek Bankieris
0a664abdeb Prepend trick app launch commands with trick- #336 2016-10-26 12:12:49 -05:00
Derek Bankieris
0ba68e40aa Merge branch 'master' of https://github.com/nasa/trick
Conflicts:
	trick_source/codegen/Interface_Code_Gen/main.cpp
2016-10-21 15:15:41 -05:00
Derek Bankieris
015965abab Renamed most variabes so that they are self-descriptive. Stop using abbreviations! No one can tell what anything is.
Applied a consistent formatting.
Inlined several one-off variables.
2016-10-21 15:06:44 -05:00
Derek Bankieris
108d3d40c5 Added a version of almostRealPath that takes a const std::string& parameter so we don't have to use c_str() everywhere 2016-10-21 15:06:35 -05:00
Derek Bankieris
75c35752d6 Spacing 2016-10-21 15:05:26 -05:00
Alex Lin
a2452aacd0 ICG creates offsetof statements that will not compile when using clang #327
When copying inherited variables to a child class in ICG, the inherited flags
were not being set on the mac.
2016-10-21 13:13:43 -05:00
Alex Lin
f1cbacd646 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
This changes back the default behavior to not use offsetof in io_src code.
Added a flag to ICG, -c or --compat15, to globally generate offsetof statements.
Added an ENV variable that can be used to generate offsetof statements by file or directory.
Added in a warning if classes parsed at ICG time are different in size than at runtime.
2016-10-21 13:13:43 -05:00
Derek Bankieris
5484e39f11 Fix spacing in warning message 2016-10-21 10:50:11 -05:00
Derek Bankieris
bcb421678a Fix spacing. Move declaration of loop variable into loop initializer. Rename stupid 1337 variable. 2016-10-21 10:49:11 -05:00
Derek Bankieris
2279ba8648 Restore print out when compiling io_* files #326 2016-10-21 09:20:50 -05:00
Derek Bankieris
4f49460a6f Clean up io_* code #330 2016-10-20 14:55:00 -05:00
Derek Bankieris
beb93f7e88 Removed useless local alias, eliminating the need to silence set but unused variable warnings #326 2016-10-20 14:55:00 -05:00
Derek Bankieris
2fb06cf133 Got rid of the individual io, py, and model conglomerate objects #326
Link all of the objects as part of the S_MAIN target using the link lists.
Renamed some variables and files to make them more self-descriptive.
2016-10-18 13:06:42 -05:00
Alex Lin
23af89681e ICG creates offsetof statements that will not compile when using clang #327
Added a check that was in 15 that tested the platform we are running on.  If we
are on an mac, we want to skip fully qualifying variable names because it creates
code that doesn't compile under clang.
2016-10-12 13:34:04 -05:00
John M. Penn
7544f4f96a Stop DPX makefile from trying to make catalog.xml. Ref #324 2016-10-06 14:53:36 -05:00
Derek Bankieris
054245f968 Forgot to remove this debugging print out before the last commit 2016-10-06 14:28:06 -05:00
Derek Bankieris
f161ddb18c Made everything about Trick's build process better 2016-10-06 13:54:06 -05:00
John M. Penn
edbac4cc11 Add corrected catalog.xml that contains a relative base. 2016-10-05 15:35:07 -05:00
John M. Penn
58b32d21af Delete files used to generate catalog.xml. Ref #324 2016-10-05 15:34:14 -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
Alex Lin
bbba26e057 Merge branch '17.0' 2016-09-16 09:50:12 -05:00
Alex Lin
00a0e8be44 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Missed some bitfield offset calculations.
2016-09-16 09:46:03 -05:00
Derek Bankieris
ba59606b1d Added TRICK_PYTHON_PATH environment variable #313 2016-09-16 09:20:11 -05:00
Alex Lin
c134ffea8f Merge branch '17.0' 2016-09-16 08:43:47 -05:00
Alex Lin
ae07b26243 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Added back the code that set the offset of variables with the offsetof function. This
code is running by default.  Any code that includes #ifndef TRICK_ICG in
classes/structures will want this on.

Added a flag to ICG that allows us to turn off writing of these lines.  If the flag
is present, ICG may write out io_src code for private/protected variables that it could
not reach if an offsetof function was required.  Code cannot have any #ifndef TRICK_ICG
present in classes/structures for this to work.
2016-09-16 08:39:37 -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
Alex Lin
b2432fd269 Trickified Project Libraries #309
We were ignoring classes completely if it was found in to be in an external library
directory.  We need to partially process it so it is included in the ICG generated
class_map file which registers attributes of classes and eventually works it's way
to populating the S_sie file.
2016-09-15 14:48:23 -05:00
Alex Lin
9801e3d210 ICG not setting default checkpointing io correctly. #308
If a checkpoint_io field is found we were or'ing this in to bits already
set by default.  Clear the bits first.
2016-09-14 09:38:28 -05:00
Alex Lin
256c83a876 ICG not setting default checkpointing io correctly. #308
Changed the default io value from 3 which left out checkpointing to 15 which does
include checkpointing.
2016-09-13 16:37:59 -05:00
Thadeus Fleming
5027c02c51 Fix filename output in attach_units for Python 3 2016-09-11 14:21:37 -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
919a8e2068 Variable using an enumeration as array index causes infinite loop #299
Once we determine the type of a variable we should stop processing the
AST tree at that point. We do this for record types but not for the
built in types.  Changed the return value of the process builtin
function to false so we stop processing.
2016-09-01 16:06:33 -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
7d82690a0b tc_init is not thread-safe #289
Made the global sockaddr variables local and cleared them with a memset.
2016-08-29 13:11:04 -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
858602fe01 New STL framework doesn't support const #293
So using consts as arguments to STLs causes errors in our io code and SWIG.
Added a check for const template arguments and going to ignore them for
both ICG and what we input to SWIG.
2016-08-25 08:42:43 -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
82049ead95 Add a printout when ICG parses header file with no Trick header comment #281
Added the printout.
2016-08-19 10:04:42 -05:00
Alex Lin
bb93300c5c Trick View: update to handle udunits #262
Updated unit symbols to match those in udunits.
2016-08-04 08:54:07 -05:00
Alex Lin
14e112d1a1 Data products not plotting the last recorded data point #162
Needed to save last point for comparison streams as well.
2016-08-04 08:36:27 -05:00
Alex Lin
3e442f4241 Data products not plotting the last recorded data point #162
Needed to save the last point for gxplot as well.
2016-08-03 16:57:14 -05:00
Alex Lin
3d604ff770 Data products not plotting the last recorded data point #162
When reading a data stream to plot the end of stream flag is being set
as the last point is read.  This was causing several layers of calls
not to save the last point.  I went ahead and saved the result of the
get_next_point calls whether the end of stream flag is set or not and now
we don't lose the last point.
2016-08-03 16:32:46 -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
b26fcf2f3b Swap order of libraries during ICG linking. #277
Order swapped.
2016-08-03 09:03:41 -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
8198ce8a7f What is the difference between trick-trk2ascii and trick-trk2csv #273
removed trick-trk2csv
2016-08-02 10:45:09 -05:00
Derek Bankieris
51fcdcb9cb #274 Purged obsolete StripChartApplication 2016-08-02 10:04:48 -05:00
Alex Lin
3ac7fc4de3 Data products not plotting the last recorded data point #162
Accidentally committed change with meow debug message.
2016-08-02 09:59:46 -05:00
Alex Lin
ca02209d8f man pages completely out of date #253
Created man pages for each executable we have in bin.  Updated the
couple of man pages we did have in there.  Modified trick-CP
to accept arguments.  Updated the version number reported by ICG
as well.
2016-08-02 09:56:43 -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
f7d1ff6376 ICG fails to compile on Mac when using clang/llvm 3.8.1. #271
Modified the makefile to define LIBCLANG_MAJOR, LIBCLANG_MINOR, and
LIBCLANG_PATCHLEVEL based on the llvm-config executable in the llvm
directory pointed to by the configuration.  These new variable names
are independent of the __clang_major__, etc. variables we were defining
only in Linux.  Using these names, we can reduce the clang version
checks to a single consistent set of version numbers.  We don't have
to deal with the different version numbers assigned by Apple.
2016-07-25 14:57:07 -05:00
Alex Lin
6e5beec9e1 Support clang releases that do not define a patchlevel.
Modified the makefile that creates the __clang_patchlevel__ define to
only create the variable if it is present in the clang version.

refs #266
2016-07-06 15:04:15 -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
48ad85d0af Some Trick jobs are labeled "simobject.classPtr->Foo()" trick_dp barfs on the "->" string
The "->" string interferes with some code in quick plot trying to split array ranges into
individual variables.  The old code only tested for the '-' character.  Changed these
checks to regular expressions that only match '-' if it is not followed by '>'.  Also
converted tabs to spaces throughout the file, hence the big diff.

refs #51
2016-06-30 15:35:23 -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
1731390c98 Switch compilation of ICG from clang++ to g++
Removed the lines that set the compiler to clang++, defaulting
it to g++.  Added lines in the makefile to set __clang_major__,
__clang_minor__, and __clang_patchlevel__.  These are required
to compile several of the files in the ICG directory.

refs #259
2016-06-29 17:33:04 -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
1224c43e7f Set and use LD in our makefiles correctly.
Set LD in our makefiles to the ld executable found by configure.
Changed the final sim link to use TRICK_CPPC as the link command since
it was using the compiler anyways.  Changed the places where we use "ld" to
use LD.

refs #131
2016-06-27 12:48:35 -05:00
Derek Bankieris
68a25a74ae refs #257 Ignore -psn_* arguments 2016-06-27 12:46:23 -05:00
Alex Lin
6f20aa4b8b Save X11 include and library information from configure
Saved the value of x_libraries variable from the autoconf AC_PATH_X if
the location is not standard.

refs #133
2016-06-27 09:50:04 -05:00
Alex Lin
0514612039 Output "--" if that was specified in the header file.
Copy and paste error in TrickHDF5.cpp, used wrong variable name.

refs #254
2016-06-23 09:07:59 -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
c9e3bc77da er7_util header files not being installed
Added a makefile install rule to copy the header files out of
er7_utils to the install directory.  Adjusted ICG to ignore
Trick header files if they are installed.

refs #246
2016-06-20 13:40:45 -05:00
Alex Lin
fb4601734f Need to include SimTime.hh for ICG and swig processing.
Added the sim time header files to files_to_ICG.hh and sim_services.i so it will be processed.

refs #247
2016-06-15 16:11:09 -05:00
John M. Penn
af8548ce6a Exclude /sw (Fink directories from being processed by ICG. Refs#248 2016-06-10 14:52:19 -05:00
Alex Lin
1615e0f13b ICG should ignore FILE * variables
In ICG if we encounter a FILE * variable, we ignore it setting the IO specification to 0.

refs #244
2016-06-02 08:50:18 -05:00
Alex Lin
3e82f79f28 Use udunits package for units conversions.
FieldDescription.cpp is missing and include for stack.  Strange it compiles
on most platforms.

refs #231
2016-05-18 08:26:14 -05:00
Alex Lin
82d950bb9a Use udunits package for units conversions
Changed the java GUIs to use udunit symbol names

refs #231
2016-05-17 10:58:08 -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
384519ce24 Use udunits package for units conversions
PyFrame_GetLineNumber is not present in python 2.6.  We have
to use PyCode_Addr2Line instead to get the line number.

refs #231
2016-05-11 15:14:19 -05:00
Alex Lin
929372e863 Use udunits package for units conversions
Created a UDUNITS_LDFLAGS to store an link library path and -luduints2.

refs #231
2016-05-11 14:43:53 -05:00
Alex Lin
01fd86a513 Use udunits package for units conversions
Needed to add UDUNITS_INCLUDES to the ICG makefile and remove
the hardcoded udunits include path

refs #231
2016-05-11 11:27:39 -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
d72aa59fdd Use udunits package for units conversions
Converted data products to use udunits.

refs #231
2016-05-10 14:45:31 -05:00
Alex Lin
6defa99b34 Use udunits package for units conversions
Changed the include for udunits to #include <udunits2.h> to work
on all platforms.  Added the include directory /usr/include/udunits2
for Linux.

refs #231
2016-05-09 10:23:19 -05:00
Alex Lin
4f3ef64002 Use udunits package for units conversions
Changed the handling of how we handle doubles and ints allowing
more mathematical operations like multiplication, division, and
some limited exponentiation.

refs #231
2016-05-09 08:36:43 -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
9e743ffa92 Invoking trick-ICG without any arguments results in a Segmentation fault
ICG dies on a strdup if the the input file is empty.  Added a check for
an empty input file name.  We exit with an error message if there is
no input file given.

refs #229
2016-04-27 11:24:03 -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
fad36fc544 trick comm byteswap functions can't handle sizes above 65536 bytes
fix indentation while I'm here.

refs #187
2016-04-19 09:19:18 -05:00
Alex Lin
8633facc86 trick comm byteswap functions can't handle sizes above 65536 bytes
sigh, I forgot to actually set the pthread specific data.

refs #187
2016-04-19 09:16:42 -05:00
Alex Lin
2cf25b9825 trick comm byteswap functions can't handle sizes above 65536 bytes
Added a pthread specific swap buffer in both tc_read and tc_write.
The buffer is resized if a thread tries to send a buffer larger than
the current swap size.

refs #187
2016-04-19 09:02:57 -05:00
Alex Lin
2381c487d1 Build fails on Ubuntu 16.04
clang changed a call in 3.8.0 from uppercase to lowercase.  I changed
pp.getBuiltinInfo().InitializeBuiltins to pp.getBuiltinInfo().initializeBuiltins

refs #174
2016-04-18 15:22:52 -05:00
Alex Lin
af781d5383 Data products will not compile if TRICK_FORCE_32BIT is set.
The makefiles need to compile the units directory and they were
not at this time.  The units need to be compiled in the native
bit size regardless of whether we are forcing 32 bit or not.

refs #225
2016-04-18 09:57:59 -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
Alex Lin
d6e01ee1c4 Ignore privacy
We need to exclude STL or other template io_src code being created with they use
a protected/private enumerations, just like classes.  Also remove a check for
a static bitfield, because you can't have a static bitfield.

refs #218
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
Alex Lin
5d9ab6e6c0 Create the conversions between quaternion and Euler angles
Test compilation requires -lpthread on Ubuntu.  Also added a .gitignore
for the test executable and object code files.

refs #216
2016-04-14 10:48:20 -05:00
Alex Lin
3ae6fc50e1 Ignore privacy
I moved the item size into the attribute structure itself.  When moving this, I did not follow
what was written before.  The difference caused problems.  Fixed it so the size
written now matches what was written before.

refs #218
2016-04-14 09:22:23 -05:00
Alex Lin
54591ec005 Ignore privacy
Found some of those uncommon cases like inheriting from templates which contain
private embedded classes.

refs #218
2016-04-13 16:07:16 -05:00
Alex Lin
6ea18b425d Ignore privacy
Removed an #if 0 section of code.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
f63f44d876 Ignore privacy
Changed the storage of offsets from bytes to bits to better handle bitfields.
Added code to track classes that are defined within other classes and are
private/protected.  These classes cannot be used in templates because our
io_src code declares variables outside of the class that would try and use
these private/protected variables.  When a template is found to use a
private/protected class it is skipped.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
314e962edf Ignore privacy
Removed the requirement of passing flags throughout ICG indicating if we are
in an inherited class or not.  Removed the init_attr friends throughout
Trick core headers.
2016-04-13 16:07:15 -05:00
Alex Lin
34090169fb Ignore privacy
Adjusted code to ignore processing templates in files with ICG:(No).  This
was not being honoroed before.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
4dad11bf45 Ignore privacy
Moved field offset calculations for inherited classes to when the inherited
classes are processed.  This removes the need to have to remember if fields
were inherited or not, the offset already reflects the correct offset.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
7dcc65d0bd Ignore privacy
Mostly working.  This removes the use of offsetof from all I/O code.  This was
the only reason we needed friends.  In it's place we put the offset value that
clang has calculated for the field.  Still need to work on virtually inherited
classes and confirm bitfields.

refs #218
2016-04-13 16:07:14 -05:00
John M. Penn
fc98f6cf0a Fix address arithmetic in ClassicCheckPointerAgent::write_rvalue. Refs #221 2016-04-13 15:39:30 -05:00
Derek Bankieris
eee36193ea refs #219 Present a dialog that allows per-unit selection for multidimensional units 2016-04-11 10:06:51 -05:00
Hung Nguyen
0da1ba7653 Merge branch 'master' of https://github.com/nasa/trick 2016-04-04 17:20:58 -05:00
Hung Nguyen
5de28a360c Added the conversion capabilities between Euler angles and quaternions. Refs:#216 2016-04-04 17:07:04 -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
b5b6dbe0bb Compiling with gcc 4.9 sometimes requires cstddef
It's the generated swig code that is missing cstddef.  Added some
includes to get cstdef in the swig code.

refs #212
2016-04-01 17:05:24 -05: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
f7c74d7872 Add direct STL checkpointing
Removed saving the namespace of a variable it is in the std namespace.
Added a check for STLs residing in std::__1 as they do on Macs.

refs #206
2016-03-29 11:01:03 -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
7bbaac1223 ATTRIBUTES for a member whose type is a typedef of a template are wrong
Maybe this is the last time we visit this issue, probably not.  We were not
processing typedefs of templates correctly... I found a way to process
all templates whether they are the actual template, or a typedef of a template,
through the same code.  They were separate before.  Fixing this issue has
reduced the overall line count in FieldVisitor. That leads me to believe
we're on the right track.

refs #203
2016-03-21 15:18:53 -05:00
Alex Lin
bb6d7f0632 Math with temperature values is not as expected.
For addition and subtraction,  we created a new routine that
only scales second units to the first.  We apply it to all
conversions when adding and subtracting, but it only changes
the temperature results, because that is the only units that
has a bias factor. The comparision conversion routines were not
changed.

refs #202
2016-03-16 16:54:25 -05:00
Alex Lin
683763680b ATTRIBUTES for a member whose type is typedef'd in a template are wrong
Forgot I was experimenting with a short name... undid that.

refs #200
2016-03-16 13:55:38 -05:00
Alex Lin
ce3ae67633 ATTRIBUTES for a member whose type is typedef'd in a template are wrong
I found that in ICG I have access to the canonical type of a variable which
in most cases is the type I should process.  Doing this eliminates the
need for some of the code that resolved typedefs because the canonical type
has already done that.

refs #200
2016-03-16 13:24:59 -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