Skip to content

Commit 875e656

Browse files
authored
support vray parallel jobs (#98)
1 parent 2108246 commit 875e656

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

jobs/video_jobs/maya_submit.sh.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ EXTRA_ARGS="<%= extra %>"
7878
PRJ_DIR="<%= project_dir %>"
7979
SKIP_EXISTING="-skipExistingFrames <%= skip_existing %>"
8080

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.
8383
START_FRAMES=(shift <%= task_start_frames.join(' ')%>)
8484
END_FRAMES=(shift <%= task_end_frames.join(' ')%>)
8585

jobs/video_jobs/vray_submit.sh.erb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ UTIL_FILE="$TMPDIR/utils.rb"
1010
export TASK_START_FRAME="<%= start_frame %>"
1111
export TASK_END_FRAME="<%= end_frame %>"
1212

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+
1324
cat > "$UTIL_FILE" <<UTILS
1425
#!/usr/bin/env ruby
1526
@@ -56,7 +67,7 @@ vray.bin -sceneFile="<%= Shellwords.escape(file) %>" \
5667
<%= camera.present? ? "-camera='#{camera}'" : '' %> \
5768
-display=0 \
5869
<%= extra %> \
59-
-frames=<%= frames %>
70+
-frames=$TASK_START_FRAME-$TASK_END_FRAME
6071

6172
STATUS=$?
6273

0 commit comments

Comments
 (0)