Commit f14f3757 authored by Shen Yu's avatar Shen Yu
Browse files

Add more log functions

	modified:   openmpi-4.1.1/ompi/mpi/c/barrier.c
	modified:   openmpi-4.1.1/ompi/mpi/c/bcast.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_create.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_create_group.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_dup.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_group.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_join.c
	modified:   openmpi-4.1.1/ompi/mpi/c/comm_split.c
parent 2417f106
......@@ -27,6 +27,10 @@
#include "ompi/memchecker.h"
#include "ompi/runtime/ompi_spc.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Barrier = PMPI_Barrier
......@@ -39,6 +43,11 @@ static const char FUNC_NAME[] = "MPI_Barrier";
int MPI_Barrier(MPI_Comm comm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int err = MPI_SUCCESS;
SPC_RECORD(OMPI_SPC_BARRIER, 1);
......@@ -76,5 +85,10 @@ int MPI_Barrier(MPI_Comm comm)
/* All done */
// for log messages
const int FUNC_ID=26;
LOGMSG0(FUNC_ID, call_time, MPI_COMM_WORLD);
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
}
......@@ -129,6 +129,8 @@ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
int datasize=LOGMSG_SIZE(datatype, count, &elemsize);
const int LOG_ARGC=3;
int LOG_ARGV[3]={root, count, elemsize};
// LOGTHIS is used to avoid logging the communication caused by the log itself
// in init.c
if(LOGTHIS) LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
......
......@@ -27,6 +27,10 @@
#include "ompi/errhandler/errhandler.h"
#include "ompi/memchecker.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Comm_create = PMPI_Comm_create
......@@ -39,6 +43,11 @@ static const char FUNC_NAME[] = "MPI_Comm_create";
int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) {
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc;
MEMCHECKER(
......@@ -65,5 +74,15 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) {
rc = ompi_comm_create ( (ompi_communicator_t*)comm, (ompi_group_t*)group,
(ompi_communicator_t**)newcomm );
// for log messages
const int FUNC_ID=29;
const int LOG_ARGC=2;
const int groupidx=MPI_Group_c2f(group);
const int newcommidx=MPI_Comm_c2f(*newcomm);
int LOG_ARGV[2]={groupidx, newcommidx};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
}
......@@ -31,6 +31,10 @@
#include "ompi/mca/pml/pml.h"
#include "ompi/memchecker.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Comm_create_group = PMPI_Comm_create_group
......@@ -42,6 +46,11 @@ static const char FUNC_NAME[] = "MPI_Comm_create_group";
int MPI_Comm_create_group (MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm) {
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc;
MEMCHECKER(
......@@ -77,5 +86,14 @@ int MPI_Comm_create_group (MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *ne
rc = ompi_comm_create_group ((ompi_communicator_t *) comm, (ompi_group_t *) group,
tag, (ompi_communicator_t **) newcomm);
// for log messages
const int FUNC_ID=30;
const int LOG_ARGC=3;
const int groupidx=MPI_Group_c2f(group);
const int newcommidx=MPI_Comm_c2f(*newcomm);
int LOG_ARGV[3]={groupidx, tag, newcommidx};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN (rc, comm, rc, FUNC_NAME);
}
......@@ -28,6 +28,10 @@
#include "ompi/errhandler/errhandler.h"
#include "ompi/memchecker.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Comm_dup = PMPI_Comm_dup
......@@ -39,6 +43,12 @@ static const char FUNC_NAME[] = "MPI_Comm_dup";
int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc=MPI_SUCCESS;
MEMCHECKER(
......@@ -61,6 +71,15 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
OPAL_CR_ENTER_LIBRARY();
rc = ompi_comm_dup ( comm, newcomm );
// for log messages
const int FUNC_ID=28;
const int LOG_ARGC=1;
const int newcommidx=MPI_Comm_c2f(*newcomm);
int LOG_ARGV[1]={newcommidx};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
}
......@@ -27,6 +27,10 @@
#include "ompi/errhandler/errhandler.h"
#include "ompi/memchecker.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Comm_group = PMPI_Comm_group
......@@ -38,6 +42,10 @@ static const char FUNC_NAME[] = "MPI_Comm_group";
int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) {
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -61,5 +69,14 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) {
OPAL_CR_ENTER_LIBRARY();
rc = ompi_comm_group ( (ompi_communicator_t*)comm, (ompi_group_t**)group );
// for log messages
const int FUNC_ID=30;
const int LOG_ARGC=1;
const int groupidx=MPI_Group_c2f(*group);
int LOG_ARGV[1]={groupidx};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
}
......@@ -46,6 +46,9 @@
#include "ompi/errhandler/errhandler.h"
#include "ompi/dpm/dpm.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
......@@ -61,6 +64,11 @@ static int ompi_socket_recv (int fd, char *buf, int len );
int MPI_Comm_join(int fd, MPI_Comm *intercomm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc;
uint32_t len, rlen, llen, lrlen;
int send_first=0;
......@@ -154,6 +162,15 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
"Underlying runtime environment does not support join functionality");
}
// for log messages
const int FUNC_ID=30;
const int LOG_ARGC=2;
const int intercommidx=MPI_Comm_c2f(*intercomm);
int LOG_ARGV[2]={fd, intercommidx};
LOGMSG1(FUNC_ID, call_time, MPI_COMM_SELF, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME);
}
......
......@@ -27,6 +27,10 @@
#include "ompi/errhandler/errhandler.h"
#include "ompi/memchecker.h"
// for log messages
#include "ompi/mpi/c/_MSGLOG_.h"
// end
#if OMPI_BUILD_MPI_PROFILING
#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_Comm_split = PMPI_Comm_split
......@@ -39,6 +43,11 @@ static const char FUNC_NAME[] = "MPI_Comm_split";
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) {
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
// end
int rc;
MEMCHECKER(
......@@ -68,5 +77,14 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) {
rc = ompi_comm_split ( (ompi_communicator_t*)comm, color, key,
(ompi_communicator_t**)newcomm, false);
// for log messages
const int FUNC_ID=27;
const int LOG_ARGC=3;
const int newcommidx=MPI_Comm_c2f(*newcomm);
int LOG_ARGV[3]={color, key, newcommidx};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment