File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ EXTRA_ARGS="<%= extra %>"
78
78
PRJ_DIR=" <%= project_dir %>"
79
79
SKIP_EXISTING=" -skipExistingFrames <%= skip_existing %>"
80
80
81
- # added 'shift' to this array so we don't have to deal with SLURM_ARRAY_TASK_ID-1
82
- # calculations, we can just shift right +1
81
+ # added 'shift' to this array as the 0th index because SLURM_ARRAY_TASK_ID is always
82
+ # greater than or equal to 1.
83
83
START_FRAMES=(shift < %= task_start_frames.join(' ' )%> )
84
84
END_FRAMES=(shift < %= task_end_frames.join(' ' )%> )
85
85
Original file line number Diff line number Diff line change @@ -10,6 +10,17 @@ UTIL_FILE="$TMPDIR/utils.rb"
10
10
export TASK_START_FRAME=" <%= start_frame %>"
11
11
export TASK_END_FRAME=" <%= end_frame %>"
12
12
13
+ # added 'shift' to this array as the 0th index because SLURM_ARRAY_TASK_ID is always
14
+ # greater than or equal to 1.
15
+ START_FRAMES=(shift < %= task_start_frames.join(' ' )%> )
16
+ END_FRAMES=(shift < %= task_end_frames.join(' ' )%> )
17
+
18
+ # if it's a single node, SLURM_ARRAY_TASK_ID isn't set so set it to 1
19
+ [ -n " $SLURM_ARRAY_TASK_ID " ] || SLURM_ARRAY_TASK_ID=1
20
+
21
+ export TASK_START_FRAME=${START_FRAMES[$SLURM_ARRAY_TASK_ID]}
22
+ export TASK_END_FRAME=${END_FRAMES[$SLURM_ARRAY_TASK_ID]}
23
+
13
24
cat > " $UTIL_FILE " << UTILS
14
25
#!/usr/bin/env ruby
15
26
@@ -56,7 +67,7 @@ vray.bin -sceneFile="<%= Shellwords.escape(file) %>" \
56
67
< %= camera.present? ? " -camera='#{camera}'" : ' ' %> \
57
68
-display=0 \
58
69
< %= extra %> \
59
- -frames=< %= frames % >
70
+ -frames=$TASK_START_FRAME - $TASK_END_FRAME
60
71
61
72
STATUS=$?
62
73
You can’t perform that action at this time.
0 commit comments