Open a database¶
saf_open_database
is a function defined in db.c.
Synopsis:
-
SAF_Db *
saf_open_database
(const char *path, SAF_DbProps *properties)¶
Formal Arguments:
path
: The name of the database.properties
: This argument, if not null, provides database properties that will override the default properties provided by saf_createProps_database.
Description: Opens or creates a database for read and/or write access (depending on properties
)
using the communicator specified in properties
. The name of the database, path
, is a file name. The
properties
argument, if not SAF__DEFAULT_DBPROPS
, provides database properties that will
override the default properties set by saf_createProps_database.
Preconditions:
path
must be non-null. (low-cost)properties
must be a valid handle if supplied. (high-cost)
Return Value: Returns a new handle to the opened database on success; NULL
on failure (or an exception is raised).
Parallel Notes: This is a collective, SAF__ALL
mode, call in the communicator specified by the properties
passed in the call.
Issues: It would be nice to identify the current processor decomposition, if possible. At the moment, we can’t. But
the idea would be that if we’re opening an already existing database, we should search for a PROCESSOR
collection on the top set(s) such that the size of that collection is equal to the value returnd by
MPI_Comm_size
above. In this way, the database could “know” which sets are associated with which processors.
At present we don’t do this.
See Also:
- saf_createProps_database: 8.2: Create a new database property list with default values
- Databases: Introduction for current chapter