1D Shift

Dynamic Storage Management


        ...
	
CHPF$   processors p (4) 
CHPF$   template t (100) 
CHPF$   align a (i) with t(i)
CHPF$   align b (i) with t(i)
CHPF$   distribute t(block) onto p
        
        ...

C       
C       -----------------------------------------------
C       initializations for run-time descriptor indices
C       -----------------------------------------------
        a$align$new = 0
        a$align = 0
        b$align$new = 0
        b$align = 0
        t$dist = 0
        a$dist$new = 0
        a$dist = 0
        b$dist$new = 0
        b$dist = 0
        a$desc = 0
        b$desc = 0
C       
C       -------------------------------------
C       building array descriptor for array a
C       -------------------------------------
        call hpf_arrayrtd_alloc(1, 2, a$desc)
        call hpf_arrayrtd_setdim(a$desc, 0, 1, 100)
C       
C       -------------------------------------
C       building array descriptor for array b
C       -------------------------------------
        call hpf_arrayrtd_alloc(1, 2, b$desc)
        call hpf_arrayrtd_setdim(b$desc, 0, 1, 100)
C       
C       ------------------------------------
C       building tmpl descriptor: template t
C       ------------------------------------
        call hpf_tmplrtd_alloc(1, t$template)
        call hpf_tmplrtd_setdim(t$template, 0, 1, 100)
C       
C       ---------------------------------------
C       building procs descriptor: processors p
C       ---------------------------------------
        call hpf_procrtd_alloc(1, p$processors)
        call hpf_procrtd_setdim(p$processors, 0, 1, 4)
C       
C       -----------------------------------------------
C       building dist descriptor: distribute template t
C       -----------------------------------------------
        call hpf_distrtd_alloc(1, t$dist)
        call hpf_distrtd_setdim(t$dist, 0, -1, 25)
        t$proc = p$processors
C       
C       --------------------------------------------
C       building dist descriptor: distribute array a
C       --------------------------------------------
        call hpf_distrtd_clone(t$dist, a$dist$new)
        a$proc$new = t$proc
C       
C       --------------------------------------------
C       building dist descriptor: distribute array b
C       --------------------------------------------
        call hpf_distrtd_clone(t$dist, b$dist$new)
        b$proc$new = t$proc
C       
C       -----------------------------------------
C       building align descriptor: align b with t
C       -----------------------------------------
        call hpf_alignrtd_alloc(1, b$align$new)
        call hpf_alignrtd_setdim(b$align$new, 0, 1, 0, 0, 0)
C       
C       ------------------------------------------------------------
C       establish template and processor association: align b with t
C       ------------------------------------------------------------
        b$tmpl$new = t$template
        b$proc$new = t$proc
C       
C       -----------------------------------------
C       building align descriptor: align a with t
C       -----------------------------------------
        call hpf_alignrtd_alloc(1, a$align$new)
        call hpf_alignrtd_setdim(a$align$new, 0, 1, 0, 0, 0)
C       
C       ------------------------------------------------------------
C       establish template and processor association: align a with t
C       ------------------------------------------------------------
        a$tmpl$new = t$template
        a$proc$new = t$proc
C       
C       --------------------------------
C       allocate or redistribute array a
C       --------------------------------
        call hpf_array_remap(hpf$heap, a$align, a$dist, a$tmpl, a$proc, 
     *a$align$new, a$dist$new, a$tmpl$new, a$proc$new, a$desc, a$data)
C       
C       ------------------------------------
C       get coordinates in processors array 
C       ------------------------------------
        call hpf_procrtd_get_coords(hpf$heap, a$proc, a$coord)
C       
C       -----------------------------------------------------------------
C       initializing scalar extent vars used for linearization of array a
C       -----------------------------------------------------------------
C       
C       --------------------------------
C       allocate or redistribute array b
C       --------------------------------
        call hpf_array_remap(hpf$heap, b$align, b$dist, b$tmpl, b$proc, 
     *b$align$new, b$dist$new, b$tmpl$new, b$proc$new, b$desc, b$data)
C       
C       ------------------------------------
C       get coordinates in processors array 
C       ------------------------------------
        call hpf_procrtd_get_coords(hpf$heap, b$proc, b$coord)
C       
C       -----------------------------------------------------------------
C       initializing scalar extent vars used for linearization of array b
C       -----------------------------------------------------------------
C       
C