IOR
Data Structures | Macros | Enumerations | Functions | Variables
aiori-DAOS.c File Reference
#include <stdint.h>
#include <assert.h>
#include <unistd.h>
#include <strings.h>
#include <sys/types.h>
#include <libgen.h>
#include <stdbool.h>
#include <gurt/common.h>
#include <daos.h>
#include "ior.h"
#include "aiori.h"
#include "iordef.h"
Include dependency graph for aiori-DAOS.c:

Go to the source code of this file.

Data Structures

struct  daos_options
 

Macros

#define _BSD_SOURCE
 
#define IOR_DAOS_MUR_SEED   0xDEAD10CC
 
#define DCHECK(rc, format, ...)
 
#define INFO(level, format, ...)
 
#define GERR(format, ...)
 

Enumerations

enum  handleType {
  POOL_HANDLE, CONT_HANDLE, ARRAY_HANDLE, POOL_HANDLE,
  CONT_HANDLE, DFS_HANDLE
}
 

Functions

static void DAOS_Init ()
 
static void DAOS_Fini ()
 
static void * DAOS_Create (char *, IOR_param_t *)
 
static void * DAOS_Open (char *, IOR_param_t *)
 
static int DAOS_Access (const char *, int, IOR_param_t *)
 
static IOR_offset_t DAOS_Xfer (int, void *, IOR_size_t *, IOR_offset_t, IOR_param_t *)
 
static void DAOS_Close (void *, IOR_param_t *)
 
static void DAOS_Delete (char *, IOR_param_t *)
 
static char * DAOS_GetVersion ()
 
static void DAOS_Fsync (void *, IOR_param_t *)
 
static IOR_offset_t DAOS_GetFileSize (IOR_param_t *, MPI_Comm, char *)
 
static option_helpDAOS_options ()
 
static void HandleDistribute (daos_handle_t *handle, enum handleType type)
 
static void gen_oid (const char *name, daos_obj_id_t *oid)
 

Variables

static struct daos_options o
 
static option_help options []
 
ior_aiori_t daos_aiori
 
static daos_handle_t poh
 
static daos_handle_t coh
 
static daos_handle_t aoh
 
static daos_oclass_id_t objectClass = OC_SX
 
static bool daos_initialized = false
 

Macro Definition Documentation

◆ _BSD_SOURCE

#define _BSD_SOURCE

Definition at line 13 of file aiori-DAOS.c.

◆ DCHECK

#define DCHECK (   rc,
  format,
  ... 
)
Value:
do { \
int _rc = (rc); \
\
if (_rc < 0) { \
fprintf(stderr, "ior ERROR (%s:%d): %d: %d: " \
format"\n", __FILE__, __LINE__, rank, _rc, \
##__VA_ARGS__); \
fflush(stdout); \
MPI_Abort(MPI_COMM_WORLD, -1); \
} \
} while (0)
CURLcode rc
Definition: aiori-S3.c:121
int rank
Definition: utilities.c:57

Definition at line 121 of file aiori-DAOS.c.

Referenced by DAOS_Close(), DAOS_Create(), DAOS_Delete(), DAOS_Fini(), DAOS_GetFileSize(), DAOS_Init(), DAOS_Open(), DAOS_Xfer(), and HandleDistribute().

◆ GERR

#define GERR (   format,
  ... 
)
Value:
do { \
fprintf(stderr, format"\n", ##__VA_ARGS__); \
MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1), "MPI_Abort() error"); \
} while (0)

Definition at line 141 of file aiori-DAOS.c.

Referenced by DAOS_Access(), DAOS_Close(), DAOS_Delete(), DAOS_GetFileSize(), DAOS_Init(), and DAOS_Open().

◆ INFO

#define INFO (   level,
  format,
  ... 
)
Value:
do { \
if (verbose >= level) \
printf("[%d] "format"\n", rank, ##__VA_ARGS__); \
} while (0)
int verbose
Definition: utilities.c:59
int rank
Definition: utilities.c:57

Definition at line 134 of file aiori-DAOS.c.

Referenced by DAOS_Fini(), and DAOS_Init().

◆ IOR_DAOS_MUR_SEED

#define IOR_DAOS_MUR_SEED   0xDEAD10CC

Definition at line 104 of file aiori-DAOS.c.

Referenced by gen_oid().

Enumeration Type Documentation

◆ handleType

enum handleType
Enumerator
POOL_HANDLE 
CONT_HANDLE 
ARRAY_HANDLE 
POOL_HANDLE 
CONT_HANDLE 
DFS_HANDLE 

Definition at line 106 of file aiori-DAOS.c.

Function Documentation

◆ DAOS_Access()

static int DAOS_Access ( const char *  testFileName,
int  mode,
IOR_param_t param 
)
static

Convert file name into object ID

Definition at line 366 of file aiori-DAOS.c.

References aoh, daos_options::chunk_size, coh, gen_oid(), GERR, NULL, and rc.

Here is the call graph for this function:

◆ DAOS_Close()

static void DAOS_Close ( void *  file,
IOR_param_t param 
)
static

Definition at line 449 of file aiori-DAOS.c.

References aoh, daos_initialized, DCHECK, GERR, NULL, and rc.

◆ DAOS_Create()

static void * DAOS_Create ( char *  testFileName,
IOR_param_t param 
)
static

Convert file name into object ID

Create the array

Distribute the array handle if not FPP

Definition at line 343 of file aiori-DAOS.c.

References aoh, ARRAY_HANDLE, daos_options::chunk_size, coh, DCHECK, IOR_param_t::filePerProc, gen_oid(), HandleDistribute(), NULL, rank, and rc.

Here is the call graph for this function:

◆ DAOS_Delete()

static void DAOS_Delete ( char *  testFileName,
IOR_param_t param 
)
static

Convert file name into object ID

open the array to verify it exists

Definition at line 463 of file aiori-DAOS.c.

References aoh, daos_options::chunk_size, coh, daos_initialized, DCHECK, gen_oid(), GERR, NULL, and rc.

Here is the call graph for this function:

◆ DAOS_Fini()

static void DAOS_Fini ( )
static

◆ DAOS_Fsync()

static void DAOS_Fsync ( void *  file,
IOR_param_t param 
)
static

Definition at line 501 of file aiori-DAOS.c.

◆ DAOS_GetFileSize()

static IOR_offset_t DAOS_GetFileSize ( IOR_param_t param,
MPI_Comm  testComm,
char *  testFileName 
)
static

Convert file name into object ID

open the array to verify it exists

Definition at line 507 of file aiori-DAOS.c.

References aoh, daos_options::chunk_size, coh, daos_initialized, DCHECK, IOR_param_t::filePerProc, gen_oid(), GERR, NULL, rank, rc, and size.

Here is the call graph for this function:

◆ DAOS_GetVersion()

static char * DAOS_GetVersion ( )
static

Definition at line 492 of file aiori-DAOS.c.

◆ DAOS_Init()

static void DAOS_Init ( )
static

◆ DAOS_Open()

static void * DAOS_Open ( char *  testFileName,
IOR_param_t param 
)
static

Convert file name into object ID

Open the array

Distribute the array handle if not FPP

Definition at line 389 of file aiori-DAOS.c.

References aoh, ARRAY_HANDLE, daos_options::chunk_size, coh, DCHECK, IOR_param_t::filePerProc, gen_oid(), GERR, HandleDistribute(), NULL, rank, and rc.

Here is the call graph for this function:

◆ DAOS_options()

static option_help * DAOS_options ( )
static

Definition at line 206 of file aiori-DAOS.c.

References options.

◆ DAOS_Xfer()

static IOR_offset_t DAOS_Xfer ( int  access,
void *  file,
IOR_size_t buffer,
IOR_offset_t  length,
IOR_param_t param 
)
static

set array location

set memory location

Definition at line 417 of file aiori-DAOS.c.

References aoh, DCHECK, NULL, IOR_param_t::offset, rc, and WRITE.

◆ gen_oid()

static void gen_oid ( const char *  name,
daos_obj_id_t *  oid 
)
static

Definition at line 333 of file aiori-DAOS.c.

References IOR_DAOS_MUR_SEED, and objectClass.

Referenced by DAOS_Access(), DAOS_Create(), DAOS_Delete(), DAOS_GetFileSize(), and DAOS_Open().

Here is the caller graph for this function:

◆ HandleDistribute()

static void HandleDistribute ( daos_handle_t *  handle,
enum handleType  type 
)
static

Definition at line 149 of file aiori-DAOS.c.

References coh, CONT_HANDLE, DCHECK, ERR, MPI_CHECK, NULL, poh, POOL_HANDLE, rank, and rc.

Referenced by DAOS_Create(), DAOS_Init(), and DAOS_Open().

Here is the caller graph for this function:

Variable Documentation

◆ aoh

daos_handle_t aoh
static

◆ coh

daos_handle_t coh
static

◆ daos_aiori

ior_aiori_t daos_aiori
Initial value:
= {
.name = "DAOS",
.create = DAOS_Create,
.open = DAOS_Open,
.access = DAOS_Access,
.xfer = DAOS_Xfer,
.close = DAOS_Close,
.delete = DAOS_Delete,
.get_version = DAOS_GetVersion,
.fsync = DAOS_Fsync,
.get_file_size = DAOS_GetFileSize,
.initialize = DAOS_Init,
.finalize = DAOS_Fini,
.get_options = DAOS_options,
.statfs = aiori_posix_statfs,
}
static void DAOS_Fini()
Definition: aiori-DAOS.c:279
static void DAOS_Fsync(void *, IOR_param_t *)
Definition: aiori-DAOS.c:501
static void * DAOS_Open(char *, IOR_param_t *)
Definition: aiori-DAOS.c:389
static IOR_offset_t DAOS_GetFileSize(IOR_param_t *, MPI_Comm, char *)
Definition: aiori-DAOS.c:507
int aiori_posix_rmdir(const char *path, IOR_param_t *param)
Definition: aiori.c:185
int aiori_posix_mkdir(const char *path, mode_t mode, IOR_param_t *param)
Definition: aiori.c:180
static IOR_offset_t DAOS_Xfer(int, void *, IOR_size_t *, IOR_offset_t, IOR_param_t *)
Definition: aiori-DAOS.c:417
static void * DAOS_Create(char *, IOR_param_t *)
Definition: aiori-DAOS.c:343
int aiori_posix_statfs(const char *path, ior_aiori_statfs_t *stat_buf, IOR_param_t *param)
Definition: aiori.c:155
static void DAOS_Close(void *, IOR_param_t *)
Definition: aiori-DAOS.c:449
static void DAOS_Delete(char *, IOR_param_t *)
Definition: aiori-DAOS.c:463
static char * DAOS_GetVersion()
Definition: aiori-DAOS.c:492
static option_help * DAOS_options()
Definition: aiori-DAOS.c:206
static void DAOS_Init()
Definition: aiori-DAOS.c:212
int aiori_posix_stat(const char *path, struct stat *buf, IOR_param_t *param)
Definition: aiori.c:195
static int DAOS_Access(const char *, int, IOR_param_t *)
Definition: aiori-DAOS.c:366

Definition at line 84 of file aiori-DAOS.c.

◆ daos_initialized

bool daos_initialized = false
static

Definition at line 116 of file aiori-DAOS.c.

Referenced by DAOS_Close(), DAOS_Delete(), DAOS_Fini(), DAOS_GetFileSize(), and DAOS_Init().

◆ o

struct daos_options o
static
Initial value:
= {
.pool = NULL,
.svcl = NULL,
.group = NULL,
.cont = NULL,
.chunk_size = 1048576,
.destroy = 0,
.oclass = NULL,
}
#define NULL
Definition: iordef.h:79

Definition at line 45 of file aiori-DAOS.c.

◆ objectClass

daos_oclass_id_t objectClass = OC_SX
static

Definition at line 115 of file aiori-DAOS.c.

Referenced by DAOS_Init(), and gen_oid().

◆ options

option_help options[]
static
Initial value:
= {
{0, "daos.pool", "pool uuid", OPTION_OPTIONAL_ARGUMENT, 's', &o.pool},
{0, "daos.svcl", "pool SVCL", OPTION_OPTIONAL_ARGUMENT, 's', &o.svcl},
{0, "daos.group", "server group", OPTION_OPTIONAL_ARGUMENT, 's', &o.group},
{0, "daos.cont", "container uuid", OPTION_OPTIONAL_ARGUMENT, 's', &o.cont},
{0, "daos.chunk_size", "chunk size", OPTION_OPTIONAL_ARGUMENT, 'd', &o.chunk_size},
{0, "daos.destroy", "Destroy Container", OPTION_FLAG, 'd', &o.destroy},
{0, "daos.oclass", "object class", OPTION_OPTIONAL_ARGUMENT, 's', &o.oclass},
}
#define LAST_OPTION
Definition: option.h:37
char * svcl
Definition: aiori-DAOS.c:37
char * group
Definition: aiori-DAOS.c:38
int chunk_size
Definition: aiori-DAOS.c:40
char * cont
Definition: aiori-DAOS.c:39
static struct daos_options o
Definition: aiori-DAOS.c:45
char * oclass
Definition: aiori-DAOS.c:42
char * pool
Definition: aiori-DAOS.c:36

Definition at line 55 of file aiori-DAOS.c.

Referenced by DAOS_options().

◆ poh

daos_handle_t poh
static

Definition at line 112 of file aiori-DAOS.c.

Referenced by DAOS_Fini(), DAOS_Init(), and HandleDistribute().