<commit_before>/* This file is part of P^nMPI.
 *
 * Copyright (c)
 *  2008-2017 Lawrence Livermore National Laboratories, United States of America
 *  2011-2017 ZIH, Technische Universitaet Dresden, Federal Republic of Germany
 *  2013-2017 RWTH Aachen University, Federal Republic of Germany
 *
 *
 * P^nMPI is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation version 2.1 dated February 1999.
 *
 * P^nMPI is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with P^nMPI; if not, write to the
 *
 *   Free Software Foundation, Inc.
 *   51 Franklin St, Fifth Floor
 *   Boston, MA 02110, USA
 *
 *
 * Written by <NAME>, <EMAIL>.
 *
 * LLNL-CODE-402774
 */

#include <assert.h>

#include <mpi.h>
#include <pnmpi-config.h>
#include <pnmpimod.h>

#include <pnmpi/const.h>
#include <pnmpi/hooks.h>

#include "commsub.h"

#define PNMPI_MODULE_COMM "communication-tracker"

PNMPIMOD_Datatype_getReference_t dt_get;
PNMPIMOD_Datatype_delReference_t dt_del;
PNMPIMOD_Datatype_getSize_t dt_size;

int verbosity_level;

PNMPIMOD_Requests_RequestStorage_t req_add;
PNMPIMOD_Requests_MapRequest_t PNMPIMOD_requestmap;

static int offset, *StatusOffsetInRequest;
int *TotalStatusExtension;

#define COMM_REQ_FROM_STATUS(status) \
  REQ_FROM_STATUS(status, (*StatusOffsetInRequest))
#define COMM_INFO_FROM_STATUS(status, type) \
  INFO_FROM_STATUS(status, (*StatusOffsetInRequest), type)

#define COMM_REQ_FROM_STATUSARRAY(status, count, num)    \
  REQ_FROM_STATUSARRAY(status, (*StatusOffsetInRequest), \
                       *TotalStatusExtension, count, num)
#define COMM_INFO_FROM_STATUSARRAY(status, type, count, num) \
  INFO_FROM_STATUSARRAY(status, (*StatusOffsetInRequest),    \
                        *TotalStatusExtension, type, count, num)



/*==========================================================================*/
/* Actual Macros */
/* The following can be used as a template to generate new submodules */

#if 0

void COMM_ALL_INIT(int argc, char**argv)
{
}

void COMM_ALL_PREINIT(int argc, char**argv)
{
}

void COMM_ALL_FINALIZE()
{
}

void SEND_P2P_START(
    PNMPI_CONST
    void *buf, int count, MPI_Datatype dt, int node, int tag,
		    MPI_Comm comm, void **ptr, int type)
{
}

void SEND_P2P_ASYNC_MID1(<commit_msg>Fix deprecated MPI call in comm module<commit_after>/* This file is part of P^nMPI.
 *
 * Copyright (c)
 *  2008-2017 Lawrence Livermore National Laboratories, United States of America
 *  2011-2017 ZIH, Technische Universitaet Dresden, Federal Republic of Germany
 *  2013-2017 RWTH Aachen University, Federal Republic of Germany
 *
 *
 * P^nMPI is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation version 2.1 dated February 1999.
 *
 * P^nMPI is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with P^nMPI; if not, write to the
 *
 *   Free Software Foundation, Inc.
 *   51 Franklin St, Fifth Floor
 *   Boston, MA 02110, USA
 *
 *
 * Written by <NAME>, <EMAIL>.
 *
 * LLNL-CODE-402774
 */

#include <assert.h>

#include <mpi.h>
#include <pnmpi-config.h>
#include <pnmpimod.h>

#include <pnmpi/const.h>
#include <pnmpi/hooks.h>

#include "commsub.h"

#define PNMPI_MODULE_COMM "communication-tracker"

PNMPIMOD_Datatype_getReference_t dt_get;
PNMPIMOD_Datatype_delReference_t dt_del;
PNMPIMOD_Datatype_getSize_t dt_size;

int verbosity_level;

PNMPIMOD_Requests_RequestStorage_t req_add;
PNMPIMOD_Requests_MapRequest_t PNMPIMOD_requestmap;

static int offset, *StatusOffsetInRequest;
int *TotalStatusExtension;

#define COMM_REQ_FROM_STATUS(status) \
  REQ_FROM_STATUS(status, (*StatusOffsetInRequest))
#define COMM_INFO_FROM_STATUS(status, type) \
  INFO_FROM_STATUS(status, (*StatusOffsetInRequest), type)

#define COMM_REQ_FROM_STATUSARRAY(status, count, num)    \
  REQ_FROM_STATUSARRAY(status, (*StatusOffsetInRequest), \
                       *TotalStatusExtension, count, num)
#define COMM_INFO_FROM_STATUSARRAY(status, type, count, num) \
  INFO_FROM_STATUSARRAY(status, (*StatusOffsetInRequest),    \
                        *TotalStatusExtension, type, count, num)


/* The MPI-2 standard deprecated a number of routines because MPI-2 provides
 * better versions. The following macros will replace calls to the old functions
 * by calls to the new ones. */
#if MPI_VERSION >= 2
#define PMPI_Type_extent(sendtype, e) PMPI_Type_get_extent(sendtype, NULL, e)
#endif


/*==========================================================================*/
/* Actual Macros */
/* The following can be used as a template to generate new submodules */

#if 0

void COMM_ALL_INIT(int argc, char**argv)
{
}

void COMM_ALL_PREINIT(int argc, char**argv)
{
}

void COMM_ALL_FINALIZE()
{
}

void SEND_P2P_START(
    PNMPI_CONST
    void *buf, int count, MPI_Datatype dt, int node, int tag,
		    MPI_Comm comm, void **ptr, int type)
{
}

void SEND_P2P_ASYNC_MID1(
{'fraction_non_alphanumeric': 0.10995328781890047, 'fraction_numerical': 0.01742723679482573, 'mean_word_length': 4.533797216699801, 'pattern_counts': {'":': 0, '<': 19, '<?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': '5068511', 'n_tokens_mistral': 1887, 'n_tokens_neox': 1758, 'n_words': 558}