Fix #146; handling of hints. Why are GPFS hints special, remains unclear.

master
Julian M. Kunkel 2019-05-08 14:02:40 +01:00
parent 8fd755147a
commit 54522315ec
1 changed files with 12 additions and 10 deletions

View File

@ -292,21 +292,23 @@ int CountTasksPerNode(MPI_Comm comm) {
*/ */
void ExtractHint(char *settingVal, char *valueVal, char *hintString) void ExtractHint(char *settingVal, char *valueVal, char *hintString)
{ {
char *settingPtr, *valuePtr, *tmpPtr1, *tmpPtr2; char *settingPtr, *valuePtr, *tmpPtr2;
/* find the value */
settingPtr = (char *)strtok(hintString, " ="); settingPtr = (char *)strtok(hintString, " =");
valuePtr = (char *)strtok(NULL, " =\t\r\n"); valuePtr = (char *)strtok(NULL, " =\t\r\n");
tmpPtr1 = settingPtr; /* is this an MPI hint? */
tmpPtr2 = (char *)strstr(settingPtr, "IOR_HINT__MPI__"); tmpPtr2 = (char *) strstr(settingPtr, "IOR_HINT__MPI__");
if (tmpPtr1 == tmpPtr2) { if (settingPtr == tmpPtr2) {
settingPtr += strlen("IOR_HINT__MPI__"); settingPtr += strlen("IOR_HINT__MPI__");
} else { } else {
tmpPtr2 = (char *)strstr(settingPtr, "IOR_HINT__GPFS__"); tmpPtr2 = (char *) strstr(hintString, "IOR_HINT__GPFS__");
if (tmpPtr1 == tmpPtr2) { /* is it an GPFS hint? */
settingPtr += strlen("IOR_HINT__GPFS__"); if (settingPtr == tmpPtr2) {
fprintf(out_logfile, settingPtr += strlen("IOR_HINT__GPFS__");
"WARNING: Unable to set GPFS hints (not implemented.)\n"); }else{
fprintf(out_logfile, "WARNING: Unable to set unknown hint type (not implemented.)\n");
return;
} }
} }
strcpy(settingVal, settingPtr); strcpy(settingVal, settingPtr);