nick.not.used
December 22nd, 2008, 09:18 PM
Hello everybody,
I have a problem in implementing MPE with MPICH in C++, I wrote a test to learn a little bit how it works: each processor should fill the vector vec whith PID+1 in the position PID+1, where PID is the processor ID. The output is a logfile that should work with the program clog2TOslog. However when I run it prints the following error
clog2TOslog2 logTest.clog2
GUI_LIBDIR is set. GUI_LIBDIR = /usr/scratch/crosetto/mpe/lib
**** Error! State!=State
java.lang.reflect.InvocationTargetException
I compiled with
g++ ./main_test.cpp -o out -L/usr/include/mpi -lmpi -L/usr/scratch/crosetto/mpe/lib -lmpe
Anyone has some clue? Here is the source code.
Thanks in advance.
#include "/usr/include/mpi/mpi.h"
#include "/usr/scratch/crosetto/mpe/include/mpe.h"
int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
MPE_Init_log();
int rank, numtasks;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
int vec[numtasks+1];
vec[0]=0;
vec[rank+1] = rank+1;
MPE_Describe_state(1, 2, "broadcasts", "red");
MPE_Start_log();
MPE_Log_event(1, 0, "start broadcasts");
for(int j=1; j<numtasks+1 ; ++j)
MPI_Bcast( &vec[j], 1, MPI_INT, j-1, MPI_COMM_WORLD);
MPE_Log_event(1, 0, "end broadcasts");
MPE_Stop_log();
MPE_Finish_log("logTest");
MPI_Finalize();
}
I have a problem in implementing MPE with MPICH in C++, I wrote a test to learn a little bit how it works: each processor should fill the vector vec whith PID+1 in the position PID+1, where PID is the processor ID. The output is a logfile that should work with the program clog2TOslog. However when I run it prints the following error
clog2TOslog2 logTest.clog2
GUI_LIBDIR is set. GUI_LIBDIR = /usr/scratch/crosetto/mpe/lib
**** Error! State!=State
java.lang.reflect.InvocationTargetException
I compiled with
g++ ./main_test.cpp -o out -L/usr/include/mpi -lmpi -L/usr/scratch/crosetto/mpe/lib -lmpe
Anyone has some clue? Here is the source code.
Thanks in advance.
#include "/usr/include/mpi/mpi.h"
#include "/usr/scratch/crosetto/mpe/include/mpe.h"
int main(int argc, char** argv)
{
MPI_Init(&argc, &argv);
MPE_Init_log();
int rank, numtasks;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
int vec[numtasks+1];
vec[0]=0;
vec[rank+1] = rank+1;
MPE_Describe_state(1, 2, "broadcasts", "red");
MPE_Start_log();
MPE_Log_event(1, 0, "start broadcasts");
for(int j=1; j<numtasks+1 ; ++j)
MPI_Bcast( &vec[j], 1, MPI_INT, j-1, MPI_COMM_WORLD);
MPE_Log_event(1, 0, "end broadcasts");
MPE_Stop_log();
MPE_Finish_log("logTest");
MPI_Finalize();
}