<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hello, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am fairly new to GRASS and I am having issues getting GRASS BATCH JOB to work properly. I need to run 40 r.sun calculations in less than 4 hours for my universities campus cluster that runs the linux version of grass. To do this I need
 to run 40  jobs that each perform the r.sun calculation since a single job alone could use most of the 4 hour time limit to calculate r.sun.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The basic idea of the project is that I have elevation data covering the entire extent of Alaska at about 14GB total.  R.sun is memory limited, so I have created windows for smaller regions of the elevation data that need to be run. I have
 created 40 shell files with the necessary commands/tools I need to alter the mapset region and use r.sun in only that region. An example of one of the files looks like this (all look similar except the bounding box extents change and the name of the output
 files:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">(filename  = tile_1_1.sh)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#002060">g.region --overwrite --verbose n=56.5522222216437 s=50.996666666 e=-174.444444444375 w=-180<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">r.sun -p -m --overwrite --verbose elevation=mosaic_60m@PERMANENT aspect=aspect@bdmorri2 slope=slope@bdmorri2 beam=beam_tile_1_1 diff_rad=diffuse_tile_1_1 glob_rad=to$<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">exit<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">To run these through the campus cluster externally, I created an additional 40 shell files that create a new mapset , sets the GRASS BATCH JOB as a variable and exports it, and starts grass up externally to run the file listed above and
 run the grass commands. <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">(filename=batch_tile_1_1.sh)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#002060">#!/bin/bash<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">chmod u+x  /projects/oa/akpaleo/radiation/qsub_files/tile_1_1.sh<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">export GRASS_BATCH_JOB=/project/oa/akpaleo/radiation/qsub_files/tile_1_1.sh<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">grass70 -c  /projects/oa/akpaleo/gis/grass/alaska/tile_1_1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#002060">unset GRASS_BATCH_JOB<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The big problem I am having with this step is that I always receive the error below, even though my shell files specifically use “unset GRASS_BATCH_JOB”. I have also tried manually entering this in the terminal with no success. I am obviously
 doing something wrong to get this to work correctly.<o:p></o:p></p>
<p class="MsoNormal"><span style="color:red">ERROR: Job file '/project/oa/akpaleo/radiation/qsub_files/tile_1_1.sh' has been defined in the 'GRASS_BATCH_JOB' variable but not found. Exiting.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:red">Use 'unset GRASS_BATCH_JOB' to disable batch job processing.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For now I am not submitting the job to the cluster using qsub, but rather testing it in an interactive job on the cluster and b just using the command sh command to test the files.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Bailey Morrison<o:p></o:p></p>
<p class="MsoNormal">PhD student<o:p></o:p></p>
<p class="MsoNormal">University of Illinois at Urbana-Champaign<o:p></o:p></p>
<p class="MsoNormal">Program in Ecology, Evolution, and Conservation Biology<o:p></o:p></p>
<p class="MsoNormal">Global Environmental Analysis and Remote Sensing Lab (GEARS)<o:p></o:p></p>
</div>
</body>
</html>