# mpicxx must be on your path; on Szilard, this means that
-# /usr/local/mpich2-1.0.1/bin must be on your path.
+# /usr/local/mpich2-1.0.2/bin must be on your path.
# For now, use g++ most of the time.
# When compiling MPI stuff, specify myfile.cc instead of myfile.o so that ${MPICC} is
fakefuse: fakefuse.cc mds/allmds.o client/Client.o osd/OSD.o client/fuse.o msg/FakeMessenger.cc msg/CheesySerializer.o ${COMMON_OBJS}
${CC} -pg ${CFLAGS} ${LIBS} -lfuse $^ -o $@
-testmpi: test/testmpi.cc msg/MPIMessenger.cc ${COMMON_OBJS}
+testmpi: test/testmpi.cc msg/MPIMessenger.cc config.o common/Timer.o common/clock.o msg/Messenger.o msg/Dispatcher.o msg/error.o
${MPICC} ${CFLAGS} ${LIBS} $^ -o $@
#include "include/config.h"
#include "messages/MPing.h"
+#include "common/Mutex.h"
#include "msg/MPIMessenger.h"
m->set_dispatcher(this);
}
void dispatch(Message *m) {
- cout << "got incoming " << m << endl;
+ //dout(1) << "got incoming " << m << endl;
delete m;
+
}
};
int main(int argc, char **argv) {
-
+ int num = 1000;
int myrank = mpimessenger_init(argc, argv);
int world = mpimessenger_world();
mpimessenger_start();
- while (1) {
+ while(1) {
// ping random nodes
int d = rand() % world;
- p->messenger->send_message(new MPing(), d);
-
+ if (d != myrank) {
+ //cout << "sending " << i << " to " << d << endl;
+ p->messenger->send_message(new MPing(), d);
+ }
+
}
+ cout << "shutting down" << endl;
+ p->messenger->shutdown();
mpimessenger_wait();
mpimessenger_shutdown(); // shutdown MPI