Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1707

Add llapi_* function to return the OST/MDT count for a path.

Details

    • 10514

    Description

      It would be valuable to programmatically discover the number of OSTs that are available. An llapi_* function would be a suitable place for this call.

      Use Case

      When writing HDF5 files one typically configures the number of writers as a fraction of the number of OSTs for best performance.

      Currently this information is only available by writing a file with stripe count set to -1 and then counting the number of stripes present. A programmatic interface to the OST count would simplify this task.

      Attachments

        Issue Links

          Activity

            [LU-1707] Add llapi_* function to return the OST/MDT count for a path.
            afn Andy Nelson added a comment -


            See my above comment of 4:42 Dec 6, 2013, re llapi_get_obd_count in the context of closing this ticket.

            afn Andy Nelson added a comment - See my above comment of 4:42 Dec 6, 2013, re llapi_get_obd_count in the context of closing this ticket.

            While looking at LU-2182 I noticed this ticket. This functionality has been implemented as

            int llapi_get_obd_count(char *mnt, int *count, int is_mdt)

            If this fits what you are looking for then let us know so this ticket can be closed.

            simmonsja James A Simmons added a comment - While looking at LU-2182 I noticed this ticket. This functionality has been implemented as int llapi_get_obd_count(char *mnt, int *count, int is_mdt) If this fits what you are looking for then let us know so this ticket can be closed.

            An even simpler case: A filesystem has 100 OSTs, but one is marked inactive. The function should return 99 in that case.

            morrone Christopher Morrone (Inactive) added a comment - An even simpler case: A filesystem has 100 OSTs, but one is marked inactive. The function should return 99 in that case.

            I understand. My interpretation is now that both Andy and myself do want the 'maximum stripe count', as you suggested.

            rhenwood Richard Henwood (Inactive) added a comment - I understand. My interpretation is now that both Andy and myself do want the 'maximum stripe count', as you suggested.
            jhammond John Hammond added a comment -

            IIRC any system with more than 2000 OSTs will have this property.

            jhammond John Hammond added a comment - IIRC any system with more than 2000 OSTs will have this property.

            John: thanks for your thoughts on this.

            Can you provide an example when: the # of available OSTs != maximum stripe count?

            rhenwood Richard Henwood (Inactive) added a comment - John: thanks for your thoughts on this. Can you provide an example when: the # of available OSTs != maximum stripe count?
            afn Andy Nelson added a comment -

            The thing I want is the maximum number of components I can stripe over from the point of view of my running application.
            I need that quantity for what appears to be exactly the same use case as Richard describes above...setting how many
            (and which) writers I should have.

            So something along the lines of your first suggestion seems the most appropriate for me.

            I'm not really clear on the differences, subtle and not so subtle, between the alphabet soup
            of ost's, obd's, oss's, mds's mdt's and so on, so I'll leave the second issue to you

            Andy

            afn Andy Nelson added a comment - The thing I want is the maximum number of components I can stripe over from the point of view of my running application. I need that quantity for what appears to be exactly the same use case as Richard describes above...setting how many (and which) writers I should have. So something along the lines of your first suggestion seems the most appropriate for me. I'm not really clear on the differences, subtle and not so subtle, between the alphabet soup of ost's, obd's, oss's, mds's mdt's and so on, so I'll leave the second issue to you Andy
            jhammond John Hammond added a comment -

            Do we really want to know how many OSTs are available or rather do we want to know what is the maximum stripe count we can get on a file? I suspect it is the latter. If so we should add a function whose name reflects this (say llapi_get_max_stripe_count(int fd/const char *path/...).

            Second, in the lustre source not all OBDs are OSTs, so if we want the OST count then the function should be llapi_get_ost_count().

            jhammond John Hammond added a comment - Do we really want to know how many OSTs are available or rather do we want to know what is the maximum stripe count we can get on a file? I suspect it is the latter. If so we should add a function whose name reflects this (say llapi_get_max_stripe_count(int fd/const char *path/...). Second, in the lustre source not all OBDs are OSTs, so if we want the OST count then the function should be llapi_get_ost_count().
            afn Andy Nelson added a comment -

            Just noticed this ticket/thread. I also need this functionality from within my code
            and Ned has recommended the undocumented function "llapi_get_obd_count" to get the
            required info in another thread. The problem/difficulty with it is apparently that it
            requires ioctl functionality to work, which is problematic on machines like sequoia.
            The current status right now is that it has a work around to avoid the ioctl, but
            I don't know how generally effective that workaround is.

            In any case, I'm glad it is more than just me that needs this...things are always
            more likely to get fixed when multiple wheels are squeaking

            Andy

            afn Andy Nelson added a comment - Just noticed this ticket/thread. I also need this functionality from within my code and Ned has recommended the undocumented function "llapi_get_obd_count" to get the required info in another thread. The problem/difficulty with it is apparently that it requires ioctl functionality to work, which is problematic on machines like sequoia. The current status right now is that it has a work around to avoid the ioctl, but I don't know how generally effective that workaround is. In any case, I'm glad it is more than just me that needs this...things are always more likely to get fixed when multiple wheels are squeaking Andy

            It seems like the function in lustreapi.h is

            int llapi_ostlist(char *path, struct find_param *param);
            

            The documentation is, sparse. I'll try and rustle up a usage example.

            rhenwood Richard Henwood (Inactive) added a comment - It seems like the function in lustreapi.h is int llapi_ostlist(char *path, struct find_param *param); The documentation is, sparse. I'll try and rustle up a usage example.

            The number of OST's on the system is available using the command:

            # lfs osts /mnt/lustre/
            OBDS::
            0: lustre-OST0000_UUID ACTIVE
            1: lustre-OST0001_UUID ACTIVE
            
            rhenwood Richard Henwood (Inactive) added a comment - The number of OST's on the system is available using the command: # lfs osts /mnt/lustre/ OBDS:: 0: lustre-OST0000_UUID ACTIVE 1: lustre-OST0001_UUID ACTIVE

            People

              wc-triage WC Triage
              rhenwood Richard Henwood (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: