DSim Cloud File Synchronization
Overview
To easily run simulations in the cloud, DSim Cloud synchronizes all files, recursively, within the local root origin (the directory where the mdc initialize
command was executed) to the remote compute within the /remote/work directory. To provide a seamless user experience, this synchronization is done automatically for the user in a performance-friendly manner. For example, after initialization of a new workspace, only files that have changed are re-uploaded to the remote compute.
The synchronization of files is one-way only (from local to remote) meaning a file deleted, added or changed on the remote compute is not synced back to the local compute.
The user has control over which files are synchronized by modifying the mdc_ignore file contained within the local root origin. By default, waveform DBs, downloaded files and a few other file patterns outlined later in this article are ignored.
The synchronization operation occurs at the following commands:
mdc initialize
mdc list
mdc dsim
mdc dvhcom
mdc dvlcom
mdc dlib
mdc dvhencrypt
mdc dvlencrypt
mdc envs
See the below sections of this article for additional details on the functionality invoked at each of the above steps.
When synchronizing, an informational message is printed to the screen, providing statistics on the total number of files synchronized and the size of data transfer, along with a status bar to indicate progress of the upload.
The output is similar to the message below.
Synchronization on Initialization
When users initialize a new workspace using the mdc initialize
command, all files within the local root origin directory, other than those files that match patterns within the mdc_ignore file, will be synchronized to the remote compute recursively. The time taken to perform the initial synchronization will scale according to the size of the upload to the remote file system.
Upon execution of the mdc initialize
command, a default mdc_ignore file is written to the local root origin directory. If a mdc_ignore file already exists (e.g. user has previously destroyed a workspace at the same location) the previous mdc_ignore will be re-used (will not be overwritten.)
For more information on the mdc_ignore file see Ignoring File Patterns.
If users find that the initial file synchronization is uploading too many files, as of the DSim Cloud 0.4.0 release, the mdc initialize
command can be interrupted in order to make adjustments to the directory contents or the mdc_ignore file. See Using Ctrl-C to Interrupt File Synchronization for more information.
Synchronization on Commands
When users perform a command such as mdc dsim -a '-help'
, all changes in the local root origin will be synchronized to the remote workspace (except those whose name matches the patterns in the mdc_ignore) prior to the command executing. When synchronizing, an informational message is printed to the screen, providing statistics on the total number of files synchronized and the size of data transfer.
If users find that the file synchronization on any command is uploading too many files, the command can be interrupted in order to make adjustments to the directory contents or the mdc_ignore file. See Using Ctrl-C to Interrupt File Synchronization for more information.
Ignoring File Patterns
Any file/directory names that match the patterns in the mdc_ignore file will be ignored during a sync operation. Users can add specific file/directory patterns of choice by modifying the mdc_ignore file directly.
The default mdc_ignore file contains the following:
# Default file patterns to ignore when synchronizing files to the remote disk *.log # Waveform databases *.vcd *.mxd # Downloaded files from the remote disk _downloaded_* # Git directory .git*
Additionally, any .mdc
directory found within the local origin directory will not be synchronized.
The syntax used within the mdc_ignore uses the rsync/git ignore pattern format which is a newline-separated list of glob patterns. Comments can be added to the file by starting the line with #
.
If a user accidentally deletes the mdc_ignore file, no ignoring of files/directories will occur. However, any .mdc
directory found within the local workspace root shall be ignored automatically, without requiring users to add this to the mdc_ignore file (even if the ignore file doesn't exist)
Additional Notes
git Technology
It is worthwhile to note that the underlying technology being used for DSim Cloud file synchronization is git. As a result, the following should be noted:
- Symbolic links will be treated as they are by git
- The syntax of the mdc_ignore file uses git ignore pattern format (which is a newline-separated list of glob patterns)
Using Ctrl-C to Interrupt File Synchronization
Entering the key combination Ctrl-C together on the local terminal after the following commands are launched and on, or before, the file sync stage will interrupt any of the following commands' file sync stage:
-
mdc initialize
- In the event that Ctrl-C is used to interrupt the initial file synchronization, all files will be synchronized again at the next simulation command
mdc list
mdc dsim
mdc dvhcom
mdc dvlcom
mdc dlib
mdc dvhencrypt
mdc dvlencrypt
mdc envs
There is an exception in that, if the user enters Ctrl+C at a point after the upload of the change manifest (upload progress bar is no longer visible on screen), the file sync operation will continue to completion.
Conflict Resolution
The local root origin directory will always be considered as the Single Source of Truth (SSOT). As a result, conflict resolution is always one way. Any changes in the local root origin directory override changes on the remote system.
Below are a few examples:
-
If a command overwrites a synced file, the file will be synced again from the user's local root origin directory upon the next sync operation
-
If file sync overwrites a simulation artifact (say, a waveform file) this will be silently accepted
-
If a file is deleted in the local root origin directory it should be removed from the remote directory (regardless if it is changed or not there)
File Permissions
-
All files uploaded to the remote workspace should have read and write permissions, regardless of local permissions
-
Execute permission on specific files/directories is synced from the local filesystem (for both user and group)
Miscellaneous
-
If the user kills an
mdc
command (e.g. kill -9) before the end of the file synchronization, it is allowed to have corrupted files on the remote disk -
Running two (or more) sync operations at the same time can result in an unstable transient status of a file, but must end up with one of the versions of the file.
-
A sync operation, while another command is executed, is allowed to change files. This may cause an unknown result of the command.