/*
 * SPDX-FileCopyrightText: 2026 Oak Ridge National Laboratory and Contributors
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include "nbIO.h"

#include "adios2/helper/adiosCommMPI.h"
#include <mpi4py/mpi4py.h>

#include "nbTypes.h"

namespace adios2
{
namespace py11
{

Engine IO::Open(const std::string &name, const adios2::Mode mode, MPI4PY_Comm comm)
{
    helper::CheckForNullptr(m_IO, "for engine " + name + ", in call to IO::Open");

    return Engine(&m_IO->Open(name, mode, helper::CommDupMPI(comm)));
}

} // end namespace py11
} // end namespace adios2
