[ET Trac] [Einstein Toolkit] #544: Enable optimisation in Fortran array index calculations

Einstein Toolkit trac-noreply at einsteintoolkit.org
Tue Aug 30 14:27:41 CDT 2011


#544: Enable optimisation in Fortran array index calculations
-------------------------+--------------------------------------------------
 Reporter:  eschnett     |       Owner:     
     Type:  enhancement  |      Status:  new
 Priority:  major        |   Milestone:     
Component:  Cactus       |     Version:     
 Keywords:               |  
-------------------------+--------------------------------------------------
 In Fortran, Cactus passes all grid functions as arguments to routines,
 and the size of the grid functions are declared in
 DECLARE_CCTK_ARGUMENTS. In these declarations, Cactus assumes that the
 size of each grid variable group can be different, and the compiler
 thus does not see that all grid functions have (locally) the same
 array shape. The compiler can thus not simplify array index
 calculations. This is probably only relevant in short loops accessing
 grid functions from multiple groups (GRHydro?).

 The attached patch passes three additional integer arguments
 (cctk_lsh[123]) which contain the shape of grid functions, and uses
 these to declare grid functions.

 This patch is quite old, but was never applied. It comes from a time
 when g77 didn't support declaring array shapes via an integer array
 (since this is not allowed in Fortran 77). If this is now possible,
 one could use the array cctk_lsh instead of passing three extra
 integer arguments.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/544>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list