[ofa-general] [PATCH 1/3] opensm: Added io_guid_file and max_reverse_hops options

Nicolas Morey Chaisemartin nicolas.morey-chaisemartin at ext.bull.net
Thu Feb 12 01:11:34 PST 2009


Signed-off-by: Nicolas Morey-Chaisemartin <nicolas.morey-chaisemartin at ext.bull.net>
---
  opensm/include/opensm/osm_subnet.h |    6 ++++++
  opensm/opensm/main.c               |   26 +++++++++++++++++++++++++-
  opensm/opensm/osm_subnet.c         |   12 ++++++++++++
  3 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index 8863e47..671b51f 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -190,6 +190,8 @@ typedef struct osm_subn_opt {
  	char *lfts_file;
  	char *root_guid_file;
  	char *cn_guid_file;
+	char *io_guid_file;
+       uint16_t max_reverse_hops;
  	char *ids_guid_file;
  	char *guid_routing_order_file;
  	char *sa_db_file;
@@ -383,6 +385,10 @@ typedef struct osm_subn_opt {
  *		Name of the file that contains list of compute node guids that
  *		will be used by fat-tree routing (provided by User)
  *
+*	io_guid_file
+*		Name of the file that contains list of I/O node guids that
+*		will be used by fat-tree routing (provided by User)
+*
  *	ids_guid_file
  *		Name of the file that contains list of ids which should be
  *		used by Up/Down algorithm instead of node GUIDs
diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c
index a8dc9e6..b5e3337 100644
--- a/opensm/opensm/main.c
+++ b/opensm/opensm/main.c
@@ -212,6 +212,12 @@ static void show_usage(void)
  	printf("--cn_guid_file, -u <path to file>\n"
  	       "          Set the compute nodes for the Fat-Tree routing algorithm\n"
  	       "          to the guids provided in the given file (one to a line)\n\n");
+	printf("--io_guid_file, -G <path to file>\n"
+	       "          Set the I/O nodes for the Fat-Tree routing algorithm\n"
+	       "          to the guids provided in the given file (one to a line)\n\n");
+	printf("--max_reverse_hops, -H <hop_count>\n"
+	       "          Set the max number of hops the wrong way around\n"
+	       "          an I/O node is allowed to do (connectivity for I/O nodes on top swithces)\n\n");
  	printf("--ids_guid_file, -m <path to file>\n"
  	       "          Name of the map file with set of the IDs which will be used\n"
  	       "          by Up/Down routing algorithm instead of node GUIDs\n"
@@ -526,7 +532,7 @@ int main(int argc, char *argv[])
  	uint32_t val;
  	unsigned config_file_done = 0;
  	const char *const short_option =
-	    "F:c:i:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:";
+	    "F:c:i:f:ed:D:g:l:L:s:t:a:u:m:X:R:zM:U:S:P:Y:ANBIQvVhoryxp:n:q:k:C:G:H:";

  	/*
  	   In the array below, the 2nd parameter specifies the number
@@ -570,6 +576,8 @@ int main(int argc, char *argv[])
  		{"sadb_file", 1, NULL, 'S'},
  		{"root_guid_file", 1, NULL, 'a'},
  		{"cn_guid_file", 1, NULL, 'u'},
+		{"io_guid_file", 1, NULL, 'G'},
+		{"max_reverse_hops", 1, NULL, 'H'},
  		{"ids_guid_file", 1, NULL, 'm'},
  		{"guid_routing_order_file", 1, NULL, 'X'},
  		{"stay_on_fatal", 0, NULL, 'y'},
@@ -880,6 +888,22 @@ int main(int argc, char *argv[])
  			       opt.cn_guid_file);
  			break;

+		case 'G':
+			/*
+			   Specifies I/O node guids file
+			 */
+			opt.io_guid_file = optarg;
+			printf(" I/O Node Guid File: %s\n",
+			       opt.io_guid_file);
+			break;
+		case 'H':
+			/*
+			   Specifies I/O max reverted hops
+			 */
+			opt.max_reverse_hops =  atoi(optarg);
+			printf(" Max Reverse Hops: %d\n",
+			       opt.max_reverse_hops);
+			break;
  		case 'm':
  			/* Specifies ids guid file */
  			SET_STR_OPT(opt.ids_guid_file, optarg);
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 69937c1..b356d33 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -578,6 +578,8 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * const p_opt)
  	p_opt->lfts_file = NULL;
  	p_opt->root_guid_file = NULL;
  	p_opt->cn_guid_file = NULL;
+	p_opt->io_guid_file = NULL;
+	p_opt->max_reverse_hops = 0;
  	p_opt->ids_guid_file = NULL;
  	p_opt->guid_routing_order_file = NULL;
  	p_opt->sa_db_file = NULL;
@@ -1393,6 +1395,16 @@ int osm_subn_output_conf(FILE *out, IN osm_subn_opt_t *const p_opts)
  		p_opts->cn_guid_file ? p_opts->cn_guid_file : null_str);

  	fprintf(out,
+		"# The file holding the fat-tree I/O node guids\n"
+		"# One guid in each line\nio_guid_file %s\n\n",
+		p_opts->io_guid_file ? p_opts->io_guid_file : null_str);
+
+	fprintf(out,
+		"# Number of reverse hops allowed for I/O nodes \n"
+		"# Used for connectivity between I/O nodes connected to Top Switches\nmax_reverse_hops %d\n\n",
+		p_opts->max_reverse_hops);
+
+	fprintf(out,
  		"# The file holding the node ids which will be used by"
  		" Up/Down algorithm instead\n# of GUIDs (one guid and"
  		" id in each line)\nids_guid_file %s\n\n",
-- 
1.6.1





More information about the general mailing list