<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Many thanks, Andreas!
<div>That is exactly what I need.</div>
<div><br id="lineBreakAtBeginningOfMessage">
<div>
<div>Wei-keng</div>
</div>
<div><br>
<blockquote type="cite">
<div>On Dec 20, 2025, at 2:13 PM, Andreas Dilger <adilger@thelustrecollective.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div>There is a function to return the number of OSTs at a specific directory (it does not need to be the mount point of the filesystem):<br>
<br>
int llapi_get_obd_count(char *dir, int *count, int is_mdt);<br>
<br>
that looks like what you want.  It appears there is no man page for this, so it should be added.
<br>
<br>
Cheers, Andreas<br>
<br>
<blockquote type="cite">On Dec 20, 2025, at 12:45, Wei-Keng Liao via lustre-discuss <lustre-discuss@lists.lustre.org> wrote:<br>
<br>
<br>
I am trying to get the total number of available OSTs given<br>
a folder name, through calls of Luster user C APIs, but failed<br>
to do so, when a layout has no pool name. I have tried the followings.<br>
<br>
At first, call llapi_layout_get_by_fd() to obtain a folder's 'layout'.<br>
<br>
llapi_layout_pool_name_get() returns successfully, but the returned<br>
pool_name is empty.<br>
<br>
llapi_getname() returns a valid fsname.<br>
<br>
llapi_get_poolmembers() returns -22 (i.e. -EINVAL), when using<br>
the 'fsname' as the argument 'poolname.'<br>
<br>
If I appended a dot, '.', to fsname, llapi_get_poolmembers() returns<br>
successfully, but the returned value is 0 (number of members).<br>
<br>
When doing my experiments on Polaris at ALCF, I have also tried<br>
the following lfs commands at the prompt of login node.<br>
<br>
% lfs  pool_list /eagle<br>
Pools from eagle:<br>
<br>
% lfs getname -n /eagle<br>
eagle<br>
<br>
% lfs osts /eagle |wc -l<br>
161<br>
<br>
Command 'lfs osts /eagle' shows there are 160 OSTs.<br>
<br>
On Perlmutter at NERSC, its Lustre has a pool name, and thus<br>
I was able to make the above Lustre user API calls to retrieve<br>
the total number of available OSTs.<br>
<br>
In summary, my question is how do I properly make calls to Lustre<br>
user C APIs when a layout has no pool name?<br>
<br>
<br>
Wei-keng Liao<br>
_______________________________________________<br>
lustre-discuss mailing list<br>
lustre-discuss@lists.lustre.org<br>
https://urldefense.com/v3/__http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org__;!!Dq0X2DkFhyF93HkjWTBQKhk!R432bn01myTefro_9rhZkiZXFEVK7s8IZ44AUVxA48SvonoylTFUJ6T-I-Vj1XEquHsfNW3NJeU6_A-gWa_piDzyGvb5m8Q$
<br>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>