adios: adios_file_R6

Description Usage Arguments Methods Examples

View source: R/adios.r

Description

R6 classes and methods for ADIOS2 file operations.

Usage

1
adios(path, config, io_name, comm = NULL, mode = "read")

Arguments

path

File path.

config

An ADIOS2 config file.

io_name

The IO configuration ("io name" key) to use.

comm

A communicator number from pbdMPI if the package is installed with MPI support; will use MPI_COMM_WORLD by default. Otherwise the param is ignored.

mode

"read" or "write".

Methods

Public methods


Method new()

Usage
adios_R6$new(path, config, io_name, comm = NULL, mode = "read")
Arguments
path

File path.

config

An ADIOS2 config file.

io_name

The IO configuration ("io name" key) to use.

comm

A communicator number from pbdMPI if the package is installed with MPI support; will use MPI_COMM_WORLD by default. Otherwise the param is ignored.

mode

"read" or "write".

Details

Open the file.


Method available_variables()

Usage
adios_R6$available_variables()
Details

List available variables in a file.


Method close()

Usage
adios_R6$close()
Details

Close the file.


Method fileinfo()

Usage
adios_R6$fileinfo()
Details

Returns basic file info.


Method print()

Usage
adios_R6$print()
Details

Print some basic file information.


Method advance()

Usage
adios_R6$advance(timeout = 10)
Arguments
timeout

Timeout in seconds between trying to advance the step in the case data is being read in streams (otherwise ignored).

Details

Advance the step when using time steps for reading/writing.


Method step()

Usage
adios_R6$step()
Details

Returns the current time step.


Method read()

Usage
adios_R6$read(var)
Arguments
var

String name of the desired variable.

Details

Reads the array of a variable into R memory. Returns NULL when the steps are finished.


Method read_to_buf()

Usage
adios_R6$read_to_buf(var, buf)
Arguments
var

String name of the desired variable.

buf

Buffer space.

Details

Reads the array of a variable into pre-allocated R memory. If the buffer is inappropriately sized, terrible things may happen. Does nothing when the steps are finished.


Method write()

Usage
adios_R6$write(var, x)
Arguments
var

String name of the desired variable.

x

R vector/matrix object.

Details

Write the R vector/matrix to a file.


Method clone()

The objects of this class are cloneable with this method.

Usage
adios_R6$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
suppressMessages(library(hola))

ad = adios("/path/to/my/dataset")
myvar_step_0 = ad$read("my_variable")
ad$advance()
myvar_step_2 = ad$read("my_variable")

## End(Not run)

RBigData/hola documentation built on Aug. 18, 2021, 4:28 p.m.