Skip to content

Commit

Permalink
aws: Extend p5 regex to future p-series
Browse files Browse the repository at this point in the history
Add a regex to match all instances p5 or later in the p-series.  Moved
to extended regex compilation to make the regex slightly more sane.

Signed-off-by: Brian Barrett <[email protected]>
  • Loading branch information
bwbarrett committed Dec 20, 2024
1 parent a69bc90 commit 6d676a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform-aws.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static struct ec2_platform_data platform_data_map[] = {
},
{
.name = "p-series",
.regex = "^p5.*",
.regex = "^p([5-9]|[0-9]{2,}).*",
.topology = NULL,
.default_dup_conns = 0,
.latency = 75.0,
Expand Down Expand Up @@ -145,7 +145,7 @@ struct ec2_platform_data *platform_aws_get_platform_entry(const char *platform_t
break;
}
} else {
ret = regcomp(&regex, platform_data_list[idx].regex, 0);
ret = regcomp(&regex, platform_data_list[idx].regex, REG_EXTENDED);
if (ret != 0) {
NCCL_OFI_WARN("Could not compile platform_type regex for %s",
platform_data_list[idx].regex);
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/aws_platform_mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ static int check_known_platforms(void)
ret += check_value(platform_data_list, len, "g5.48xlarge", "g5.48xlarge");
ret += check_value(platform_data_list, len, "g6.16xlarge", NULL);

// obviously future platforms
ret += check_value(platform_data_list, len, "p100.2048xlarge", "p-series");

return ret;
}

Expand Down

0 comments on commit 6d676a7

Please sign in to comment.