mpi4py.MPI.File

class mpi4py.MPI.File(file=None)

Bases: object

File handle

Parameters

file (Optional[File]) –

Return type

File

static __new__(cls, file=None)
Parameters

file (Optional[File]) –

Return type

File

Methods Summary

Call_errhandler(errorcode)

Call the error handler installed on a file

Close()

Close a file

Delete(filename[, info])

Delete a file

Get_amode()

Return the file access mode

Get_atomicity()

Return the atomicity mode

Get_byte_offset(offset)

Return the absolute byte position in the file corresponding to 'offset' etypes relative to the current view

Get_errhandler()

Get the error handler for a file

Get_group()

Return the group of processes that opened the file

Get_info()

Return the hints for a file that that are currently in use

Get_position()

Return the current position of the individual file pointer in etype units relative to the current view

Get_position_shared()

Return the current position of the shared file pointer in etype units relative to the current view

Get_size()

Return the file size

Get_type_extent(datatype)

Return the extent of datatype in the file

Get_view()

Return the file view

Iread(buf)

Nonblocking read using individual file pointer

Iread_all(buf)

Nonblocking collective read using individual file pointer

Iread_at(offset, buf)

Nonblocking read using explicit offset

Iread_at_all(offset, buf)

Nonblocking collective read using explicit offset

Iread_shared(buf)

Nonblocking read using shared file pointer

Iwrite(buf)

Nonblocking write using individual file pointer

Iwrite_all(buf)

Nonblocking collective write using individual file pointer

Iwrite_at(offset, buf)

Nonblocking write using explicit offset

Iwrite_at_all(offset, buf)

Nonblocking collective write using explicit offset

Iwrite_shared(buf)

Nonblocking write using shared file pointer

Open(comm, filename[, amode, info])

Open a file

Preallocate(size)

Preallocate storage space for a file

Read(buf[, status])

Read using individual file pointer

Read_all(buf[, status])

Collective read using individual file pointer

Read_all_begin(buf)

Start a split collective read using individual file pointer

Read_all_end(buf[, status])

Complete a split collective read using individual file pointer

Read_at(offset, buf[, status])

Read using explicit offset

Read_at_all(offset, buf[, status])

Collective read using explicit offset

Read_at_all_begin(offset, buf)

Start a split collective read using explict offset

Read_at_all_end(buf[, status])

Complete a split collective read using explict offset

Read_ordered(buf[, status])

Collective read using shared file pointer

Read_ordered_begin(buf)

Start a split collective read using shared file pointer

Read_ordered_end(buf[, status])

Complete a split collective read using shared file pointer

Read_shared(buf[, status])

Read using shared file pointer

Seek(offset[, whence])

Update the individual file pointer

Seek_shared(offset[, whence])

Update the shared file pointer

Set_atomicity(flag)

Set the atomicity mode

Set_errhandler(errhandler)

Set the error handler for a file

Set_info(info)

Set new values for the hints associated with a file

Set_size(size)

Sets the file size

Set_view([disp, etype, filetype, datarep, info])

Set the file view

Sync()

Causes all previous writes to be transferred to the storage device

Write(buf[, status])

Write using individual file pointer

Write_all(buf[, status])

Collective write using individual file pointer

Write_all_begin(buf)

Start a split collective write using individual file pointer

Write_all_end(buf[, status])

Complete a split collective write using individual file pointer

Write_at(offset, buf[, status])

Write using explicit offset

Write_at_all(offset, buf[, status])

Collective write using explicit offset

Write_at_all_begin(offset, buf)

Start a split collective write using explict offset

Write_at_all_end(buf[, status])

Complete a split collective write using explict offset

Write_ordered(buf[, status])

Collective write using shared file pointer

Write_ordered_begin(buf)

Start a split collective write using shared file pointer

Write_ordered_end(buf[, status])

Complete a split collective write using shared file pointer

Write_shared(buf[, status])

Write using shared file pointer

f2py(arg)

py2f()

Attributes Summary

amode

file access mode

atomicity

group

file group

info

file info

size

file size

Methods Documentation

Call_errhandler(errorcode)

Call the error handler installed on a file

Parameters

errorcode (int) –

Return type

None

Close()

Close a file

Return type

None

classmethod Delete(filename, info=INFO_NULL)

Delete a file

Parameters
  • filename (str) –

  • info (Info) –

Return type

None

Get_amode()

Return the file access mode

Return type

int

Get_atomicity()

Return the atomicity mode

Return type

bool

Get_byte_offset(offset)

Return the absolute byte position in the file corresponding to ‘offset’ etypes relative to the current view

Parameters

offset (int) –

Return type

int

Get_errhandler()

Get the error handler for a file

Return type

Errhandler

Get_group()

Return the group of processes that opened the file

Return type

Group

Get_info()

Return the hints for a file that that are currently in use

Return type

Info

Get_position()

Return the current position of the individual file pointer in etype units relative to the current view

Return type

int

Get_position_shared()

Return the current position of the shared file pointer in etype units relative to the current view

Return type

int

Get_size()

Return the file size

Return type

int

Get_type_extent(datatype)

Return the extent of datatype in the file

Parameters

datatype (Datatype) –

Return type

int

Get_view()

Return the file view

Return type

Tuple[int, Datatype, Datatype, str]

Iread(buf)

Nonblocking read using individual file pointer

Parameters

buf (BufSpec) –

Return type

Request

Iread_all(buf)

Nonblocking collective read using individual file pointer

Parameters

buf (BufSpec) –

Return type

Request

Iread_at(offset, buf)

Nonblocking read using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

Request

Iread_at_all(offset, buf)

Nonblocking collective read using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

Request

Iread_shared(buf)

Nonblocking read using shared file pointer

Parameters

buf (BufSpec) –

Return type

Request

Iwrite(buf)

Nonblocking write using individual file pointer

Parameters

buf (BufSpec) –

Return type

Request

Iwrite_all(buf)

Nonblocking collective write using individual file pointer

Parameters

buf (BufSpec) –

Return type

Request

Iwrite_at(offset, buf)

Nonblocking write using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

Request

Iwrite_at_all(offset, buf)

Nonblocking collective write using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

Request

Iwrite_shared(buf)

Nonblocking write using shared file pointer

Parameters

buf (BufSpec) –

Return type

Request

classmethod Open(comm, filename, amode=MODE_RDONLY, info=INFO_NULL)

Open a file

Parameters
Return type

File

Preallocate(size)

Preallocate storage space for a file

Parameters

size (int) –

Return type

None

Read(buf, status=None)

Read using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_all(buf, status=None)

Collective read using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_all_begin(buf)

Start a split collective read using individual file pointer

Parameters

buf (BufSpec) –

Return type

None

Read_all_end(buf, status=None)

Complete a split collective read using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_at(offset, buf, status=None)

Read using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_at_all(offset, buf, status=None)

Collective read using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_at_all_begin(offset, buf)

Start a split collective read using explict offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

None

Read_at_all_end(buf, status=None)

Complete a split collective read using explict offset

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_ordered(buf, status=None)

Collective read using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_ordered_begin(buf)

Start a split collective read using shared file pointer

Parameters

buf (BufSpec) –

Return type

None

Read_ordered_end(buf, status=None)

Complete a split collective read using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Read_shared(buf, status=None)

Read using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Seek(offset, whence=SEEK_SET)

Update the individual file pointer

Parameters
  • offset (int) –

  • whence (int) –

Return type

None

Seek_shared(offset, whence=SEEK_SET)

Update the shared file pointer

Parameters
  • offset (int) –

  • whence (int) –

Return type

None

Set_atomicity(flag)

Set the atomicity mode

Parameters

flag (bool) –

Return type

None

Set_errhandler(errhandler)

Set the error handler for a file

Parameters

errhandler (Errhandler) –

Return type

None

Set_info(info)

Set new values for the hints associated with a file

Parameters

info (Info) –

Return type

None

Set_size(size)

Sets the file size

Parameters

size (int) –

Return type

None

Set_view(disp=0, etype=BYTE, filetype=None, datarep='native', info=INFO_NULL)

Set the file view

Parameters
Return type

None

Sync()

Causes all previous writes to be transferred to the storage device

Return type

None

Write(buf, status=None)

Write using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_all(buf, status=None)

Collective write using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_all_begin(buf)

Start a split collective write using individual file pointer

Parameters

buf (BufSpec) –

Return type

None

Write_all_end(buf, status=None)

Complete a split collective write using individual file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_at(offset, buf, status=None)

Write using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_at_all(offset, buf, status=None)

Collective write using explicit offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_at_all_begin(offset, buf)

Start a split collective write using explict offset

Parameters
  • offset (int) –

  • buf (BufSpec) –

Return type

None

Write_at_all_end(buf, status=None)

Complete a split collective write using explict offset

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_ordered(buf, status=None)

Collective write using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_ordered_begin(buf)

Start a split collective write using shared file pointer

Parameters

buf (BufSpec) –

Return type

None

Write_ordered_end(buf, status=None)

Complete a split collective write using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

Write_shared(buf, status=None)

Write using shared file pointer

Parameters
  • buf (BufSpec) –

  • status (Optional[Status]) –

Return type

None

classmethod f2py(arg)
Parameters

arg (int) –

Return type

File

py2f()
Return type

int

Attributes Documentation

amode

file access mode

atomicity
group

file group

info

file info

size

file size