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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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
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
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
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
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
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
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
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
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
Changed the handling of how we handle doubles and ints allowing
more mathematical operations like multiplication, division, and
some limited exponentiation.
refs #231
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
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
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
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
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
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
clang changed a call in 3.8.0 from uppercase to lowercase. I changed
pp.getBuiltinInfo().InitializeBuiltins to pp.getBuiltinInfo().initializeBuiltins
refs #174
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
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
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
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
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
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.
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
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
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
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
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]
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
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
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
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
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
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
Interesting case. I found that we should process the canonical type names where
we were not before. This resolves all typedefs and should be be more
accurate in the future. When we process the canonical type we need to ignore
the processing of the non-canonical type. We set a flag after
the canonical type is processed to ignore any type that is processed after.
refs #198
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
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
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
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
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
We pull file names out of the clang infrastructure to match where
classes are defined. We use the file name to pull comments and find
and process Trick header comments. Up to now clang gave us the realpath
of files and when we looked up comments we already had the realpath and
everything worked. In clang 3.6 in some places we are not getting the
realpath anymore which confuses ICG. Added code to get the realpath of
any file name we use throughout the code.
refs #167
I want Trick to parse and understand ODE header files. The ODE header files
include some typedef constructs ICG was skipping. Added code to handle the
typedefs we did not handle before. Also made a small change the way
TRICK_ICG_EXCLDUE and TRICK_EXCLUDE are used so that they support excluding
individual files as well as directories.
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
Found that the stripchart calls itself when reading variables
from an input file. The command to call itself was using the old
executable name trick_stripchart instead of the new trick-stripchart.
refs #166
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
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
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
The makefile rule javadoc was misnamed docs in trick_source/java/makefile. I fixed hundreds
of warnings and errors that were present when creating the java docs.
refs #159
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
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
When a template is in a namespace the type that is marked for the node containing
the full definition of the type is elaborated. We need to go into
the elaborated name and get the underlying type. Added code to do this
and tests to see if the type we are checking is itself a template or the
elaborated type is a template. Sorry, this probably only makes sense to me.
refs #124
Wrote a python routine called get_value_by_ref_name that takes
a variable name string as an argument. The string is passed to
ref_attributes to find the address and returns a REF2 structure. The REF2
structure is passed to ref_to_value and the type and value of the variable
is returned in a structure. We call vval_<type> to extract the raw value
from the structure and return that to python space.
Made a couple of other bug fixes in the FieldVisior and cpp input file
example found while investigating this issue.
refs #123
Removed all motif dependencies. I removed the motif based table renderer that
is duplicated here in gxplot. The same table renderer is in fxplot with one
main difference, the one in fxplot actually renders tables, this one was not
working. Also removed an error message dialog box that depended on
motif, replacing them with std::cerr calls. Removed -lXm when linking gxplot
refs #121
Added a case statement for the bad ref type to the binary data handler. We handle a bad
ref as an integer, because that is what the sim sends us. This fixes MTV.
refs #117
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
Changed parenthesis to curly brace... er I mean curly bracket. Well too late, in
the code I called it curly brace. It's these "{}". Oh well. Also found that the
dependency_only headers were not actually reading the dependencies. Added the list
of dependency only files to the list of files to get dependencies from.
refs #114
Added new doxygen style tags for truning on/off Trick attributes processing,
comment processing, and library dependencies. Here are the tags we recognize
(@|\)trick_parse(everything|attributes|dependencies_only)
(@|\)trick_exclude_typename(class_name)
(@|\)trick_link_dependency(link_name)
refs #114
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
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
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
Well sims compiled, but I forgot to test if Trick itself
would compile. It didn't. Added TRICK_SYSTEM_CFLAGS and
TRICK_SYSTEM_CXXFLAGS where needed.
refs #90
Created TRICK_SYSTEM_CFLAGS, TRICK_SYSTEM_CXXFLAGS, and TRICK_SYSTEM_SFLAGS
that Trick uses to add the Trick system includes, defines and other
compilation flags. TRICK_CFLAGS and TRICK_CXXFLAGS are now in
full control of the user.
refs #90
Added a new TRICK_EXT_LIB_DIRS variable that allows users to
tell Trick about external libraries, rather than trying to
use TRICK_EXCLUDE. Added back getting multiple library dependency
sections from source files.
refs #86
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
First tests are working. Changing a source file and header works
as before. Adding library dependencies in either of these files
causes the makefile pieces to be redone. Only tested in the ball
sim so far.
refs #86
Functioning build directory on Linux. Everything is going into the build directory.
All files for all steps use the full path. this change removes the need for us to
call depend_objs to fix makefile dependencies. Changed the makefile rules to use
more pattern rules reducing the size of make_makefile.pm and the makefile too.
Changed the output of make to show short commands for each compile line. Setting
the variable TRICK_VERBOSE_BUILD in the environement, command line, or in S_overrides.mk
will change the output to the full printout.
refs #80
Moved most generated files into the build directory. All object code,
io_src realated files, and swig related files are now in build.
Realized that ICG should be creating the makefile for the io_src
code. ICG knows which files it created.
refs #80