<commit_before>/*=========================================================================

 Program:   ORFEO Toolbox
 Language:  C++
 Date:      $Date$
 Version:   $Revision$


 Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
 See OTBCopyright.txt for details.


 This software is distributed WITHOUT ANY WARRANTY; without even
 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.  See the above copyright notices for more information.

 =========================================================================*/
#ifndef __MPIConfig_h
#define __MPIConfig_h

#include <mpi.h>

namespace otb 
{ 
namespace mpi 
{

/** \class MPIConfig
 *
 * Manage MPI ressources
 *
 */
class MPIConfig
{
public:
  /** 
   * Initialize the MPI environment.
   *
   *  If the MPI environment has not already been initialized,
   *  initializes MPI with a call to MPI_Init.
   *
   *  @param argc Number of arguments 
   *
   *  @param argv Array of arguments
   *
   *  @param abort_on_exception When true, this object will abort the
   *  program if it is destructed due to an uncaught exception.
   */
  MPIConfig(int& argc, char** &argv, bool abortOnException = true);

  /** 
   * Shuts down the MPI environment.
   */
  ~MPIConfig();

  /** 
   * Abort all MPI processes.
   *
   *  @param errcode <commit_msg>Fix Ctest MPIModuleInDoxygenGroup<commit_after>/*=========================================================================

 Program:   ORFEO Toolbox
 Language:  C++
 Date:      $Date$
 Version:   $Revision$


 Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
 See OTBCopyright.txt for details.


 This software is distributed WITHOUT ANY WARRANTY; without even
 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.  See the above copyright notices for more information.

 =========================================================================*/
#ifndef __MPIConfig_h
#define __MPIConfig_h

#include <mpi.h>

namespace otb 
{ 
namespace mpi 
{

/** \class MPIConfig
 *
 * Manage MPI ressources
 * \ingroup MPIModule
 *
 */
class MPIConfig
{
public:
  /** 
   * Initialize the MPI environment.
   *
   *  If the MPI environment has not already been initialized,
   *  initializes MPI with a call to MPI_Init.
   *
   *  @param argc Number of arguments 
   *
   *  @param argv Array of arguments
   *
   *  @param abort_on_exception When true, this object will abort the
   *  program if it is destructed due to an uncaught exception.
   */
  MPIConfig(int& argc, char** &argv, bool abortOnException = true);

  /** 
   * Shuts down the MPI environment.
   */
  ~MPIConfig();

  /** 
   * Abort all MPI processes.
   *
   *  @param errcode 
{'fraction_non_alphanumeric': 0.1799561082662765, 'fraction_numerical': 0.0, 'mean_word_length': 3.4983552631578947, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5287514', 'n_tokens_mistral': 808, 'n_tokens_neox': 738, 'n_words': 278}