ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

No obvious way for a program to check available transform methods #98

Closed olesenm closed 7 years ago

olesenm commented 7 years ago

Similar to what is possible with adios_list_methods I would like to check which transform methods are available to provide my own user feedback (or abort) as needed.

As pseudo-code

const List<adiosTransform>& available = adios_implemented_transforms(); 
for (adiosTransform::const_iterator iter = available.cbegin(); iter != available.cend();++iter)
{
    hashset.add(iter.xmlName());
}

if (!hashset.exists("someTransform"))  ...

But most of the headers are tagged as internal, so it's not easily possible to write this myself, unless I also copy across the internal headers into my include directory etc, but this isn't the nicest way of doing things.

pnorbert commented 7 years ago

commit 729956d0

include "adios_transform_methods.h"

ADIOS_IMPLEMENTED_TRANSFORMS * t = adios_implemented_transforms(); if (t) { for (i=0; intransforms; i++) { printf(" \"%s\"\t: %s\n", t->name[i], t->description[i]); } adios_implemented_transforms_free(t); }

On Tue, Nov 15, 2016 at 5:57 AM, Mark Olesen notifications@github.com wrote:

Similar to what is possible with adios_list_methods I would like to check which transform methods are available to provide my own user feedback (or abort) as needed.

As pseudo-code

const List& available = adios_implemented_transforms(); for (adiosTransform::const_iterator iter = available.cbegin(); iter != available.cend();++iter) { hashset.add(iter.xmlName()); }

if (!hashset.exists("someTransform")) ...

But most of the headers are tagged as internal, so it's not easily possible to write this myself, unless I also copy across the internal headers into my include directory etc, but this isn't the nicest way of doing things.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/98, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLdf0JMtOrfABGxW6vHSp3iA374ilks5q-ZAjgaJpZM4KyY_z .

olesenm commented 7 years ago

Thanks - that was really fast! I'm travelling and can't check it immediately, but code looks like what I need.

pnorbert commented 7 years ago

Changed API to adios_available_transforms(), and added similar functions: adios.h: adios_available_write_methods() adios_read.h: adios_available_read_methods() adios_query.h: adios_available_query_methods()

    printf ("Available data transformation methods (in XML transform tags in <var> elements):\n");
    ADIOS_AVAILABLE_TRANSFORMS * t = adios_available_transforms();
    if (t) {
        for (i=0; i<t->ntransforms; i++)
        {
            printf("    \"%s\"\t: %s\n",  t->name[i], t->description[i]);
        }
        adios_available_transforms_free(t);
    }
pnorbert commented 7 years ago

Okay, one more try, let's make them even more consistent:

ADIOS_AVAILABLE_TRANSFORM_METHODS * t = adios_available_transform_methods(); if (t) { for (i=0; intransforms; i++) { printf(" \"%s\"\t: %s\n", t->name[i], t->description[i]); } adios_available_transform_methods_free(t); }

olesenm commented 7 years ago

@pnorbert Minor bug due to initialization

0001-BUG-segfault-when-querying-list-of-available-transfo.patch.txt