[Developers] [ADMB Users] More -> Fwd: Summary -> ADMB V11.0 build (compile/link) time using MinGW or Visual C++ 2010 Express in Windows 7 (32 bit) - very slow

Ian Taylor - NOAA Federal ian.taylor at noaa.gov
Thu Mar 28 09:10:55 PDT 2013


Hi Developers,
I know it's not that helpful for folks like me to make suggestions that
they're not skilled enough to implement, but how hard would it be for ADMB
to add a -o option that would turn on or off the -O3 or -Ox? And wasn't -s
going to become the default at some point, or was the only proposed change
the one that Arni to set this as default in the IDE?
-Ian


On Thu, Mar 28, 2013 at 7:45 AM, Larry Jacobson (NOAA Federal) <
larry.jacobson at noaa.gov> wrote:

> Sorry, my original note summarizing approaches to reducing compile time
> for ADMB using the MinGW or Visual C++ 2010 Express compilersin Windows
> left out 3 important items.  Unfortunately, one cannot recompile e-mails.
>  In any case:
>
> 1) Optimization is turned off using the MinGW compiler by changing line
> line sym=-O3 in adcomp.bat so that it reads sym=-O.
>
> 2) Optimization is turned off using the Microsoft compiler by omitting -Ox
> from the first call to the compiler.  That is, use:
>
>> cl -c /EHsc -DUSE_LAPLACE -DWIN32 %opt% -D__MSVC32__=8 -I.
>> -I"%ADMB_HOME%"\include -I"%ADMB_HOME%"\contrib %1.cpp
>>
> instead of:
>
>> cl -c /EHsc -DUSE_LAPLACE -DWIN32 %opt% /Ox -D__MSVC32__=8 -I.
>> -I"%ADMB_HOME%"\include -I"%ADMB_HOME%"\contrib %1.cpp
>>
>
> 3) The popular IDE for Windows uses the MinGW compilerwith a slightly
> different adcomp.bat file that is probably in a directory named something
> like C:\admb\admb101-gcc452-win32\**bin. To turn off optimization in the
> IDE, change theline sym=-O3 in adcomp.bat so that it reads sym=-O(same as
> #1).  See Arni's note belowand an additional one from John Sibert below
> Arni's.
>
> Cheers!
>
>  Hi Larry,
>>
>> ADMB-IDE does not reinvent any wheels, so to compile models it just
>> invokes the "adcomp" shell script that comes with ADMB. In the compilation
>> window, you see something like:
>>
>> *** adcomp simple
>> g++ -c -O3 -Wno-deprecated -D__GNUDOS__ -Dlinux -DOPT_LIB -DUSE_LAPLACE
>> -fpermissive -I. -I"c:/admb/admb101-gcc452-**win32\include" -o
>> simple.obj simple.cpp
>>
>> The easiest way to change the compiler optimization options is to edit
>> the adcomp.bat script directly, after making a backup copy of the original.
>> Then you will see something like this in the compilation window:
>>
>> *** adcomp simple
>> g++ -whatever the adcomp.bat script does now
>>
>> Given the importance of optimization options (btw, thanks for analyzing
>> that), we might modify the "adcomp" script in the near future to allow the
>> user to set optimization options outside the script, like "adcomp -O2
>> mymodel". ADMB-IDE will then introduce a new menu entry to set those
>> options within the IDE.
>>
>> Arni
>>
>
> From John Sibert:
>
>>
>> Another way to greatly decrease compile time for applications is to break
>> the source code into  smaller pieces by changing ADMB FUNCTIONs into real
>> C++ functions. It is generally considered good practice for maintaining
>> large software projects. It is not difficult to do, but does require extra
>> work and and climbing a bit of a learning curve for the "make". A simple
>> Makefile for ADMB projects hidden on the ADMB website
>> http://www.admb-project.org/**developers/admb-developers-**
>> workshops/admb-developers-**workshop-march-13-16-2012/**
>> simple-makefile-for-admb<http://www.admb-project.org/developers/admb-developers-workshops/admb-developers-workshop-march-13-16-2012/simple-makefile-for-admb>
>> .
>>
>
> -------- Original Message --------
> Subject:        Summary -> ADMB V11.0 build (compile/link) time using
> MinGW or Visual C++ 2010 Express in Windows 7 (32 bit) - very slow
> Date:   Mon, 25 Mar 2013 07:56:56 -0400
> From:   Larry Jacobson (NOAA Federal) <larry.jacobson at noaa.gov>
> Reply-To:       Larry.Jacobson at noaa.gov
> To:     ADMB Users <Users at admb-project.org>
>
>
>
> My original question concerned speeding up ADMB builds using the MingGW
> and Microsoft 2010 Express compilers with ADMB V11.0 on a 32 bit Windows
> computer.
>
> Rick Methot, Jim Ianelli, Alen Hicks, Johnoel Ancheta and Dave Fournier
> responded.  All suggested reducing the level of optimization with the
> cpp program gets compiled.  This is done in the adcomp.bat file.
>
> Turning off optimization works wonders for compile time and has modest
> effects on run time. Build time with the Microsoft compiler dropped from
> 8.25 minutes to 0.13 minutes (not a typo!) and the run time increased by
> only 0.17 minutes.  Build time with the MinGW compiler dropped from 1.75
> minutes to 1 minute and the run time decreased by about 0.25 minutes
> (surprising but the MinGW web site said this can happen and my results
> varied a bit from trial to trial). Some results are summarized in a
> bitmap table below.
>
> I wouldn't say that there was a clear winner between Microsoft and
> MinGW.  It depends on the optimization level and whether you are
> interested in time to build or time to run.  Both are free...
>
> Rick Methot got the same results building the Stock Synthesis model
> using the Microsoft compiler. Getting rid of the optimization shortened
> the build time a lot but had little effect on run times.
>
> Johnoel Ancheta indicated that the ADMBTeam is currently working on this
> issue also.
>
> Dave Fournier recommended getting a new computer or running in Linux. I
> use the Linux option pretty routinely for ADMB models (for speed) but
> didn't test it here.  I have noticed that the compile times on Linux are
> longish too and I bet they get much shorter when the optimization level
> is reduced.  I agree with him about the new computer but with
> sequestration etc. on the horizon it is not going to happen.
>
> Alan Hicks recommended (several times) using reduced optimization for
> debugging/programming and full optimization for releases. Sounds like a
> good idea to me. Some care seems advisable because turning off the
> optimization may have unintended side effects.  I shouldn't have any
> effect on error checking during the compilation step but what do I know?
>
>
> Thanks everyone and cheers!
>
>
>
> --
> **********************
> Larry Jacobson
> National Marine Fisheries Service
> Northeast Fisheries Science Center
> 166 Water Street
> Woods Hole, MA 02543-1026
> Voice: 508-495-2317
> Fax: 508-495-2393
> E-mail: larry.jacobson at noaa.gov
> **********************
>
> --
> **********************
> Larry Jacobson
> National Marine Fisheries Service
> Northeast Fisheries Science Center
> 166 Water Street
> Woods Hole, MA 02543-1026
> Voice: 508-495-2317
> Fax: 508-495-2393
> E-mail: larry.jacobson at noaa.gov
> **********************
>
>
>
> ______________________________**_________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/**mailman/listinfo/users<http://lists.admb-project.org/mailman/listinfo/users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/developers/attachments/20130328/aacff6fd/attachment.html>


More information about the Developers mailing list