<commit_before>/**
 * @file MPIComm.h
 *
 *  created on: 2014-5-12
 *      Author: salmon
 */

#ifndef MPI_COMM_H_
#define MPI_COMM_H_

#include <simpla/SIMPLA_config.h>

#include <stddef.h>
#include <algorithm>
#include <cstdbool>
#include <memory>

#include "simpla/utilities/SingletonHolder.h"
#include "simpla/utilities/nTuple.h"
//#include <mpi.h>

namespace simpla {
namespace parallel {

class MPIComm {
   public:
    MPIComm();
    MPIComm(int argc, char **argv);
    ~MPIComm();
    void init(int argc = 0, char **argv = nullptr);
    void close();
    void const *comm() const;
    //    MPI_Info info();
    void barrier();
    bool is_valid() const;
    int process_num() const;
    int num_of_process() const;
    size_type generate_object_id();
    int topology(int *mpi_topo_ndims, int *mpi_topo_dims, int *periods, int *mpi_topo_coord) const;
    int rank() const;
    int size() const;
    int get_rank(int const *d) const;

    //    std::tuple<int, int, int> make_send_recv_tag(size_t prefix, const nTuple<int, 3> &m_global_start_);

    struct pimpl_s;
    std::unique_ptr<pimpl_s> m_pimpl_;
};

void bcast_string(std::string *filename_);
<commit_msg>snapshot<commit_after>/**
 * @file MPIComm.h
 *
 *  created on: 2014-5-12
 *      Author: salmon
 */

#ifndef MPI_COMM_H_
#define MPI_COMM_H_

#include <simpla/SIMPLA_config.h>

#include <stddef.h>
#include <algorithm>
#include <cstdbool>
#include <memory>

#include "simpla/utilities/SingletonHolder.h"
#include "simpla/utilities/nTuple.h"

namespace simpla {
namespace parallel {

class MPIComm {
   public:
    MPIComm();
    MPIComm(int argc, char **argv);
    ~MPIComm();
    void init(int argc = 0, char **argv = nullptr);
    void close();
    void const *comm() const;
    //    MPI_Info info();
    void barrier();
    bool is_valid() const;
    int process_num() const;
    int num_of_process() const;
    size_type generate_object_id();
    int topology(int *mpi_topo_ndims, int *mpi_topo_dims, int *periods, int *mpi_topo_coord) const;
    int rank() const;
    int size() const;
    int get_rank(int const *d) const;

    //    std::tuple<int, int, int> make_send_recv_tag(size_t prefix, const nTuple<int, 3> &m_global_start_);

    struct pimpl_s;
    std::unique_ptr<pimpl_s> m_pimpl_;
};

void bcast_string(std::string *filename_);

{'fraction_non_alphanumeric': 0.1336206896551724, 'fraction_numerical': 0.007758620689655172, 'mean_word_length': 3.7757201646090537, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4797769', 'n_tokens_mistral': 893, 'n_tokens_neox': 864, 'n_words': 210}