1 / 10

Using GEMPACK effectively with GTAP

Using GEMPACK effectively with GTAP. Michael Jerie Centre of Policy Studies, Monash University. Presented at the GTAP 13th annual conference, Penang, Malaysia, June 9-11, 2010. 1. Faster GTAP with GEMPACK 10.0.

thor
Download Presentation

Using GEMPACK effectively with GTAP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using GEMPACK effectively with GTAP Michael Jerie Centre of Policy Studies, Monash University. Presented at the GTAP 13th annual conference, Penang, Malaysia, June 9-11, 2010. 1

  2. Faster GTAP with GEMPACK 10.0 Example: Solving standard GTAP, 30 regions and 30 sectors, Gragg 3-5-7 solution method (on a PC with an Intel Q9550 – 2.83 GHz CPU). Using GEMPACK Release 9.0-003 (August 2006) with Lahey Fortran LF95, solution time is 322 seconds. Using GEMPACK Release 10.0-001 (April 2009) with Intel Fortran, solution time is 101 seconds (less than 1/3 of the 2006 time) Time saving improvements come from - more effective pivot reuse - Intel Fortran optimized GP libraries and model exe Using parallelization introduced with GEMPACK 10.0 [servants=1], solution time is 78 seconds (less than 1/4 of the 2006 time). 2

  3. 64-bit computing with GEMPACK 64-bit operating systems and cheap memory allow desktop computing with large amounts of available RAM. (Modellers are freed from the old limits: maximum 4 GB memory for 32-bit Windows, and, maximum 2 GB limit for a single program.) Since GEMPACK 10.0 (May 2008), the Intel Visual Fortran compiler can be used with Source-code GP. On 64-bit Windows, using GEMPACK and the Intel Fortran compiler you can make and run 64-bit models, or, make and run 32-bit models. Both have greater memory access compared to the 32-bit Windows environment. Note: 64-bit programs are not ‘faster’ than 32-bit programs. 3

  4. 64-bit computing with GEMPACK Using 64-bit Windows and GEMPACK 10.0 (May 2008) or later A 64-bit Tablo-generated program allows use of up to about (24+8) = 32 GB of memory. Fully disaggregated GTAP can be solved (6 GB). Using 64-bit Windows and GEMPACK 10.0-002 (April 2010) A 32-bit Tablo-generated program allows use of up to 4 GB of memory (using large address aware exe’s). ViewHAR, ViewSOL and AnalysGE can use up to 4 GB memory. This allows large data or solution files to be opened. 4

  5. LTG Optimization with Intel Fortran • Since GEMPACK 10.0 compiling with fast /O1 Intel Fortran optimization has been available during the LTG step (after TABLO code generation). • Since GEMPACK 10.0-001 fast /O1 compiler optimization is used by default when you run LTG. The effect of this is • LTG takes longer, but • Model exe runs faster • During model development, the LTG – run – debug – LTG cycle can mean frequent LTG’ing. We provide BAT files to change LTG optimization level. • Run LTGfigo0.BAT to use no optimization during LTG, then • LTG is faster, but • Model exe runs slower • Run LTGfigo1.BAT to use /O1 optimization during LTG, to return to the new default. 5

  6. Condensation ! tms(i,r,s) # source-spec. change in tax on imports of i from r into s #! SetNONAGR = TRAD_COMM - AGRCOM;EquationE_tmsA (all,i,AGRCOM)(all,r,REG)(all,s,REG) tms(i,r,s) = tmA(i,r);E_tmsB (all,i,NONAGR)(all,r,REG)(all,s,REG) tms(i,r,s) = tmB(r);! problem: tms can NOT be substituted out !Coefficient (all,i,TRAD_COMM) ISAGR(i);Formula (all,i,TRAD_COMM) ISAGR(i)=0;Formula (all,i,AGRCOM) ISAGR(i)=1;Equation! Now tms CAN be substituted out !E_tms3 (all,i,TRAD_COMM)(all,r,REG)(all,s,REG)tms(i,r,s) = ISAGR(i)*tmA(i,r) + [1-ISAGR(i)]*tmB(r); Equation! Now tms CAN be substituted out !E_tms (all,i,TRAD_COMM)(all,r,REG)(all,s,REG)tms(i,r,s) = sum{ii,AGRCOM:ii=i, tmA(ii,r)} + sum{j,NONAGR:j=i, tmB(r)}; Equation! Coming soon .. GEMPACK 11 !E_tms2 (all,i,TRAD_COMM)(all,r,REG)(all,s,REG)tms(i,r,s) = if{iinAGRCOM, tmA(i,r)} + if{iinNONAGR, tmB(r)}; 6

  7. Shock from Coefficient New in GEMPACK 10.0-002 (April 2010) TAB (TABLO INPUT) FILE Coefficient (all,i,TRAD_COMM)(all,r,REG)(all,s,REG) TMS0(i,r,s) # initial power #; (all,i,TRAD_COMM)(all,r,REG)(all,s,REG) TMS1(i,r,s) # new power #; (all,i,TRAD_COMM)(all,r,REG)(all,s,REG) shkTMS(i,r,s) # % change in tms #; Zerodividedefault 1;Formula(all,i,TRAD_COMM)(all,r,REG)(all,s,REG)TMS0(i,r,s) = VIMS(i,r,s)/VIWS(i,r,s);(all,i,TRAD_COMM)(all,r,REG)(all,s,REG)TMS1(i,r,s) = min[1.5,TMS0(i,r,s)]; ! cap at 50% ad valorem rate !(all,i,TRAD_COMM)(all,r,REG)(all,s,REG)shkTMS(i,r,s) = 100*[TMS1(i,r,s)-TMS0(i,r,s)]/TMS0(i,r,s); CMF (SIMULATION COMMAND) FILE! CMF: shock tms from coefficient shkTMS;! shock tms(AGRCOM,LDCREG,DEVREG) = select from coefficient shkTMS; 7

  8. Set Expressions New in GEMPACK 10.0-002 (April 2010) Set ! From gtapsam.tab !SAMAC1# dummy set # = MCOMunionDCOM ;SAMAC2# dummy set # = SAMAC1unionACT ;SAMAC3# dummy set # = SAMAC2unionENDW_COMM ;SAMAC4# dummy set # = SAMAC3unionTMM ;SAMAC5# dummy set # = SAMAC4unionTEE ;SAMAC6# dummy set # = SAMAC5unionTSSM ;SAMAC7# dummy set # = SAMAC6unionTSSD ;SAMAC8# dummy set # = SAMAC7unionTFF ;SAMAC9# dummy set # = SAMAC8unionTRMM ;SAMAC10# dummy set # = SAMAC9unionTRXM ;SAMAC11# dummy set # = SAMAC10unionWW ;SAMAC12# dummy set # = SAMAC11unionREGHOUS ;SAMAC13# dummy set # = SAMAC12unionHOUS ;SAMAC14# dummy set # = SAMAC13unionPRODTAX ;SAMAC15# dummy set # = SAMAC14unionDIRTAX ;SAMAC16# dummy set # = SAMAC15unionGOVT ;SAMAC# Social Accounting Matrix Accounts # = SAMAC16unionCGDS_COMM ;! (GP 10.0-002) Now becomes !SetSAMAC# Social Accounting Matrix Accounts # = MCOM + DCOM + ACT + ENDW_COMM + TMM + TEE + TSSM + TSSD + TFF + TRMM + TRXM + WW + REGHOUS + HOUS + PRODTAX + "DIRTAX" + GOVT + CGDS_COMM; 8

  9. ViewHAR can display solution (SL4) files Since Nov 2009, ViewHAR now displays SL4 solution files in a more user-friendly way. Unlike in ViewSOL, you can see values for variables with 4 or more dimensions. Since Nov 2009, ViewHAR is 'Large-Address-Aware' – it can use up to 4GB of memory, if run under 64-bit Windows. Under 32-bit Windows, it can still use only 2GB. RunDynam • Now improved (Feb 2010): “Save ingredients, except Model files, as Zip archive”. RunDynam zip archives need not include model.exe file • reduces Zip file size • easier to email • anyone with Source-code GEMPACK can rebuild the model.exe, and run your simulations 9

  10. Sparse storage in HAR files By default, GEMPACK programs when writing HAR files now store mainly-zero real arrays in sparse form. This can save considerable hard disk space. All GEMPACK programs released since 2006 can read the sparse format: older programs might complain. Can dramatically reduce size of very sparse huge arrays. Not much effect on zipped HAR size. Programs from GEMPACK version 9.0 (2005) or earlier cannot read sparse format HAR files (see online help for workarounds). 10

More Related