Commit 1a544397 authored by Shen Yu's avatar Shen Yu
Browse files

fix the bug when log subroutine call mpi functions

parent ff24a13d
......@@ -54,7 +54,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err;
......@@ -136,14 +136,19 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
comm->c_coll->coll_allgather_module);
// for log messages
const int FUNC_ID=1;
int sendelemsize, recvelemsize;
int LOGMSG_SENDSIZE=LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE=LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC=4;
int LOG_ARGV[4]={sendcount, sendelemsize, recvcount, recvelemsize};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 1;
int sendelemsize, recvelemsize;
int LOGMSG_SENDSIZE = LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE = LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC = 4;
int LOG_ARGV[4] = {sendcount, sendelemsize, recvcount, recvelemsize};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -54,7 +54,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int i, size, err;
......@@ -158,16 +158,21 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
comm->c_coll->coll_allgatherv_module);
// for log messages
const int FUNC_ID=2;
int sendelemsize;
resize_INT_POOL(size, &SIZE_LIST);
int* recvsizelist=SIZE_LIST.pool;
int LOGMSG_SENDSIZE=LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE=LOGMSG_SIZE_V(size, recvtype, recvcounts, recvsizelist);
const int LOG_ARGC=2;
int LOG_ARGV[2]={sendcount, sendelemsize};
LOGMSG2(FUNC_ID, call_time, comm, LOG_ARGC, size, LOG_ARGV, recvsizelist);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 2;
int sendelemsize;
resize_INT_POOL(size, &SIZE_LIST);
int* recvsizelist = SIZE_LIST.pool;
int LOGMSG_SENDSIZE = LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE = LOGMSG_SIZE_V(size, recvtype, recvcounts, recvsizelist);
const int LOG_ARGC = 2;
int LOG_ARGV[2] = {sendcount, sendelemsize};
LOGMSG2(FUNC_ID, call_time, comm, LOG_ARGC, size, LOG_ARGV, recvsizelist);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -52,7 +52,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err;
......@@ -125,11 +125,16 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
OBJ_RELEASE(op);
// for log messages
const int FUNC_ID=3;
const int LOG_ARGC=3;
int LOG_ARGV[3]={count, MPI_Type_c2f(datatype), MPI_Op_c2f(op)};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 3;
const int LOG_ARGC = 3;
int LOG_ARGV[3] = {count, MPI_Type_c2f(datatype), MPI_Op_c2f(op)};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -55,7 +55,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err;
......@@ -121,14 +121,19 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
comm, comm->c_coll->coll_alltoall_module);
// for log messages
const int FUNC_ID=4;
int sendelemsize, recvelemsize;
int LOGMSG_SENDSIZE=LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE=LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC=4;
int LOG_ARGV[4]={sendcount, sendelemsize, recvcount, recvelemsize};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 4;
int sendelemsize, recvelemsize;
int LOGMSG_SENDSIZE = LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE = LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC = 4;
int LOG_ARGV[4] = {sendcount, sendelemsize, recvcount, recvelemsize};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -54,7 +54,7 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[],
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int i, size, err;
......@@ -140,14 +140,19 @@ int MPI_Alltoallv(const void *sendbuf, const int sendcounts[],
comm, comm->c_coll->coll_alltoallv_module);
// for log messages
const int FUNC_ID=5;
resize_INT_POOL(size*2, &SIZE_LIST);
int* sendsizelist=&(SIZE_LIST.pool[0]);
int* recvsizelist=&(SIZE_LIST.pool[size]);
int LOGMSG_SENDSIZE=LOGMSG_SIZE_V(size, sendtype, sendcounts, sendsizelist);
int LOGMSG_RECVSIZE=LOGMSG_SIZE_V(size, recvtype, recvcounts, recvsizelist);
LOGMSG2(FUNC_ID, call_time, comm, size, size, sendsizelist, recvsizelist);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 5;
resize_INT_POOL(size*2, &SIZE_LIST);
int* sendsizelist = &(SIZE_LIST.pool[0]);
int* recvsizelist = &(SIZE_LIST.pool[size]);
int LOGMSG_SENDSIZE = LOGMSG_SIZE_V(size, sendtype, sendcounts, sendsizelist);
int LOGMSG_RECVSIZE = LOGMSG_SIZE_V(size, recvtype, recvcounts, recvsizelist);
LOGMSG2(FUNC_ID, call_time, comm, size, size, sendsizelist, recvsizelist);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -54,7 +54,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int i, size, err;
......@@ -135,14 +135,19 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
comm, comm->c_coll->coll_alltoallw_module);
// for log messages
const int FUNC_ID=6;
resize_INT_POOL(size*2, &SIZE_LIST);
int* sendsizelist=&(SIZE_LIST.pool[0]);
int* recvsizelist=&(SIZE_LIST.pool[size]);
int LOGMSG_SENDSIZE=LOGMSG_SIZE_W(size, sendtypes, sendcounts, sendsizelist);
int LOGMSG_RECVSIZE=LOGMSG_SIZE_W(size, recvtypes, recvcounts, recvsizelist);
LOGMSG2(FUNC_ID, call_time, comm, size, size, sendsizelist, recvsizelist);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 6;
resize_INT_POOL(size*2, &SIZE_LIST);
int* sendsizelist = &(SIZE_LIST.pool[0]);
int* recvsizelist = &(SIZE_LIST.pool[size]);
int LOGMSG_SENDSIZE = LOGMSG_SIZE_W(size, sendtypes, sendcounts, sendsizelist);
int LOGMSG_RECVSIZE = LOGMSG_SIZE_W(size, recvtypes, recvcounts, recvsizelist);
LOGMSG2(FUNC_ID, call_time, comm, size, size, sendsizelist, recvsizelist);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -44,8 +44,8 @@ static const char FUNC_NAME[] = "MPI_Barrier";
int MPI_Barrier(MPI_Comm comm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
struct timeval call_time;
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err = MPI_SUCCESS;
......@@ -88,10 +88,12 @@ int MPI_Barrier(MPI_Comm comm)
// for log messages
if(LOGTHIS == 1)
{
const int FUNC_ID=26;
LOGMSG0(FUNC_ID, call_time, comm);
addCOMM(comm, &localComm);
}
LOGTHIS = 0;
const int FUNC_ID = 26;
LOGMSG0(FUNC_ID, call_time, comm);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
......
......@@ -46,11 +46,8 @@ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
int root, MPI_Comm comm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
#ifdef _DEBUG
printf("MYID %d: Get start_time\n", LOGMSGMYID);
#endif
struct timeval call_time;
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err;
......@@ -130,20 +127,16 @@ int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
// LOGTHIS is used to avoid logging the communication caused by the log itself
if(LOGTHIS == 1)
{
const int FUNC_ID=7;
LOGTHIS = 0;
const int FUNC_ID = 7;
int elemsize;
int datasize=LOGMSG_SIZE(datatype, count, &elemsize);
const int LOG_ARGC=3;
int LOG_ARGV[3]={root, count, elemsize};
int datasize = LOGMSG_SIZE(datatype, count, &elemsize);
const int LOG_ARGC = 3;
int LOG_ARGV[3] = {root, count, elemsize};
// in init.c
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
#ifdef _DEBUG
printf("MYID %d: LOGMSG1 done\n", LOGMSGMYID);
#endif
addCOMM(comm, &localComm);
#ifdef _DEBUG
printf("MYID %d: addCOMM done\n", LOGMSGMYID);
#endif
LOGTHIS = 1;
}
// end
......
......@@ -45,7 +45,7 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) {
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -76,14 +76,19 @@ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) {
(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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
......
......@@ -48,7 +48,7 @@ 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);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -87,14 +87,19 @@ 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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN (rc, comm, rc, FUNC_NAME);
......
......@@ -46,7 +46,7 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc=MPI_SUCCESS;
......@@ -73,13 +73,18 @@ int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
......
......@@ -44,7 +44,7 @@ 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);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -71,12 +71,17 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) {
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);
addCOMM(comm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 31;
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);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
......
......@@ -66,7 +66,7 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -164,12 +164,17 @@ int MPI_Comm_join(int fd, MPI_Comm *intercomm)
// 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);
addCOMM(*intercomm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID = 32;
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);
addCOMM(*intercomm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN (rc, MPI_COMM_SELF, rc, FUNC_NAME);
......
......@@ -45,7 +45,7 @@ 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);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int rc;
......@@ -79,13 +79,18 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm) {
(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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
if(LOGTHIS == 1)
{
LOGTHIS = 0;
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);
addCOMM(comm, &localComm);
addCOMM(*newcomm, &localComm);
LOGTHIS = 1;
}
// end
OMPI_ERRHANDLER_RETURN ( rc, comm, rc, FUNC_NAME);
......
......@@ -63,10 +63,10 @@ int MPI_Finalize(void)
/* Pretty simple */
// for log messages
const int FUNC_ID=255;
LOGTHIS = 0;
const int FUNC_ID = 255;
LOGMSG0(FUNC_ID, call_time, MPI_COMM_WORLD);
fclose(MSGLOGFILE);
LOGTHIS = 0;
extern char COMMFILE[]; // COMMFILE is initialized in init.c
saveCommMap(&localComm, COMMFILE);
freeCOMMSET(&localComm);
......
......@@ -54,7 +54,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int err;
......@@ -196,14 +196,16 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
// for log messages
if(LOGTHIS == 1)
{
const int FUNC_ID=1;
LOGTHIS = 0;
const int FUNC_ID = 1;
int sendelemsize, recvelemsize;
int LOGMSG_SENDSIZE=LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE=LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC=5;
int LOG_ARGV[5]={root, sendcount, recvcount, sendelemsize, recvelemsize};
int LOGMSG_SENDSIZE = LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE = LOGMSG_SIZE(recvtype, recvcount, &recvelemsize);
const int LOG_ARGC = 5;
int LOG_ARGV[5] = {root, sendcount, recvcount, sendelemsize, recvelemsize};
LOGMSG1(FUNC_ID, call_time, comm, LOG_ARGC, LOG_ARGV);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
......
......@@ -52,7 +52,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
// for log messages
struct timeval call_time;
gettimeofday(&call_time, NULL);
if(LOGTHIS == 1) gettimeofday(&call_time, NULL);
// end
int i, size, err;
......@@ -210,16 +210,18 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
// for log messages
if(LOGTHIS == 1)
{
LOGTHIS = 0;
const int FUNC_ID=9;
int sendelemsize;
resize_INT_POOL(size, &SIZE_LIST);
int* recvelemsizelist=SIZE_LIST.pool;
int LOGMSG_SENDSIZE=LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE=LOGMSG_SIZE_V(size, recvtype, recvcounts, recvelemsizelist);
const int LOG_ARGC=3;
int LOG_ARGV[3]={root, sendcount, sendelemsize};
int LOGMSG_SENDSIZE = LOGMSG_SIZE(sendtype, sendcount, &sendelemsize);
int LOGMSG_RECVSIZE = LOGMSG_SIZE_V(size, recvtype, recvcounts, recvelemsizelist);
const int LOG_ARGC = 3;
int LOG_ARGV[3] = {root, sendcount, sendelemsize};
LOGMSG2(FUNC_ID, call_time, comm, LOG_ARGC, size, LOG_ARGV, recvelemsizelist);
addCOMM(comm, &localComm);
LOGTHIS = 1;
}
// end
......
......@@ -102,43 +102,33 @@ int MPI_Init(int *argc, char ***argv)
// for log messages
// initialize
// set log position
LOGTHIS = 0;
char logfilepath[4000];
// process 0 set directory and bcast to others
MPI_Comm_rank(MPI_COMM_WORLD, &LOGMSGMYID);
if(LOGMSGMYID == 0)
{
char *inputlogpath;
inputlogpath=getenv("MSGLOGPATH");
inputlogpath = getenv("MSGLOGPATH");
if(inputlogpath == NULL)
inputlogpath="/tmp";
inputlogpath = "/tmp";
if(strlen(inputlogpath) > 3900)