[ofa-general] ***SPAM***

Robert Pearson rpearson at systemfabricworks.com
Tue Nov 11 09:10:31 PST 2008


Sasha,

Here is the sixth patch implementing the mesh analysis algorithm.

This patch implements
      - a table of polynomials for all 2D and 3D regular Cartesian meshes
      - a routine to classify each switch based on the table

Regards,

Bob Pearson

Signed-off-by: Bob Pearson <rpearson at systemfabricworks.com>
----
diff --git a/opensm/opensm/osm_mesh.c b/opensm/opensm/osm_mesh.c
index 9254de3..30d09c2 100644
--- a/opensm/opensm/osm_mesh.c
+++ b/opensm/opensm/osm_mesh.c
@@ -48,6 +48,76 @@
 #include <opensm/osm_mesh.h>
 #include <opensm/osm_ucast_lash.h>
 
+#define MAX_DIMENSION (4)
+#define MAX_DEGREE (10)
+
+/*
+ * characteristic polynomials for 2d and 3d regular tori
+ * since 4 == 2x2 we choose to take 2x2
+ */
+struct _mesh_info {
+	int dimension;			/* dimension of the torus */
+	int size[MAX_DIMENSION];	/* size of the torus */
+	int degree;			/* degree of polynomial */
+	int poly[MAX_DEGREE+1];		/* polynomial */
+} mesh_info[] = {
+	{0, {0},       0, {0},					},
+
+	{2, {2, 2},    2, {-4, 0, 1},				},
+	{2, {3, 2},    3, {8, 9, 0, -1},			},
+	//{2, {4, 2},    3, {16, 12, 0, -1},			},
+	{2, {5, 2},    3, {24, 17, 0, -1},			},
+	{2, {6, 2},    3, {32, 24, 0, -1},			},
+	{2, {3, 3},    4, {-15, -32, -18, 0, 1},		},
+	//{2, {4, 3},    4, {-28, -48, -21, 0, 1},		},
+	{2, {5, 3},    4, {-39, -64, -26, 0, 1},		},
+	{2, {6, 3},    4, {-48, -80, -33, 0, 1},		},
+	//{2, {4, 4},    4, {-48, -64, -24, 0, 1},		},
+	//{2, {5, 4},    4, {-60, -80, -29, 0, 1},		},
+	//{2, {6, 4},    4, {-64, -96, -36, 0, 1},		},
+	{2, {5, 5},    4, {-63, -96, -34, 0, 1},		},
+	{2, {6, 5},    4, {-48, -112, -41, 0, 1},		},
+	{2, {6, 6},    4, {0, -128, -48, 0, 1},			},
+
+	{3, {2, 2, 2}, 3, {16, 12, 0, -1},			},
+	{3, {3, 2, 2}, 4, {-28, -48, -21, 0, 1},		},
+	{3, {4, 2, 2}, 4, {-48, -64, -24, 0, 1},		},
+	{3, {5, 2, 2}, 4, {-60, -80, -29, 0, 1},		},
+	{3, {6, 2, 2}, 4, {-64, -96, -36, 0, 1},		},
+	{3, {3, 3, 2}, 5, {48, 127, 112, 34, 0, -1},		},
+	{3, {4, 3, 2}, 5, {80, 180, 136, 37, 0, -1},		},
+	{3, {5, 3, 2}, 5, {96, 215, 160, 42, 0, -1},		},
+	{3, {6, 3, 2}, 5, {96, 232, 184, 49, 0, -1},		},
+	{3, {4, 4, 2}, 5, {128, 240, 160, 40, 0, -1},		},
+	{3, {5, 4, 2}, 5, {144, 276, 184, 45, 0, -1},		},
+	{3, {6, 4, 2}, 5, {128, 288, 208, 52, 0, -1},		},
+	{3, {5, 5, 2}, 5, {144, 303, 208, 50, 0, -1},		},
+	{3, {6, 5, 2}, 5, {96, 296, 232, 57, 0, -1},		},
+	{3, {6, 6, 2}, 5, {0, 256, 256, 64, 0, -1},		},
+	{3, {3, 3, 3}, 6, {-81, -288, -381, -224, -51, 0, 1},	},
+	{3, {4, 3, 3}, 6, {-132, -416, -487, -256, -54, 0, 1},	},
+	{3, {5, 3, 3}, 6, {-153, -480, -557, -288, -59, 0, 1},	},
+	{3, {6, 3, 3}, 6, {-144, -480, -591, -320, -66, 0, 1},	},
+	{3, {4, 4, 3}, 6, {-208, -576, -600, -288, -57, 0, 1},	},
+	{3, {5, 4, 3}, 6, {-228, -640, -671, -320, -62, 0, 1},	},
+	{3, {6, 4, 3}, 6, {-192, -608, -700, -352, -69, 0, 1},	},
+	{3, {5, 5, 3}, 6, {-225, -672, -733, -352, -67, 0, 1},	},
+	{3, {6, 5, 3}, 6, {-144, -576, -743, -384, -74, 0, 1},	},
+	{3, {6, 6, 3}, 6, {0, -384, -720, -416, -81, 0, 1},	},
+	{3, {4, 4, 4}, 6, {-320, -768, -720, -320, -60, 0, 1},	},
+	{3, {5, 4, 4}, 6, {-336, -832, -792, -352, -65, 0, 1},	},
+	{3, {6, 4, 4}, 6, {-256, -768, -816, -384, -72, 0, 1},	},
+	{3, {5, 5, 4}, 6, {-324, -864, -855, -384, -70, 0, 1},	},
+	{3, {6, 5, 4}, 6, {-192, -736, -860, -416, -77, 0, 1},	},
+	{3, {6, 6, 4}, 6, {0, -512, -832, -448, -84, 0, 1},	},
+	{3, {5, 5, 5}, 6, {-297, -864, -909, -416, -75, 0, 1},	},
+	{3, {6, 5, 5}, 6, {-144, -672, -895, -448, -82, 0, 1},	},
+	{3, {6, 6, 5}, 6, {0, -384, -848, -480, -89, 0, 1},	},
+	{3, {6, 6, 6}, 6, {0, 0, -768, -512, -96, 0, 1},	},
+
+	{-1, {0,}, 0, {0, },					},
+};
+
 /*
  * poly_alloc
  * 
@@ -489,6 +559,30 @@ static void classify_switch(lash_t *p_lash, int sw)
 }
 
 /*
+ * classify_mesh_type
+ *
+ * try to look up node polynomial in table
+ */
+static void classify_mesh_type(lash_t *p_lash, int sw)
+{
+	int i;
+	switch_t *s = p_lash->switches[sw];
+	struct _mesh_info *t;
+
+	for (i = 1; (t = &mesh_info[i])->dimension != -1; i++) {
+		if (poly_diff(t->degree, t->poly, s))
+			continue;
+
+		s->node->type = i;
+		s->node->dimension = t->dimension;
+		return;
+	}
+
+	s->node->type = 0;
+	return;
+}
+
+/*
  * get_local_geometry
  *
  * analyze the local geometry around each switch
@@ -500,6 +594,7 @@ static void get_local_geometry(lash_t *p_lash)
 	for (sw = 0; sw < p_lash->num_switches; sw++) {
 		get_switch_metric(p_lash, sw);
 		classify_switch(p_lash, sw);
+		classify_mesh_type(p_lash, sw);
 	}
 }
 





More information about the general mailing list