#include "base/parallel.h"

#ifndef TBPLAS_PYTHON_INTERFACE_MPI_H
#define TBPLAS_PYTHON_INTERFACE_MPI_H

namespace tbplas::python {
using tbplas::base::BaseMPIEnv;
using tbplas::base::MPIENV_INIT;
using tbplas::base::MPIENV_FINALIZE;

inline void mpienv_init_cxx()
{
    // Reference:
    // https://en.cppreference.com/w/c/language/main_function
    std::string name = "interface";
    int argc = 1;
    char* argv[2] = { const_cast<char*>(name.c_str()), nullptr };
    MPIENV_INIT(argc, argv);
}

inline void mpienv_finalize_cxx()
{
   MPIENV_FINALIZE();
}

}  // namespace tbplas::python
#endif