From 64ac575c5f2796ad44d7031f2817031235e05f6d Mon Sep 17 00:00:00 2001 From: Jeremiah Corrado Date: Tue, 24 Sep 2024 12:31:58 -0600 Subject: [PATCH] add comment describing why a locale's region of a file should be skipped if it's size is one Signed-off-by: Jeremiah Corrado --- modules/packages/ParallelIO.chpl | 4 ++++ modules/standard/IO.chpl | 2 ++ 2 files changed, 6 insertions(+) diff --git a/modules/packages/ParallelIO.chpl b/modules/packages/ParallelIO.chpl index 69f4e538613..2e8a68e17cb 100644 --- a/modules/packages/ParallelIO.chpl +++ b/modules/packages/ParallelIO.chpl @@ -144,6 +144,8 @@ module ParallelIO { const byteOffsets = try! findDelimChunks(fMeta, delim, tld.size, fileBounds, header); coforall (loc, id) in zip(targetLocales, 0..) do on loc { const locBounds = byteOffsets[id]..byteOffsets[id+1]; + + // if byteOffsets looks like [0, 10, 10, 14, 21], then don't try to read 10..10 (locale 1) if locBounds.size > 1 { const locFile = try! open(filePath, ioMode.r), locByteOffsets = try! findDelimChunks(locFile, delim, nTasks, locBounds, headerPolicy.noHeader); @@ -261,6 +263,8 @@ module ParallelIO { const byteOffsets = try! findDelimChunks(fMeta, delim, tld.size, fileBounds, header); coforall (loc, id) in zip(targetLocales, 0..) do on loc { const locBounds = byteOffsets[id].. 1 { const locFile = try! open(filePath, ioMode.r), locByteOffsets = try! findDelimChunks(locFile, delim, nTasks, locBounds, headerPolicy.noHeader); diff --git a/modules/standard/IO.chpl b/modules/standard/IO.chpl index 5247bd9a872..feb3df22507 100644 --- a/modules/standard/IO.chpl +++ b/modules/standard/IO.chpl @@ -7171,6 +7171,8 @@ iter fileReader.lines( const byteOffsets = findFileChunks(f, targetLocales.size, myBounds); coforall lid in 0.. 1 { const locFile = try! open(fpath, ioMode.r), nTasks = if dataParTasksPerLocale>0 then dataParTasksPerLocale