[lustre-discuss] How to do Lustre settings for a file from C++ code

Rob Latham robl at mcs.anl.gov
Mon Feb 22 12:05:41 PST 2016

On 02/22/2016 01:28 PM, Dilger, Andreas wrote:
> On Mon, 2016-02-22 at 13:36 +0000, Prakrati.Agrawal at shell.com wrote:
>> Hi,
>> I am writing multiple files to Lustre file system of different sizes.
>> I want to change my stripe size and stripe count from the C++ code. I
>> am using HDF5 to create file and hyperslabs and write in it. Is there
>> any way to do it?
> There is a library "liblustreapi" that has C function interfaces for
> creating files with specific stripe parameters - llapi_file_open() is the
> most basic interface that allows open/create of a file and setting the
> stripe count, stripe size, and starting OST index.  A more complete
> interface is llapi_file_open_param() that lets the application specify
> more parameters for the layout.

wow, that is a lot better than setting up a struct lov_user_md and then 
calling an ioctl() with the LL_IOC_LOV_SETSTRIPE flag:


I'm only contributing to the conversation to offer a cautionary tale. 
Don't do what ROMIO does!


More information about the lustre-discuss mailing list