[GE users] Povray demo ...

yogi byogi at yahoo.com
Mon Dec 22 11:13:06 GMT 2008


Hi Reuti and all,

> Am 21.12.2008 um 12:18 schrieb yogi:
> 
> >>>> <snip>
> >>
> > I 'm using POVRAY-3.6.1 compiled from source.
> >
> > My jobscript looks like
> >
> >
>
/Cluster/apps/gridengine-demo/GridRayTrace/sge_pov_submit.sh
> 
> But what is sge_pov_submit.sh - is it part of povray?
> 

This script is from gridengine demo which is available at
http://gridengine-demo.sunsource.net/

Listed below is the script 

--snip--
#!/bin/sh
#___INFO__MARK_BEGIN__
##########################################################################
#
#  The Contents of this file are made available subject to
the terms of
#  the Sun Industry Standards Source License Version 1.2
#
#  Sun Microsystems Inc., March, 2001
#
#
#  Sun Industry Standards Source License Version 1.2
#  =================================================
#  The contents of this file are subject to the Sun
Industry Standards
#  Source License Version 1.2 (the "License"); You may not
use this file
#  except in compliance with the License. You may obtain a
copy of the
#  License at
http://gridengine.sunsource.net/Gridengine_SISSL_license.html
#
#  Software provided under this License is provided on an
"AS IS" basis,
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING,
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE
OF DEFECTS,
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR
NON-INFRINGING.
#  See the License for the specific provisions governing
your rights and
#  obligations concerning the Software.
#
#  The Initial Developer of the Original Code is: Sun
Microsystems, Inc.
#
#   Copyright: 2007 by Sun Microsystems, Inc.
#
#  All Rights Reserved.
#
##########################################################################
#___INFO__MARK_END__

# Setup
-------------------------------------------------------------------
JPOV_HOME=`dirname $0`
JPOV_HOME=`cd $JPOV_HOME; pwd`

usage() {
   echo "pov_submit.sh <scene> <output_dir> <width>
<height> <tasks>"
   echo ""
   echo "Options:"
   echo ""
   echo "<scene>       path to the pov ray scene file"
   echo "<output_dir>  directory where pov ray stores temp
results"
   echo "<width>       with of the generated image in
pixel"
   echo "<height>      height of the generated images in
pixel"
   echo "<task>        number of submited array tasks"
   echo ""
   exit 1
}

if [ $# -ne 5 ]; then
   usage
fi

scene=$1
output_dir=$2
width=$3
height=$4
tasks=$5
row_per_tile=`expr $height / $tasks`

echo "Starting GUI"
java -jar $JPOV_HOME/dist/JPov.jar $output_dir img .ppm
$width $height > /dev/null 2>&1 &
echo "java -jar $JPOV_HOME/dist/JPov.jar $output_dir img
..ppm $width $height" 

echo qsub -q 'darwin.q' -t 1-$tasks \
     -j y -o "${output_dir}/$JOB_NAME.$JOB_ID.$TASK_ID" \
     -sync y \
     $JPOV_HOME/sge_povrun.sh $scene $output_dir img .ppm
$width $height $row_per_tile

qsub -q 'darwin.q' -t 1-$tasks \
     -j y -o "${output_dir}/$JOB_NAME.$JOB_ID.$TASK_ID" \
     -sync y \
     $JPOV_HOME/sge_povrun.sh $scene $output_dir img .ppm
$width $height $row_per_tile

echo "Rendering jobs finished"

---snip---

Also I'm listing "sge_povrun.sh"

---snip---
#!/bin/sh
#$ -S /bin/sh -N POVRay_Demo
#___INFO__MARK_BEGIN__
##########################################################################
#
#  The Contents of this file are made available subject to
the terms of
#  the Sun Industry Standards Source License Version 1.2
#
#  Sun Microsystems Inc., March, 2001
#
#
#  Sun Industry Standards Source License Version 1.2
#  =================================================
#  The contents of this file are subject to the Sun
Industry Standards
#  Source License Version 1.2 (the "License"); You may not
use this file
#  except in compliance with the License. You may obtain a
copy of the
#  License at
http://gridengine.sunsource.net/Gridengine_SISSL_license.html
#
#  Software provided under this License is provided on an
"AS IS" basis,
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING,
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE
OF DEFECTS,
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR
NON-INFRINGING.
#  See the License for the specific provisions governing
your rights and
#  obligations concerning the Software.
#
#  The Initial Developer of the Original Code is: Sun
Microsystems, Inc.
#
#   Copyright: 2007 by Sun Microsystems, Inc.
#
#  All Rights Reserved.
#
##########################################################################
#___INFO__MARK_END__
#
#  Submit script for Grid Engine Ray Tracing Demo
#

# Setup
-------------------------------------------------------------------
POVRAY=/usr/local/bin/povray
POVRAY_INST_DIR=/usr/local

usage() {
   echo "sge_povray.sh <scene> <output_dir> <prefix>
<suffix> <img_width> <img_height> <rows_per_tile>"
   exit 1
}

if [ $# -ne 7 ]; then
   usage
fi

scene=$1
scene_dir=`dirname $scene`
outputdir=$2
prefix=$3
suffix=$4
img_width=$5
img_height=$6
rows_per_tile=$7

tile_nr=`expr $SGE_TASK_ID - 1`
start_row=`expr $tile_nr \* $rows_per_tile`
end_row=`expr $SGE_TASK_ID \* $rows_per_tile`

if [ $start_row -gt $img_height ]; then
   echo "rows out of range"
   exit 0
fi


outfile=${outputdir}/${prefix}${SGE_TASK_ID}${suffix}
tmpfile=${outputdir}/${prefix}${SGE_TASK_ID}.$$.${suffix}

host=`hostname`
echo "Rendering rows $start_row ... $end_row on $host  =>
$outfile"

$POVRAY  +O${tmpfile} \
        +L${POVRAY_INST_DIR}/share/povray-3.6/include \
        +W$img_width +H$img_height +FP +SR$start_row
+ER$end_row $scene
#   > /dev/null 2>&1

if [ $? -ne 0 ]; then
   echo "povray failed"
   exit 1
fi
if [ -f $tmpfile ]; then
   echo "$start_row $end_row" > ${tmpfile}.1
   cat $tmpfile >> ${tmpfile}.1
   mv ${tmpfile}.1 $outfile
   rm $tmpfile
else
   echo "Error file $tmpfile not found"
---snip--


> -- Reuti
> 
> 
> >
>
/usr/local/share/povray-3.6/scenes/camera/ultra_wide_angle.pov
> > /tmp/grid_pov  1280  1024 100
> >
> > ------------------------------------------------------
> > http://gridengine.sunsource.net/ds/viewMessage.do? 
> > dsForumId=38&dsMessageId=93647
> >
> > To unsubscribe from this discussion, e-mail: [users- 
> > unsubscribe at gridengine.sunsource.net].
> >
> 
> ------------------------------------------------------
>
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=93723
> 
> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe at gridengine.sunsource.net].
> 

Any pointers ... ?

Thanks
yogi

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=93843

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list