[ofa-general] Re: [PATCHv2] opensm/osm_mesh.c: Reorder switches for lash

Sasha Khapyorsky sashak at voltaire.com
Wed Aug 5 02:44:33 PDT 2009


On 11:16 Wed 22 Jul     , Hal Rosenstock wrote:
> 
> diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
> index 23fad87..dce2ea1 100644
> --- a/opensm/opensm/osm_mesh.c
> +++ b/opensm/opensm/osm_mesh.c
> @@ -185,6 +185,16 @@ typedef struct _mesh {
>  	int dim_order[MAX_DIMENSION];
>  } mesh_t;
>  
> +typedef struct sort_ctx {
> +	lash_t *p_lash;
> +	mesh_t *mesh;
> +} sort_ctx_t;
> +
> +typedef struct comp {
> +	int index;
> +	sort_ctx_t *ctx;
> +} comp_t;

And wouldn't it be simpler to use:

struct comp {
	switch_t **s;
	sort_ctx_t ctx;
};

? So you will have already sorted switches and only will need to care
about s->id and s->links fixing (and will not need switches[] array too).

Sasha



More information about the general mailing list