The trim Stage
The purpose of the trim stage is to automatically delete unwanted stage data files. A common scenario is that most of the relaxation stage files are not needed if the job is successful. Adding a properly-set trim stage at the end of the job automatically removes the these files before they are transferred back to the launch directory. The following example illustrates how a trim stage might be used:
task {
task = "desmond:auto"
}
minimize {
# relaxation stage
}
simulate {
# relaxation stage
}
simulate {
# production stage
}
trim {
save = [-1]
}
The save keyword is the only trim-specific keyword and specifies stages for which the output files should be kept. Its value is a list of integers. The integers can be either positive or negative. Positive integers are the stage index, negative integers are relative to the trim stage, i.e. they refer to stages counting backwards from the trim stage. In this example, -1 means the first stage before this trim stage, i.e. the production stage or the 4th stage. So the trim stage removes all .tgz files that were generated by the earlier stages except for the one generated by the production stage. Counting is 1-indexed.
The following setting for the above example saves the .tgz files generated by the 3rd and 4th stages (the two stages before the trim stage):
save = [-1 -2]
The following setting saves the .tgz files generated by the 2nd, 3rd, and 4th stages
save = [2 3 -1]
Note that the task counts as a stage.