DaySim icon indicating copy to clipboard operation
DaySim copied to clipboard

Working directory binary cached file contents can be out of sync with data files

Open PeterVermont opened this issue 8 years ago • 1 comments

There are multiple ways in which the working directory can become out of sync with its source materials.

The primary danger is that the Raw files might have changed but the binary version in the working directory not get updated. Users currently must either delete out of working directory or set ShouldRunRawConversion to true.

Proposed simplest solution: if the modification date of the source file is later than the date of the binary version then the binary version is recreated. If for some reason this is not good enough a more expensive solution would be to store the MD5Sum of the original file and always check it.

Better – rather than simply look for newer I could programmatically set the modification date on the binary file to match the original file (or store it in the files metadata). If they don’t match then I would regenerate – this will catch older files as well as newer ones.

Another example that was the original subject of this issue was that stored sampling files did not specify the sample type and therefore could be used when they shouldn't be. The sampling_weights written out to the working directory are always named sampling_weights_.bin but this does not specify what type of sampling weight it is so if the type is later changed, the program will incorrectly read in those sample files, regardless that they are not the correct kind.

I have not actually verified that this bug exists but logically think it likely.

Right now this is not much of an issue because my understanding is that people rarely f ever load samples from disk since it takes longer than calculating them.

Relevant configuration parameters are: ShouldLoadSamplingWeightsFromFile="true" SamplingWeightsSettingsType where the possible types are "SamplingWeightsSettingsSimple" or "SamplingWeightsSettings" or "SamplingWeightsSettingsSACOG"

PeterVermont avatar May 13 '16 20:05 PeterVermont