Hello!
My name is Yoo-Chul Kim from Seoul Nat'l Univ. KOREA.
I have some trouble with using ScaLAPACK.
I use c language and intel MKL and mixed language programming (call fortran
function such as pdgetrf_ in c code).
I tried to test ScaLAPACK and made simple code.
But if I insert pdgetrf_(), I got some error messages like these.
<error message>
0: Fatal error in PMPI_Reduce: Invalid MPI_Op, error stack:
0: PMPI_Reduce(1198)...........: MPI_Reduce(sbuf=0x7fbfffe810,
rbuf=0x7fbfffe800, count=1, dtype=0x4c001013, MPI_MAXLOC, root=0,
comm=0xc4000008) failed
0: MPIR_MAXLOC_check_dtype(151): MPI_Op MPI_MAXLOC operation not defined for
this datatype
2: Fatal error in PMPI_Reduce: Invalid MPI_Op, error stack:
2: PMPI_Reduce(1198)...........: MPI_Reduce(sbuf=0x7fbfffe810,
rbuf=0x7fbfffe800, count=1, dtype=0x4c001013, MPI_MAXLOC, root=0,
comm=0xc4000003) failed
2: MPIR_MAXLOC_check_dtype(151): MPI_Op MPI_MAXLOC operation not defined for
this datatype
rank 2 in job 56 node11_55838 caused collective abort of all ranks
exit status of rank 2: return code 1
rank 0 in job 56 node11_55838 caused collective abort of all ranks
exit status of rank 0: return code 1
Could you give me some ideas about these errors? (Where should I look into?)
<code>
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <mkl.h>
#include <mkl_scalapack.h>
#include <memory.h>
#include <time.h>
#define NRANSI
#include "NRUTIL.h"
#define DLEN_ 9
#define CTXT_ 1
#define LLD_ 8
#define MXLLDA 1000
#define MXLLDB 1000
#define MXRHSC 1
#define MXLOCR 1000
#define MXLOCC 1000
void Cblacs_pinfo(int *, int * );
void Cblacs_exit(int);
void Cblacs_get(int, int, int * );
void Cblacs_gridinit(int *, char *, int, int );
void Cblacs_gridinfo(int, int *, int *, int *, int * );
void Cblacs_gridexit(int);
int numroc_(int *, int *, int *, int *, int *);
void descinit_(int *, int *, int *, int *, int *, int *, int *, int *, int *,
int *);
FILE *inp;
int ictxt, locr, locc, *ipvt;
int izero=0, ione=1, np;
int ProcNo, ProcID, nprow, npcol, MB_, NB_, desca[DLEN_], descb[DLEN_];
int main(int argc, char* argv[])
{
int i, j, maxa, maxb, info;
int myrow, mycol, iam, nnodes;
double **Aij, tmp;
int *indx;
char fname[100];
/* setup MPI stuff */
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &ProcNo);
MPI_Comm_rank(MPI_COMM_WORLD, &ProcID);
// processor info
nprow = 2;
npcol = 2;
MB_ = 4;
NB_ = 4;
maxa = MXLLDA;
maxb = MXLLDB;
MPI_Comm my_row_comm, my_col_comm;
MPI_Status stts;
Cblacs_pinfo(&iam, &nnodes);
np = 10;
Cblacs_get(0, 0, &ictxt);
Cblacs_gridinit(&ictxt, "R", nprow, npcol);
Cblacs_gridinfo(ictxt, &nprow, &npcol, &myrow, &mycol);
locr = numroc_(&np, &MB_, &myrow, &izero, &nprow);
locc = numroc_(&np, &NB_, &mycol, &izero, &npcol);
if (locr >= locc) maxa = locr;
else maxa = locc;
descinit_(desca, &np, &np, &MB_, &NB_, &izero, &izero,
&ictxt, &maxa, &info);
descinit_(descb, &np, &ione, &NB_, &ione, &izero, &izero,
&ictxt, &maxb, &info);
Aij = dmatrix(0,MXLOCC-1,0,MXLLDA-1);
ipvt = ivector(0,MXLOCR-1);
sprintf(fname,"Aij%d.dat",ProcID);
inp = fopen(fname,"r");
for (i=0; i<MXLOCR; i++) ipvt[i] = 0;
for (i=0; i<locr; i++)
{
for (j=0; j<locc; j++)
{
fscanf(inp,"%lf",&tmp);
Aij[j][i] = tmp;
}
}
pdgetrf_(&np, &np, &Aij[0][0], &ione, &ione, desca, &ipvt[0], &info);
free_dmatrix(Aij,0,MXLOCC-1,0,MXLLDA-1);
free_ivector(ipvt,0,MXLOCR-1);
MPI_Finalize();
if (ProcID == 0) printf(" calculation END\n");
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.eecs.utk.edu/mailman/private/scalapack/attachments/20091208/eeeb3a2d/attachment.html
|