Skip to content

ensemble manager: layout, layout_type, distribution_type #1166

Open

Description

@hkershaw-brown

There are a couple of confusing (to me at least) parts of ensemble_manager, layout_type argument, distribution_type argument.

distribution_type you can not use:

! Distribution type controls pe layout of storage; Default is 1. 1 is only one implemented.
if(.not. present(distribution_type_in)) then
ens_handle%distribution_type = 1
else
! Check for error: only type 1 implemented for now
if(distribution_type_in /= 1) call error_handler(E_ERR, 'init_ensemble_manager', &
'only distribution_type 1 is implemented', source)
ens_handle%distribution_type = distribution_type_in
endif

You could have set a different layout (mapping of physical to logical tasks) when you initialize the ensemble handles. There is a note in ensemble manager that you should no do this.

DART/assimilation_code/modules/utilities/ensemble_manager_mod.f90

Lines 165 to 172 in b270ca6

 ! Optional layout_type argument to assign how my_pe is related to my_task_id 
 ! layout_type can be set individually for each ensemble handle. It is not advisable to do this 
 ! because get_obs_ens assumes that the layout is the same for each ensemble handle. 
 if(.not. present(layout_type) ) then 
    ens_handle%layout_type = layout ! namelist option 
 else 
    ens_handle%layout_type = layout_type 
 endif 

Q. Why even have layout as an option, many parts of the code assume the layout is the same for ens, obs_ens, and qc_obs_ens? "Do not shoot your self in the foot with this foot gun we have provided"

Thoughts:

  • Distribution type has been unused for 20 years. I think it is time for it to go. If you did need this functionally is this where you would put it today?

  • map_pe_to_task is crazy annoying to have to call. Something should be taking care of that for me, e.g the mpi_utils or the ensemble manager or another layer.

Activity

  1. jlaucar commented on Aug 13, 2026

    @jlaucar
    Contributor
  2. hkershaw-brown commented on Aug 13, 2026

    @hkershaw-brown
    CollaboratorAuthor

    @jlaucar are you talking about the layout_type or the distribution_type?

  3. hkershaw-brown commented on Aug 13, 2026

    @hkershaw-brown
    CollaboratorAuthor

    I think it is good to get all the terminology and assumptions in the code listed before any changes, in fact before even speccing out changes.
    e.g. I'm assuming you are not talking about different distributions of copies, only distributions of vars.

    I believe the load balancing issues you're thinking of: all elements in a column ending up on the same processor ( unlucky number of tasks vs x*y grid cells) was "fixed" by using a different number of tasks. I may be missing other cases though.

  4. jlaucar commented on Aug 13, 2026

    @jlaucar
    Contributor
  5. changed the title [-]ensemble manager[/-] [+] ensemble manager: layout, layout_type, distribution_type[/+] on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions