Skip to content

Commit f6387a4

Browse files
author
Burlen Loring
committed
coll tuned add version identifier to the rules file
the version identifier is optional but when provided it must have the following format and must appear on the first line.`rule-file-version-N` where N is an unsigned integer. Older versions of the parser will fall back to fixed decision mechanism when this line is present. Version 1 is the original format, Version 2 has support for optional coll_tuned_alltoall_algorithm_max_requests specification. Signed-off-by: Burlen Loring <bloring@nvidia.com>
1 parent 33f8c74 commit f6387a4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ompi/mca/coll/tuned/coll_tuned_dynamic_file.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
8080
SEGSIZE = 0, /* algorithm specific tuning parameter */
8181
MAXREQ = 0; /* algorithm specific tuning parameter */
8282
FILE *fptr = (FILE*) NULL;
83-
int x, ncs, nms;
83+
int x, ncs, nms, version;
8484

8585
ompi_coll_alg_rule_t *alg_rules = (ompi_coll_alg_rule_t*) NULL; /* complete table of rules */
8686

@@ -124,6 +124,11 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
124124
goto on_file_error;
125125
}
126126

127+
/* consume the optional version identifier */
128+
if (0 == fscanf(fptr, "rule-file-version-%u", &version)) {
129+
version = 1;
130+
}
131+
127132
/* get the number of collectives for which rules are provided in the file */
128133
if( (getnext(fptr, &NCOL) < 0) || (NCOL < 0) ) {
129134
OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read number of collectives in configuration file around line %d\n", fileline));
@@ -232,7 +237,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
232237

233238
/* read the max requests tuning parameter. optional */
234239
msg_p->result_max_requests = ompi_coll_tuned_alltoall_max_requests;
235-
if( isnext_digit(fptr) ) {
240+
if( (version > 1) && isnext_digit(fptr) ) {
236241
if( (getnext (fptr, &MAXREQ) < 0) || (MAXREQ < 0) ) {
237242
OPAL_OUTPUT((ompi_coll_tuned_stream,"Could not read max requests for collective ID %ld com rule %d msg rule %d at around line %d\n", COLID, ncs, nms, fileline));
238243
goto on_file_error;
@@ -267,6 +272,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
267272
fclose (fptr);
268273

269274
OPAL_OUTPUT((ompi_coll_tuned_stream,"\nConfigure file Stats\n"));
275+
OPAL_OUTPUT((ompi_coll_tuned_stream,"Version\t\t\t\t\t: %5u\n", version));
270276
OPAL_OUTPUT((ompi_coll_tuned_stream,"Collectives with rules\t\t\t: %5d\n", total_alg_count));
271277
OPAL_OUTPUT((ompi_coll_tuned_stream,"Communicator sizes with rules\t\t: %5d\n", total_com_count));
272278
OPAL_OUTPUT((ompi_coll_tuned_stream,"Message sizes with rules\t\t: %5d\n", total_msg_count));

0 commit comments

Comments
 (0)