[FLASH-USERS] changing maxblocks

Seyit Hocuk seyit at mpe.mpg.de
Fri Aug 28 12:14:59 EDT 2015


Actually, you can increase MAXBLOCK without running setup again. I do it 
all the time. However, what Sean says is of course the more proper thing 
to do.

Still, if you are like me such that it feels like running setup again is 
a ton of work, you can do the following. There are two places where you 
need to change this value in Flash.h and Makefile. Do it manually an 
then recompile, i.e., "make" the code again. It will automatically 
recompile everything as it notices something major has changed.

You can also use my script. Just running this script and giving new 
value should change maxblocks. Btw. I am in no way responsible if it 
doesn't work out :)

Best,
Seyit



#!/bin/bash

declare filea=Makefile
declare fileb=Flash.h

read nblocks

echo
echo
echo 'Files to be changed:' $filea $fileb
echo 'new nblocks:' $nblocks

sed -i -e s/"DMAXBLOCKS=[0-9]*"/"DMAXBLOCKS=$nblocks"/g $filea
sed -i -e s/"define MAXBLOCKS [0-9]*"/"define MAXBLOCKS $nblocks"/g $fileb

make clean
make -j 3




On 28/08/15 18:02, Slavin, Jonathan wrote:
> The issue is that "just running setup again" means, I think, that you 
> start over with some pre-defined simulation and lose all the bits you 
> changed.  Or maybe I'm misunderstanding how setup works. Isn't the 
> reason for having MAXBLOCKS in a header file that it can be taken from 
> there for all the files that use it?  If not, it would be multiply 
> defined, which would be bad practice.
>
> Jon
>
> On Fri, Aug 28, 2015 at 11:55 AM, Sean Couch <smc at flash.uchicago.edu 
> <mailto:smc at flash.uchicago.edu>> wrote:
>
>     Argh.  Don’t do that. Flash.h should not be edited as it may cause
>     unexpected side effects.  AAAND, you will have to recompile the
>     code anyway so that the new value of MAXBLOCKS is used.  Since
>     MAXBLOCKS appears in a ton of code, the cost of just running setup
>     again is not that much more.
>
>     Sean
>
>>     On Aug 28, 2015, at 11:50 AM, Slavin, Jonathan
>>     <jslavin at cfa.harvard.edu <mailto:jslavin at cfa.harvard.edu>> wrote:
>>
>>     Hi Nasiri,
>>
>>     I wondered about that.  I saw that it was set there, but wondered
>>     if doing that would cause some other problems.  In the User's
>>     Guide it says "The Flash.h file is written by the setup script
>>     and should not be modified by the user."  I don't know why that
>>     should be.
>>
>>     Jon
>>
>>     On Fri, Aug 28, 2015 at 11:43 AM, Nasiri, Farshad
>>     <fnasiri at email.gwu.edu <mailto:fnasiri at email.gwu.edu>> wrote:
>>
>>         You can modify that in Flash.h.
>>
>>
>>         On Friday, August 28, 2015, Slavin, Jonathan
>>         <jslavin at cfa.harvard.edu <mailto:jslavin at cfa.harvard.edu>> wrote:
>>
>>             Hi,
>>
>>             I'm pretty new to using FLASH. I've run some simulations
>>             that started with the sedov setup, though I've modified
>>             the Simulation_initBlock.F90 and a few other files.  I
>>             ran into, what appears to be, a common problem, which is
>>             an MPI_Abort caused by a PARAMESH ERROR with the message
>>             (in amr.log): New block location exceeds MAXBLOCKS limit
>>              Suggestion: increase MAXBLOCKS or modify refinement
>>             criteria.
>>
>>             My question is, if I just want to increase MAXBLOCKS, can
>>             I do that without running setup again?  If so, how?  I'll
>>             note that I've been using flmake, which allows for use of
>>             a different directory other than "object".  Thanks in
>>             advance for any help.
>>
>>             Regards,
>>             Jon
>>
>>             -- 
>>             ________________________________________________________
>>             Jonathan D. Slavin Harvard-Smithsonian CfA
>>             jslavin at cfa.harvard.edu    60 Garden Street, MS 83
>>             phone: (617) 496-7981 <tel:%28617%29%20496-7981>
>>             Cambridge, MA 02138-1516
>>             cell: (781) 363-0035 <tel:%28781%29%20363-0035>   USA
>>             ________________________________________________________
>>
>>
>>
>>
>>     -- 
>>     ________________________________________________________
>>     Jonathan D. Slavin Harvard-Smithsonian CfA
>>     jslavin at cfa.harvard.edu <mailto:jslavin at cfa.harvard.edu>    60
>>     Garden Street, MS 83
>>     phone: (617) 496-7981 <tel:%28617%29%20496-7981>    Cambridge, MA
>>     02138-1516
>>     cell: (781) 363-0035 <tel:%28781%29%20363-0035>             USA
>>     ________________________________________________________
>>
>
>
>
>
> -- 
> ________________________________________________________
> Jonathan D. Slavin                 Harvard-Smithsonian CfA
> jslavin at cfa.harvard.edu <mailto:jslavin at cfa.harvard.edu>    60 Garden 
> Street, MS 83
> phone: (617) 496-7981       Cambridge, MA 02138-1516
> cell: (781) 363-0035             USA
> ________________________________________________________
>

-- 
Dr. S. Hocuk
Postdoctoral reseacher
Center for Astrochemical Studies (CAS)
Max-Planck-Institute for Extraterrestrial physics (MPE)
Giessenbachstrasse, 85748 Garching
Tel: +49-8930000-3012
Fax: +49-8930000-3569
Web: www.mpe.mpg.de/~seyit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20150828/ac3d03a7/attachment-0001.htm>


More information about the flash-users mailing list