Topics

DAOS starting example in C++


adam.abed.abud@...
 

Hello everyone,

Is there a starting C++ example (with its relative CMake file) that writes and reads data with the DAOS API?

Thanks a lot.

Cheers,
Adam

 


Steffen Christgau
 

Hi Adam,

On 18/09/2020 16.34, adam.abed.abud@... wrote:
Is there a starting C++ example (with its relative CMake file) that
writes and reads data with the DAOS API?
AFAIK there is no C++ binding but one for C ;-) [1] Unfortunately, the
link to the Doxygen documentation does not work, but I used the native
API successfully. Since the header files [2] contain the Doxygen input
you find valuable information there.

Concerning compilation, there's nothing more to do than setting the
include directory and the library name (and path) which is daos. In
addition, you may need additional libs: like daos_common, gurt, and uuid.

Regards, Steffen

[1] https://daos-stack.github.io/user/interface/
[2] https://github.com/daos-stack/daos/tree/v1.0.1/src/include


Lombardi, Johann
 

Hi there,

 

Please find attached a small test that you can compile as follows:

$ gcc -o test -L${DAOS_PATH}/lib64 -I${DAOS_PATH}/include -ldaos -lgurt -ldaos_common -luuid ./test.c

 

And then run:

$ D_LOG_MASK=ERR ./test

Initializing DAOS               OK

Parsing svcl                        OK

Connecting to pool           OK

Opening container            OK

Object open                       OK

Writing to object               OK

Closing object                    OK

Closing container              OK

Disconnecting from pool OK

Tearing down DAOS          OK

 

It provides the basics to connect to a pool, open a container and write some KV entries in parallel.

 

Regarding the online Doxygen documentation, it seems to go away each time I update the GitHub I/O pages with mkdocs. I need to spend some time to understand and fix this.

 

HTH

 

Cheers,

Johann

 

From: <daos@daos.groups.io> on behalf of Steffen Christgau <christgau@...>
Reply-To: "daos@daos.groups.io" <daos@daos.groups.io>
Date: Friday 18 September 2020 at 17:00
To: "daos@daos.groups.io" <daos@daos.groups.io>
Subject: Re: [daos] DAOS starting example in C++

 

Hi Adam,

 

On 18/09/2020 16.34, adam.abed.abud@... wrote:

Is there a starting C++ example (with its relative CMake file) that

writes and reads data with the DAOS API?

 

AFAIK there is no C++ binding but one for C ;-) [1] Unfortunately, the

link to the Doxygen documentation does not work, but I used the native

API successfully. Since the header files [2] contain the Doxygen input

you find valuable information there.

 

Concerning compilation, there's nothing more to do than setting the

include directory and the library name (and path) which is daos. In

addition, you may need additional libs: like daos_common, gurt, and uuid.

 

Regards, Steffen

 

 

 

 

 

 

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


adam.abed.abud@...
 

Hi Johann,

Thanks a lot for your feedback.

I compiled the project and I finally managed to get it running on the cluster.

Cheers,
Adam