Currently, if you import a genesis file to create an smtk model, the process of saving that resource will create a uuid-named exodus file in the same directory as the resource (.smtk) file. I believe this strategy is done in order to avoid potential conflict if the native model is later modified or deleted. But this can also consume large amounts of redundant disk data if a large native model is imported into multiple resources.
To save disk space, I propose adding an option to the smtk resource system to support model resources loading the original native model file, instead of creating/using a copy.
- The current logic for saving resources (creating a copy of the native model) will remain the default behavior; using the native model in-place will be an option (VoidItem) added to model import operations.
- The proposed option creates a greater risk of “breaking” a resource by moving, deleting, or editing the native model; users will have to accept the risk when using this feature. To prevent changes to a native model from crashing CMB, I propose that the model resource store an md5sum of the native model file, and check it before each read operation and update it after every write operation. (Other operations involving disk I/O would also need to be modified accordingly.)
- The new option could impact moving a model resource within its current filesystem (presuming the resource stores a relative path to the native model). Addressing this needs more discussion.
- The new option certainly affects the ability to copy resources from one machine to another. For this, I propose we add an archive operation to bundle resource files with their native model files.