[ofa-general] uDAPL libdat2.so version # problem for today's OFED code

Tang, Changqing changquing.tang at hp.com
Tue Feb 12 15:32:16 PST 2008


Arlin:
        Here is another question.

The /etc/dat.conf is:
OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib0 0" ""
OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 "ib1 0" ""
ofa-v2-ib0 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib0 0" ""
ofa-v2-ib1 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 "ib1 0" ""

        A simple code just call dat_registry_list_prodivers() to get the list
in /etc/dat.conf, and call dat_ia_openv() in a loop of above list. If I compile
and link this code with /usr/include/dat2 and libdat2.so,  dat_ia_openv() return
DAT_SUCCESS for all four entries.

        I expect the first two entries fail if my code link with dat2, where am I wrong ?
If I don't know my code is compiled/linked with dat or dat2, how do I know at
at runtime which version of uDAPL I am running ?


Here is the code:

#include <stdio.h>
#include <stdlib.h>
#include <dat2/udat.h>

int
main()

{
        int                     i;
        DAT_RETURN              err;
        DAT_COUNT               nif;
        DAT_PROVIDER_INFO       *list[10];
        DAT_PROVIDER_INFO       interface[10];
        DAT_EVD_HANDLE          async_evd_handle;
        DAT_IA_HANDLE           ia_handle;
        const char              *major;
        const char              *minor;

        nif = 10;
        for (i = 0; i < nif; i++) {
                list[i] = &(interface[i]);
        }
        err = dat_registry_list_providers(nif, &nif, list);
        if (err != DAT_SUCCESS) {
                fprintf(stderr, "dat_registry_list_providers() failed\n");
                return (-1);
        }

        if (nif < 1) {
                fprintf(stderr, "no interface found\n");
                return (-1);
        }

        for (i=0; i < nif; i++) {
                fprintf(stderr, "version: %d.%d\n",
                        interface[i].dapl_version_major,
                        interface[i].dapl_version_minor);

                async_evd_handle = DAT_HANDLE_NULL;
                err = dat_ia_openv(interface[i].ia_name,
                        8, &async_evd_handle, &ia_handle,
                        interface[i].dapl_version_major,
                        interface[i].dapl_version_minor,
                        interface[i].is_thread_safe);
                if (err != DAT_SUCCESS) {
                        fprintf(stderr, "%s fails\n", interface[i].ia_name);
                        dat_strerror(err, &major, &minor);
                        fprintf(stderr, "dat_ia_openv() failed: %s.%s\n",
                                        major, minor);
                } else {
                        fprintf(stderr, "%s succeeds\n", interface[i].ia_name);
                }
        }

        fprintf(stderr, "OK\n");
}


> -----Original Message-----
> From: Arlin Davis [mailto:ardavis at ichips.intel.com]
> Sent: Thursday, February 07, 2008 3:33 PM
> To: Tang, Changqing
> Cc: OpenFabrics General
> Subject: Re: [ofa-general] uDAPL libdat2.so version # problem
> for today's OFED code
>
> Tang, Changqing wrote:
> > HI,
> >         I downloaded today's tarball and installed. But
> both libdat.so
> > and libdat2.so report version 1.2
> >
>
> This is not the DAT version, it is the provider configured in
> your /etc/dat.conf. The OFED configuration supplies OFA
> providers for both
> 1.2 and 2.0 versions. Your application picks accordingly.
>
> For example, if you change your code to list more then one
> and include the name you will see the list:
>
>         for (i=0;i<10;i++) {
>                  fprintf(stderr, "version: %s %d.%d\n",
>                  interface[i].ia_name,
>                  interface[i].dapl_version_major,
>                  interface[i].dapl_version_minor);
>          }
>
> ./test
> version: OpenIB-cma 1.2
> version: OpenIB-cma-1 1.2
> version: OpenIB-cma-2 1.2
> version: OpenIB-cma-3 1.2
> version: OpenIB-bond 1.2
> version: ofa-v2-ib0 2.0
> version: ofa-v2-ib1 2.0
> version: ofa-v2-ib2 2.0
> version: ofa-v2-ib3 2.0
> version: ofa-v2-bond 2.0
>
> The dat_ia_open will validate the build version against the
> provider version.
>
> -arlin
>



More information about the general mailing list