[ofa-general] Re: [PATCH] opensm/osm_mesh.c: Improve VL utilization

Sasha Khapyorsky sashak at voltaire.com
Tue Jun 23 14:13:04 PDT 2009


Hi Hal,

On 16:10 Wed 17 Jun     , Hal Rosenstock wrote:
> diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
> index 1867876..f2dd2f8 100644
> --- a/opensm/opensm/osm_mesh.c
> +++ b/opensm/opensm/osm_mesh.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2008,2009      System Fabric Works, Inc.
> + * Copyright (c) 2008,2009      System Fabric Works, Inc. All rights reserved.
>   *
>   * This software is available to you under a choice of one of two
>   * licenses.  You may choose to be licensed under the terms of the GNU
> @@ -1026,12 +1026,15 @@ static inline int ltmag(int a, int b)
>  	return (a1 < b1) || (a1 == b1 && a > b);
>  }
>  
> +static int dim_order[MAX_DIMENSION];
> +static int dim_reverse[MAX_DIMENSION];

This makes the code non-reenterable. Wouldn't it better to move this
under 'struct mesh'?

> @@ -1191,7 +1226,49 @@ static int measure_geometry(lash_t *p_lash, mesh_t *mesh, int seed)
>  	}
>  
>  	for (i = 0; i < dimension; i++)
> -		mesh->size[i] = max[i] - min[i] + 1;
> +		mesh->size[i] = size[i] = max[i] - min[i] + 1;
> +
> +	/*
> +	 * find an order of dimensions that places largest
> +	 * sizes first since this seems to work best with LASH
> +	 */
> +	for (j = 0; j < dimension; j++) {
> +		max_size = -1;
> +		max_index = -1;
> +
> +		for (i = 0; i < dimension; i++) {
> +			if (size[i] > max_size) {
> +				max_size = size[i];
> +				max_index = i;
> +			}
> +		}
> +
> +		dim_order[j] = max_index;
> +		dim_reverse[max_index] = j;

Where is 'dim_reverse' used, I didn't find.

Sasha



More information about the general mailing list