#include "Didasko_ConfigDefs.h"
#if defined(HAVE_DIDASKO_EPETRA)
#include "Epetra_ConfigDefs.h"
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
#endif
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
{
int MyLength = v.MyLength();
int GlobalLength = v.GlobalLength();
if( MyPID == 0 ) cout << "v = zeros(" << GlobalLength << ")\n";
int Row;
for( int Proc=0 ; Proc<NumProc ; ++Proc ) {
if( MyPID == Proc ) {
cout << "% On proc " << Proc << ": ";
cout << MyLength << " rows of ";
cout << GlobalLength << " elements\n";
for( Row=0 ; Row<MyLength ; ++Row ) {
cout << "b(" << MyGlobalElements[Row]
<< ") = " << v[Row] << ";\n";
}
if( MyPID == NumProc-1 ) {
cout << "% End of vector\n";
}
}
}
return true;
}
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc, &argv);
#else
#endif
int NumGlobalElements = 5;
A.Random();
Vector2MATLAB( A, Map );
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return( EXIT_SUCCESS );
}
#else
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
puts("Please configure Didasko with:\n"
"--enable-epetra");
return 0;
}
#endif