/[escript]
ViewVC logotype

Revision 2212


Jump to revision: Previous Next
Author: jfenwick
Date: Wed Jan 14 00:15:00 2009 UTC (14 years, 2 months ago)
Changed paths: 19
Log Message:
Executive summary:

This commit adds copy on write checks to operations involving shared data. 

Changes:

new #defines:
~~~~~~~~~~~~~
Data.cpp has ASSIGNMENT_MEANS_DEEPCOPY (defaults to undefined).
Defining this will put the data = operator back to making deep copies instead
of sharing data (now the default.)

Data:
~~~~~
. Added exclusiveWrite method to copy the underlying data if it is shared.
. Some operators which took python objects now call the c++ versions intead of duplicating code.

DataAbstract and offspring:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
. Added method to determine whether the data is currently shared.
. Added getVectorRO to children of DataReady.
. Added getTagRO.

. Operations which modify values in place (or return modifiable pointers) now use
a macro to check for sharing. In the case where a modification attempt is detected, it throws an exception. In the future, I will enable this only for debugging.

. This shold not really have been required but the compiler was not choosing the use the const version as I would have liked. Besides, this makes things explict.

. Moved (and de-inlined) getVector in DataConstant (It was virtual in a parent class).

Unit tests:
~~~~~~~~~~~
Added both python and c++ unit tests to check known cases of sharing and "inplace"
modification operations.

General:
~~~~~~~~
Removed some commented out code.


Changed paths

Path Details
Directorybranches/arrexp_2137_win/escript/src/Data.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/Data.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataAbstract.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataAbstract.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataConstant.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataConstant.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataEmpty.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataEmpty.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataExpanded.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataExpanded.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataReady.h modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataTagged.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/src/DataTagged.h modified , text changed
Directorybranches/arrexp_2137_win/escript/test/DataTestCase.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/test/SharedDataTestCase.cpp added
Directorybranches/arrexp_2137_win/escript/test/SharedDataTestCase.h added
Directorybranches/arrexp_2137_win/escript/test/escript_UnitTest.cpp modified , text changed
Directorybranches/arrexp_2137_win/escript/test/python/test_shared.py added
Directorybranches/arrexp_2137_win/finley/test/python/run_escriptOnFinley.py modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.26