Changelog
Source:NEWS.md
filearray 0.2.4
- Partition files are written to a temporary file and then renamed into place, so other processes loading the same array no longer fail with “File size too small” while a partition is being created or filled
-
filearray_loadonly treats files named<n>.farras partitions - Writes lock the partitions they change, so several processes (for example
parallel,callrormiraiworkers, or several applications) can write to one array without losing each other’s data: sub-assignment (x[...] <- value),fill_partition,initialize_partition,set_partition,fmap,fmap_element_wiseandfilearray_bindwait while another process holds one of their partitions. Reading takes no locks, except that functions that must first create missing partitions (such asmaxorsum) lock the partitions they create - Added
lock_partition(parts, timeout)andunlock_partition(parts)methods to hold partitions over several operations (for example to check whether a partition has been computed and write it only if not);lock_partitionwaits and retries until the partitions are free ortimeoutseconds have passed - Locks are byte-range locks on an empty file
.filearray.lockin the array directory, released by the operating system when a process exits.options(filearray.lock = FALSE)(environment variableFILEARRAY_LOCK) turns off automatic locking;options(filearray.lock.timeout = <seconds>)(FILEARRAY_LOCK_TIMEOUT) limits how long writes wait, by default without limit - A missing partition is created only if no other process has created it in the meantime, and every partition write uses its own temporary file, so concurrent writers no longer replace each other’s partitions or share a temporary file
-
fmapstops when the mapping function raises an error or is interrupted, instead of warning “cannot finish map” and returning a partly written result -
delete()releases the locks the session holds on the array before removing it - Added
with_filelock(expr, lockfile, timeout, on_unsupported)to evaluate code while holding an exclusive lock on any lock file, so that only one R session at a time runs it; other sessions wait. It is not tied to file arrays, so other packages can use it.on_unsupportedchooses what happens when the lock cannot be taken: warn (default), stop, or ignore - Partition locks never make a write fail when the lock itself cannot be taken: any error while locking (for example a stale network file handle or too many open files, not only file systems without lock support) now warns once and the write proceeds, and an invalid
filearray.lock.timeoutoption orFILEARRAY_LOCK_TIMEOUTvalue warns once and is ignored instead of stopping every write - Fixed
mapreduce(and sosum,max,min,rangeandfwhich) reading only the first slice of every partition after the first whenpartition_sizeis greater than 1, which gave wrong results and wrongfwhichindices -
fmap2reports the error raised by the mapping function instead of “Unknown error.” - Errors and interrupts raised in the functions passed to
fmap,fmap2andmapreducenow reach the caller unchanged on Linux builds that compile packages withlibc++while R itself loadslibstdc++(for example through ICU). Before, they arrived as “c++ exception (unknown reason)” and could corrupt memory and crash the R session
filearray 0.2.2
CRAN release: 2026-05-23
- Fixed out-of-bound indexing leading to segfault along certain margins
- Fixed
ASANissue that may cause run-time error: signed integer overflow: 9223372036854775807 + 1 cannot be represented in typeint64_t(load.cpp:636:51)
filearray 0.2.1
CRAN release: 2026-03-23
- Fixed incorrect
NApropagation in complex arraycollapse:NaN == NaNis alwaysFALSEper IEEE 754, soNAdetection now usesISNAN()instead of== NA_REAL. Also added a missing “result alreadyNA” short-circuit guard matching the non-complex path. - Fixed
x[]failure onR-devel(>= 4.6.0): replacedtryCatch({ ...elt(1) })infa_subset1withcheck_missing_dots(), which correctly detects a missing first argument without relying on the error-throwing behavior of...elt()that changed inR-devel. - Replaced deprecated
Rf_findVarInFrame(removed in R 4.5.0) with a compatibility wrapperfarr_findVarInFramethat usesR_existsVarInFrame+R_getVarExon R >= 4.5.0 and falls back toRf_findVarInFrameon older R. - Fixed multiple unprotected
SEXPvariables flagged byrchk:resultintest_farr_findVarInFrame_,dotsincheck_missing_dots, anddimsindropDimension.
filearray 0.2.0
CRAN release: 2025-04-01
- Additional
audo_set_headersto functionfilearray_load_or_createto avoid automatically setting headers, with default beingTRUEfor compatibility concerns
filearray 0.1.9
CRAN release: 2024-11-08
- Fixed
CRANcheck issue brought bytestthatupdate, which requiresbit64when checkingint64arrays. Addedbit64toSuggestsfield to mitigate this check error
filearray 0.1.8
CRAN release: 2024-09-03
- Fixed a bug where
C++errors are not correctly thrown due to a recentRcppupdate. This bug may cause erroneous code to execute ignoring try-catch statement and imbalanced protecting stacks (fwhich,mapreduce)
filearray 0.1.7
CRAN release: 2024-07-16
- Removed non-API R C interface
- Allows
subsetAssignto assign when value length is 1 (thanks@talegariissue#9) - Allows more flexible
fwhichfunction with functionalvalinput and options to include corresponding values as part of return (thanks@talegariissue#10) - Fixed
mapreducebug when partition length is way larger than the buffer size, causing buffer to stop updating - Fixed other
C++issues, such as unused buffer allocation in subset-assign, andmin_offset insub_vec_range. These issues are not considered bugs since they don’t affect the results, but the performance is slightly increased after fix. - Replaced
dipsauswith more updatedravetoolsin the vignette performance profiling - Updated examples to get rid of warning messages and out-dated arguments.
filearray 0.1.6
CRAN release: 2023-06-23
- Removed
c++11from system requirement andMakevars - Used
TinyThreadsinstead ofOpenMPto get parallel working onOSX - Added
as_filearraymethod, and support optionalfloat - Added array proxy class, allowing arrays to lazy-evaluate simple operators
- Allows user-defined temporary file array path
- Fixed
fmapissues, using better guesses for default.input_size - Fixed a memory bug caused when partition margin has elements greater than 1 and when
FARR_subset_sequentialis used - Used
fastmapto avoid environment look-up -
fa_eval_opsallows dimension names - Larger default buffer size to allow
2^20in single partition - Disabled single indexing
- Fixed
endianissue onbig-endianplatforms
filearray 0.1.5
CRAN release: 2022-10-16
- Fixed a bug when trying to read array data sequentially. The bug is caused by buffer size being greater than the array length, making in a pointer that controls the partition number exceed the end of vector, resulting in undefined behavior. The functions affected are:
fmap,fmap2. The bug has been fixed and passedvalgrindmemory check.
filearray 0.1.4
CRAN release: 2022-08-06
- Fixed a bug when allocated memory is one byte short than requested. The bug would crash R when triggered in certain cases.
- Removed limit to the maximum number of partitions when writing. The previous implementation creates and opens related file descriptors all at once before writing. This setup will raise errors when the number of connections reach to certain limit, often defined by the operating systems. This update only opens the connection on demand. The performance might be impacted when writing to disk, but in return, the program will be more robust
- Fixed
subsetfunction environment not resolved correctly when using formula - Added
filearray_load_or_createas an alternative tofilearray_checkloadby automatically replace existing obsolete array files if the headers, dimensions, or data types don’t match. Alsoon_missingargument is provided to allow array initialization if new array is created.
filearray 0.1.3
CRAN release: 2022-01-28
- Automatically detect whether symbolic-link works and show warnings
- Warnings can be suppressed
- Allow extra headers to be set in
metafile - Added header signature method
- Fixed symbolic-link issues on
Windowswhen partition sizes are 0 - Added check-load function
filearray_checkloadto validate header - Fixed collapse method when
dimnamesare set - Fixed an unprotected variable in
C++code -
filearray_bindcan use cache if the header signatures agree -
filearray_bindcan choose to force overwrite - Added package
digesttoImports - Fixed a typo and several small bugs
filearray 0.1.2
CRAN release: 2021-11-25
- Removed
flushin saving data to let system decide when to flush to hard drive - Allowed array to expand along the partition margin
- Fixed dimension name getting dropped under certain situations
- Use 2 cores by default when
R CMD checkis detected
filearray 0.1.1
CRAN release: 2021-09-19
- Added
OpenMPflag in theMakeVars - Fixed critical bugs that could cause
segfaults - Can store
complexandfloatdata types - Re-implemented read/write functions to use memory map
- Allowed
dimnamesto be set - Added generics
subsetto subset usingdimnames - Added vignette to compare performance
- Added speed comparisons in
README.md - Added
collapseto calculate marginal summation with little memory overhead - Added
fmap,fmap2to apply functions to one or multiple file arrays with little memory overhead (also very fast) - Fixed ‘unprotected’ issues warned by
rchk