Add the exact matching modifier support "=" to the NCCL_IB_HCA variable (#236)

Perform exact matching when the prefix "=" is specified in the NCCL_IB_HCA variable to exclude HCAs mlx5_X[0-9]+ when mlx5_X is specified.
This commit is contained in:
Hirochika Asai
2019-07-10 06:45:41 +09:00
committed by Sylvain Jeaugey
szülő 8e04d80382
commit 0b192d2299
4 fájl változott, egészen pontosan 13 új sor hozzáadva és 9 régi sor törölve
+2 -1
Fájl megtekintése
@@ -66,6 +66,7 @@ static int findInterfaces(const char* prefixList, char* names, union socketAddre
#endif
struct netIf userIfs[MAX_IFS];
bool searchNot = prefixList && prefixList[0] == '^';
bool searchExact = prefixList && prefixList[0] == '=';
int nUserIfs = parseStringList(prefixList, userIfs, MAX_IFS);
int found = 0;
@@ -92,7 +93,7 @@ static int findInterfaces(const char* prefixList, char* names, union socketAddre
}
// check against user specified interfaces
if (!(matchIfList(interface->ifa_name, -1, userIfs, nUserIfs) ^ searchNot)) {
if (!(matchIfList(interface->ifa_name, -1, userIfs, nUserIfs, searchExact) ^ searchNot)) {
continue;
}
+1 -1
Fájl megtekintése
@@ -20,6 +20,6 @@ struct netIf {
};
int parseStringList(const char* string, struct netIf* ifList, int maxList);
bool matchIfList(const char* string, int port, struct netIf* ifList, int listSize);
bool matchIfList(const char* string, int port, struct netIf* ifList, int listSize, bool matchExact);
#endif