I/O routines

ElemCo.MIOModule

EC-specific IO routines

Use to store arrays in a file, and to load them back. Use memory-maps to store and load large arrays.

Exported functions

ElemCo.MIO.mioclosemmapMethod
mioclosemmap(io::IO, array::AbstractArray)

Close memory-map file and flush to disk.

ElemCo.MIO.mioloadMethod
mioload(fname::String; array_of_arrays = false)

Load arrays from a file fname.

Return an array of arrays. If there is only one array - return array itself (unless array_of_arrays is set to true).

ElemCo.MIO.mioloadMethod
mioload(fname::String, ::Val{N}, T::Type=Float64; skip_error=false) where {N}

Type-stable load arrays from a file fname.

Return an array of arrays. All arrays have the same type T and have N dimensions. For N = 1, return vectors even if the original array was a multi-dimensional array. If skip_error is set to true, the function will not throw an error if the type of the data/number of dimensions in the file does not match T/N and an array with one empty Array{T,N} will be returned.

ElemCo.MIO.miommapMethod
miommap(fname::String)

Memory-map an existing file for reading. Return a pointer to the file and the mmaped array.

ElemCo.MIO.mionewmmapMethod
mionewmmap(fname::String, dims::Tuple{Vararg{Int}}, Type=Float64)

Create a new memory-map file for writing (overwrites existing file). Return a pointer to the file and the mmaped array.

ElemCo.MIO.miosaveMethod
miosave(fname::String,arrs::AbstractArray{T}...) where T

Save arrays arrs in a file fname.

Internal functions