From 11e5ee04cdc042d2fd6ce1e42ba680a540603fcb Mon Sep 17 00:00:00 2001 From: sage Date: Fri, 30 Jul 2004 18:43:48 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@57 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/Makefile | 9 +++--- ceph/config.h | 8 ++--- ceph/msg/MPIMessenger.cc | 69 +++++++++++++++++++++++----------------- ceph/msg/MPIMessenger.h | 2 +- 4 files changed, 49 insertions(+), 39 deletions(-) diff --git a/ceph/Makefile b/ceph/Makefile index 66fa88bed2a4c..89dc16b7f3070 100644 --- a/ceph/Makefile +++ b/ceph/Makefile @@ -1,12 +1,11 @@ CC=g++ #CC=mpiCC -CFLAGS=-D __gnu_cxx=std -g -I. +CFLAGS=-D __gnu_cxx=std -g -I. -I/usr/lib/mpi/include -L/usr/lib/mpi/lib LIBS= -MPICC=mpiCC -MPILIBS=-lmpi ${LIBS} -MPICFLAGS=-L/usr/lib/mpi/mpi_gnu/lib ${CFLAGS} +MPICC=g++ +MPILIBS=-lelan -lmpi ${LIBS} LEAKTRACER= LEAKTRACER=$(HOME)/lib/LeakTracer.o @@ -26,7 +25,7 @@ import: pmds.o FakeMessenger.o import.cc ${CC} ${CFLAGS} ${LIBS} pmds.o FakeMessenger.o import.cc -o import mpitest: mpitest.cc MPIMessenger.o pmds.o - ${MPICC} ${CFLAGS} ${LIBS} mpitest.cc MPIMessenger.o pmds.o -o mpitest + ${MPICC} ${CFLAGS} ${MPILIBS} mpitest.cc MPIMessenger.o pmds.o -o mpitest clean: diff --git a/ceph/config.h b/ceph/config.h index 9d133af9b7fc4..46b586d4214d2 100644 --- a/ceph/config.h +++ b/ceph/config.h @@ -1,6 +1,6 @@ // random crap -#define NUMMDS 30 +#define NUMMDS 10 #define NUMOSD 10 #define CLIENT_CACHE 100 @@ -15,12 +15,12 @@ #define FAKE_CLOCK -#define NUMCLIENT 1000 -#define CLIENT_REQUESTS 100 +#define NUMCLIENT 800 +#define CLIENT_REQUESTS 250 #define DEBUG_LEVEL 10 -#define MDS_CACHE_SIZE 2500 +#define MDS_CACHE_SIZE 25000 #define MDS_CACHE_MIDPOINT .8 diff --git a/ceph/msg/MPIMessenger.cc b/ceph/msg/MPIMessenger.cc index 2cdb06457879e..8959e1b625acf 100644 --- a/ceph/msg/MPIMessenger.cc +++ b/ceph/msg/MPIMessenger.cc @@ -9,7 +9,7 @@ #include using namespace std; -#include "mpi++.h" +#include "mpi.h" #include "include/LogType.h" #include "include/Logger.h" @@ -30,9 +30,11 @@ int mpi_rank; int mpimessenger_init(int& argc, char**& argv) { dout(1) << "MPI_Init" << endl; - MPI::Init(argc, argv); - mpi_world_size = MPI::COMM_WORLD.Get_size(); - mpi_rank = MPI::COMM_WORLD.Get_rank(); + //MPI::Init(argc, argv); + MPI_Init(&argc, &argv); + + MPI_Comm_size(MPI_COMM_WORLD, &mpi_world_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); dout(1) << "i am " << mpi_rank << " of " << mpi_world_size << endl; @@ -54,27 +56,32 @@ int mpimessenger_loop() dout(1) << "waiting for message" << endl; // get size - MPI::Status status; + //MPI::Status status; + MPI_Status status; int msize; - MPI::COMM_WORLD.Recv(&msize, - 1, - MPI_INT, - MPI_ANY_SOURCE, - MPI_ANY_TAG, - status); // receives greeting from each process - - int tag = status.Get_tag(); - int source = status.Get_source(); + //MPI::COMM_WORLD.Recv(&msize, + MPI_Recv(&msize, + 1, + MPI_INT, + MPI_ANY_SOURCE, + MPI_ANY_TAG, + MPI_COMM_WORLD, + &status); // receives greeting from each process + + int tag = status.MPI_TAG; + int source = status.MPI_SOURCE; dout(1) << "incoming size " << msize << " tag " << tag << " from rank " << source << endl; // get message char *buf = new char[msize]; - MPI::COMM_WORLD.Recv(buf, - msize, - MPI_CHAR, - status.Get_source(), - tag, - status); // receives greeting from each process + //MPI::COMM_WORLD.Recv(buf, + MPI_Recv(buf, + msize, + MPI_CHAR, + status.MPI_SOURCE, + tag, + MPI_COMM_WORLD, + &status); // receives greeting from each process crope r(buf, msize); delete[] buf; @@ -101,7 +108,7 @@ int mpimessenger_loop() int mpimessenger_shutdown() { dout(1) << "MPI_Finalize" << endl; - MPI::Finalize(); + MPI_Finalize(); } @@ -152,18 +159,22 @@ int MPIMessenger::send_message(Message *m, long dest, int port, int fromport) } else { dout(3) << "sending message via MPI for (tag) " << dest << " to rank " << trank << " size " << size << endl; - MPI::COMM_WORLD.Send(&r, + //MPI::COMM_WORLD.Send(&r, + MPI_Send(&r, 1, MPI_INT, trank, - dest); + dest, + MPI_COMM_WORLD); - const char *buf = r.c_str(); - MPI::COMM_WORLD.Send(buf, - size, - MPI_CHAR, - trank, - dest); + char *buf = (char*)r.c_str(); + //MPI::COMM_WORLD.Send(buf, + MPI_Send(buf, + size, + MPI_CHAR, + trank, + dest, + MPI_COMM_WORLD); } } int MPIMessenger::wait_message(time_t seconds) diff --git a/ceph/msg/MPIMessenger.h b/ceph/msg/MPIMessenger.h index 072e2532b49f1..439ca82553f06 100644 --- a/ceph/msg/MPIMessenger.h +++ b/ceph/msg/MPIMessenger.h @@ -12,7 +12,7 @@ class MPIMessenger : public Messenger { public: MPIMessenger(long me); - ~MPIMessenger(); + //~MPIMessenger(); virtual int init(Dispatcher *dis); virtual int shutdown(); -- 2.39.5