Skip to content

Commit 7884ae8

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 <[email protected]>
1 parent 5437cac commit 7884ae8

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
@@ -79,7 +79,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
7979
SEGSIZE = 0, /* algorithm specific tuning parameter */
8080
MAXREQ = 0; /* algorithm specific tuning parameter */
8181
FILE *fptr = (FILE*) NULL;
82-
int x, ncs, nms;
82+
int x, ncs, nms, version;
8383

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

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

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

232237
/* read the max requests tuning parameter. optional */
233238
msg_p->result_max_requests = ompi_coll_tuned_alltoall_max_requests;
234-
if( isnext_digit(fptr) ) {
239+
if( (version > 1) && isnext_digit(fptr) ) {
235240
if( (getnext (fptr, &MAXREQ) < 0) || (MAXREQ < 0) ) {
236241
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));
237242
goto on_file_error;
@@ -266,6 +271,7 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
266271
fclose (fptr);
267272

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

0 commit comments

Comments
 (0)