Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 24, 2018. It is now read-only.
This repository was archived by the owner on Feb 24, 2018. It is now read-only.

ior hintfile is too sensitive to whitespace #16

@roblatham00

Description

@roblatham00

consider an Ior hintfile with the line
IOR_HINT__MPI__cb_buffer_size = 1234

The spaces around '=' mean IOR tries to set the hint "cb_buffer_size ". It's easy to miss the extra space in the -H output, and you go crazy wondering why MPI is ignoring this hint.

Please apply the attached patch to make hintfile parsing not care so much about whitespace:

From e3475ee6e0b367d3f5fb7a43106a31e8d999f055 Mon Sep 17 00:00:00 2001
From: Rob Latham <[email protected]>
Date: Thu, 19 Dec 2013 13:01:35 -0600
Subject: [PATCH] more tolerant of whitepace in hintfile

If a hintfile contains e.g. cb_buffer_size = 1234, IOR will try to set
the hint "cb_buffer_size " (note trailing space), a hint that no MPI
implementation actually supports.

---
 src/utilities.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utilities.c b/src/utilities.c
index 61b4f851..ce653611 100644
--- a/src/utilities.c
+++ b/src/utilities.c
@@ -162,8 +162,8 @@ void ExtractHint(char *settingVal, char *valueVal, char *hintString)
 {
         char *settingPtr, *valuePtr, *tmpPtr1, *tmpPtr2;

-        settingPtr = (char *)strtok(hintString, "=");
-        valuePtr = (char *)strtok(NULL, " \t\r\n");
+        settingPtr = (char *)strtok(hintString, " =");
+        valuePtr = (char *)strtok(NULL, " =\t\r\n");
         tmpPtr1 = settingPtr;
         tmpPtr2 = (char *)strstr(settingPtr, "IOR_HINT__MPI__");
         if (tmpPtr1 == tmpPtr2) {
-- 
1.8.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions