<div dir="ltr"><div><br><br>On Mon, Nov 27, 2017 at 3:56 AM, Giuseppe Amatulli <<a href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a>> wrote:<br>><br>> Just finished the test with 100G and the computation finish without error. <br>><br>> So my conclusion is:<br>> even if setting the max value of RAM  in the  r.stream.basins  to memory=25000 the effective requirements is a bit less the then 100G. <br><br></div>For r.stream.basins you need to use the -m flag, otherwise everything is done in RAM. A nice enhancement for all affected r.stream.* modules would be to switch automatically to disk swap mode if the amount of memory needed for all-in-RAM processing is larger than what is allocated with the memory=MB option.<br><div><br>> A similar situation happens with r.stream.extract where the requested used RAM is a bit less then 50G. <br></div><div><br></div><div>This is strange. In my tests, r.stream.extract always uses a bit less than what is given with the memory option. I could process a raster with 11,612,160,000 cells and memory=25000 and actual peak memory consumption was about 24000 MB.</div><div><br></div><div>Markus M</div><div><br></div><div>><br>> Any thoughts?<br>><br>> Thanks you <br>> Best <br>> Giuseppe<br>><br>><br>><br>><br>><br>><br>> On 26 November 2017 at 20:33, Giuseppe Amatulli <<a href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a>> wrote:<br>>><br>>> Hi Markus M, <br>>> I re-tested (size 80490 x 142690 = 11,485,118,100 ) r.stream.extract & r.stream.basins  setting 25G  RAM  for the 2 commands with a slurm upper limit of 60G RAM.<br>>><br>>> The r.stream.extract use this RAM <br>>> ############################################################<br>>>        JobID  MaxVMSize <br>>> ------------ ---------- <br>>> 6731334.bat+  47459272K <br>>> ############################################################<br>>> and finish without problem <br>>><br>>> rather r.stream.basins use <br>>> ############################################################<br>>>        JobID  MaxVMSize <br>>> ------------ ---------- <br>>> 6731334.bat+  90241708K <br>>> ############################################################<br>>> and get kill with this error. <br>>><br>>> Reading raster map <stream>...<br>>> 0..3..6..9..12..15../var/spool/slurmd/job6731334/slurm_script: line 88: 15041 Bus error               /gpfs/home/fas/sbsc/ga254/.grass7/addons/bin/r.stream.basins -l stream_rast=stream direction=dir basins=lbasin memory=25000 --o --verbose<br>>><br>>> I think something is implemented different in r.stream.basins compare to r.stream.extract. <br>>> I will try to ask for more RAM (100G) but I'm afraid that is going to fail again. <br>>><br>>> Any thoughts?<br>>><br>>> Thanks you <br>>> Best <br>>> Giuseppe<br>>><br>>><br>>><br>>><br>>><br>>><br>>><br>>><br>>><br>>><br>>>    <br>>><br>>> On 17 November 2017 at 03:33, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br>>>><br>>>><br>>>><br>>>> On Thu, Nov 16, 2017 at 10:51 PM, Giuseppe Amatulli <<a href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a>> wrote:<br>>>> ><br>>>> ><br>>>> > Hi Markus  M.<br>>>> ><br>>>> > I was testing the r.stream.extract for 2 tiff<br>>>> ><br>>>> > 1) 80040 x 72870 = 5,832,514,800 i got the stream results - no error<br>>>><br>>>> Great, that means large maps with more than 2 billion cells are supported.<br>>>> ><br>>>> > 2) 80490 x 142690 = 11,485,118,100 i got the following error<br>>>> ><br>>>> > A* Search...<br>>>> > 0..2../var/spool/slurmd/job6514787/slurm_script: line 80: 28925 Bus error               r.stream.extract elevation=elv accumulation=upa threshold=0.5 depression=dep direction=dir stream_raster=stream memory=45000 --o --verbose<br>>>><br>>>> From wikipedia:<br>>>> "a bus error is a fault raised by hardware, notifying an operating system (OS) that a process is trying to access memory that the CPU cannot physically address: an invalid address for the address bus, hence the name."<br>>>><br>>>> I guess you either need to raise the RAM limit in slurm or slightly reduce the memory option for r.stream.extract.<br>>>><br>>>> Markus M<br>>>><br>>>> ><br>>>> > Do you think that is something with the slurm ram limitation or is something with the r.extract.stream?<br>>>> > If the the stream output have a number of stream segments larger than 2,147,483,647 what is happen?<br>>>> > Do I get an error or all the value larger than   2,147,483,647 are just rounded to 2,147,483,647 ?<br>>>> ><br>>>> ><br>>>> > Moreover, if use the stream obtain from option 1) and I use the stream as input for the r.stream.basins  <br>>>> > I got the following error<br>>>> ><br>>>> > reading raster map <stream>...<br>>>> > 0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45../var/spool/slurmd/job6514788/slurm_script: line 82: 17687 Bus error               /gpfs/home/fas/sbsc/ga254/.grass7/addons/bin/r.stream.basins -l stream_rast=stream direction=dir<br>>>> ><br>>>> > is this something that need to be fixed in r.stream.basins, or should i think that is due to other problems<br>>>> ><br>>>> > Thank you<br>>>> > Giuseppe<br>>>> ><br>>>> ><br>>>> ><br>>>> ><br>>>> > On 10 November 2017 at 11:21, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>>>> >><br>>>> >> On Wed, Nov 1, 2017 at 10:12 PM, Markus Metz<br>>>> >> <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br>>>> >> > On Wed, Nov 1, 2017 at 7:15 PM, Giuseppe Amatulli<br>>>> >> > <<a href="mailto:giuseppe.amatulli@gmail.com">giuseppe.amatulli@gmail.com</a>> wrote:<br>>>> >> >><br>>>> >> >> Thanks Markus!!<br>>>> >> >> I will test and I will let you know how it works.<br>>>> >> ><br>>>> >> > Your feedback is very helpful!<br>>>> >> >><br>>>> >> >> I have few  more questions<br>>>> >> >> 1) now how much is the upper limit matrix cell number that<br>>>> >> >> r.stream.extract can handle?<br>>>> >> ><br>>>> >> > About 1.15e+18 cells.<br>>>> >> ><br>>>> >> > Another limitation is the number of detected stream segments. This must not<br>>>> >> > be larger than 2,147,483,647 streams,<br>>>> >> ...<br>>>> >><br>>>> >> (Added as a note to<br>>>> >>  <a href="https://grasswiki.osgeo.org/wiki/GRASS_GIS_Performance#Some_benchmarks">https://grasswiki.osgeo.org/wiki/GRASS_GIS_Performance#Some_benchmarks</a><br>>>> >> )<br>>>> >><br>>>> >> best,<br>>>> >> markusN<br>>>> ><br>>>> ><br>>>> ><br>>>> ><br>>>> > --<br>>>> > Giuseppe Amatulli, Ph.D.<br>>>> ><br>>>> > Research scientist at<br>>>> > Yale School of Forestry & Environmental Studies<br>>>> > Yale Center for Research Computing<br>>>> > Center for Science and Social Science Information<br>>>> > New Haven, 06511<br>>>> > Teaching: <a href="http://spatial-ecology.net">http://spatial-ecology.net</a><br>>>> > Work:  <a href="https://environment.yale.edu/profile/giuseppe-amatulli/">https://environment.yale.edu/profile/giuseppe-amatulli/</a><br>>>><br>>><br>>><br>>><br>>> --<br>>> Giuseppe Amatulli, Ph.D.<br>>><br>>> Research scientist at<br>>> Yale School of Forestry & Environmental Studies<br>>> Yale Center for Research Computing<br>>> Center for Science and Social Science Information<br>>> New Haven, 06511<br>>> Teaching: <a href="http://spatial-ecology.net">http://spatial-ecology.net</a><br>>> Work:  <a href="https://environment.yale.edu/profile/giuseppe-amatulli/">https://environment.yale.edu/profile/giuseppe-amatulli/</a><br>><br>><br>><br>><br>> --<br>> Giuseppe Amatulli, Ph.D.<br>><br>> Research scientist at<br>> Yale School of Forestry & Environmental Studies<br>> Yale Center for Research Computing<br>> Center for Science and Social Science Information<br>> New Haven, 06511<br>> Teaching: <a href="http://spatial-ecology.net">http://spatial-ecology.net</a><br>> Work:  <a href="https://environment.yale.edu/profile/giuseppe-amatulli/">https://environment.yale.edu/profile/giuseppe-amatulli/</a><br><br></div></div>