Commit 18c16b4b authored by Podhorszki Norbert's avatar Podhorszki Norbert
Browse files

Print lammps style error and abort when adios2_config.xml is not found. Avoid...

Print lammps style error and abort when adios2_config.xml is not found. Avoid ugly C++ exception stack.
parent a1864f8b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -58,8 +58,15 @@ DumpAtomADIOS::DumpAtomADIOS(LAMMPS *lmp, int narg, char **arg)
: DumpAtom(lmp, narg, arg)
{
    internal = new DumpAtomADIOSInternal();
    try {
        internal->ad =
            new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON);
    } catch (std::ios_base::failure &e) {
        char str[256];
        snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s",
                 e.what());
        error->one(FLERR, str);
    }
}

/* ---------------------------------------------------------------------- */
+9 −2
Original line number Diff line number Diff line
@@ -132,8 +132,15 @@ DumpCustomADIOS::DumpCustomADIOS(LAMMPS *lmp, int narg, char **arg)
: DumpCustom(lmp, narg, arg)
{
    internal = new DumpCustomADIOSInternal();
    try {
        internal->ad =
            new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON);
    } catch (std::ios_base::failure &e) {
        char str[256];
        snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s",
                 e.what());
        error->one(FLERR, str);
    }

    // if (screen) fprintf(screen, "DumpCustomADIOS constructor: nvariable=%d
    // id_variable=%p, variables=%p, nfield=%d, earg=%p\n", nvariable,
+9 −2
Original line number Diff line number Diff line
@@ -81,8 +81,15 @@ ReaderADIOS::ReaderADIOS(LAMMPS *lmp) : Reader(lmp)
    me = comm->me;

    internal = new ReadADIOSInternal();
    try {
        internal->ad =
            new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON);
    } catch (std::ios_base::failure &e) {
        char str[256];
        snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s",
                 e.what());
        error->one(FLERR, str);
    }

    /* Define the group holding all variables and attributes  */
    internal->io = internal->ad->DeclareIO(internal->ioName);