Skip to content

Handle Debugging:File queries

Marc-Andre edited this page Apr 8, 2025 · 6 revisions

File queries

These functions are analogous to the mpid_comm_* functions, but for MPI_File.

int mpid_file_query(mpid_process_handle_t *process,
                      mpid_address_t file,
                      mpid_file_handle_t **handle);

Free a handle returned by the mpid_file_query() function.

int mpid_file_handle_free(mpid_file_handle_t *handle);
enum mpid_file_access_mode_bitmap_t {
  MPID_MODE_RDONLY          = 0X1,
  MPID_MODE_RDWR            = 0X2,
  MPID_MODE_WRONLY          = 0X4,
  MPID_MODE_CREATE          = 0X8,
  MPID_MODE_EXCL            = 0X10,
  MPID_MODE_DELETE_ON_CLOSE = 0X20,
  MPID_MODE_UNIQUE_OPEN     = 0X40,
  MPID_MODE_SEQUENTIAL      = 0X80,
  MPID_MODE_APPEND          = 0X100
};
int mpid_file_query_basic(
                      mpid_file_handle_t *handle,
                      mpid_comm_handle_t **file_comm,
                      char **file_name,
                      int *amode, // using values of mpid_file_access_mode_bitmap_t
                      mpid_info_handle_t **file_info,
                      int *atomicity, // true if atomic mode
                      mpid_offset_t *displacement,
                      mpid_type_handle_t ** etype,
                      mpid_type_handle_t ** filetype,
                      char **datarep,
                      mpid_offset_t *pos,
                      mpid_offset_t *pos_shared,
                      int64 *file_fortran_handle,
                      int64 *file_fortran90_handle, /* might this be different? */
                      mpid_address_t *file_c_handle);

TODO: define mpid_offset_t large enough to store offsets into files (64-bit even on 32-bit target systems)

Session query function:

Query a handle returned by mpid_file_query() and, if found and valid, return the session this communicator was derived from

int mpid_file_query_session(mpid_file_handle_t *handle,
                            mpid_session_handle_t **file_session);
Clone this wiki locally