hello,
I am working on a c program that includes routines from petsc and scalapack. The program works well with petsc but when I include scalapack and blacs routines in the program and compile. it compiles fine but when I run it, it gives me error as below.
--------------------------------------------------------------------------------------------------------------------------
BLACS ERROR 'Illegal grid (3 x 2), #procs=1'
from {-1,-1}, pnum=0, Contxt=-1, on line -1 of file 'BLACS_GRIDINIT/BLACS_GRIDMAP'.
BLACS ERROR 'Illegal grid (3 x 2), #procs=1'
from {-1,-1}, pnum=0, Contxt=-1, on line -1 of file 'BLACS_GRIDINIT/BLACS_GRIDMAP'.
loading matrix from : /home/ppatel/MPI/LF10_2
nRows: 18, nCoefs: 82.
BLACS ERROR 'Illegal grid (3 x 2), #procs=1'
from {-1,-1}, pnum=0, Contxt=-1, on line -1 of file 'BLACS_GRIDINIT/BLACS_GRIDMAP'.
loading matrix from : /home/ppatel/MPI/LF10_2
nRows: 18, nCoefs: 82.
BLACS ERROR 'Illegal grid (3 x 2), #procs=1'
from {-1,-1}, pnum=0, Contxt=-1, on line -1 of file 'BLACS_GRIDINIT/BLACS_GRIDMAP'.
--------------------------------------------------------------------------------------------------------------------------
my make file is as below
--------------------------------------------------------------------------------------------------------------------------
PETSC_DIR=/export/software/petsc-3.3
INTEL_ROOT=/export/software/intel/composerxe-2011.4.191/
MKL_LIB_PATH_64=/export/software/intel/mkl/lib/intel64/
INTEL_LIB_PATH_64=/export/software/intel/composerxe-2011.4.191/compiler/lib/intel64/
MKL_INC_PATH=/export/software/intel/mkl/include/
SCALAPACK_LIB_PATH=/export/software/scalapack-2.0.2/lib/
SCALAPACK_INC_PATH=/export/software/scalapack-2.0.2/
CLINKER=gcc
PKG_INC = -I${MKL_INC_PATH}
PKG_LIB = -Wl,-rpath,${MKL_LIB_PATH_64} -L${MKL_LIB_PATH_64} -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,-rpath,${INTEL_LIB_PATH_64} -L${INTEL_LIB_PATH_64} -liomp5 -Wl,-rpath,${SCALAPACK_LIB_PATH} -L${SCALAPACK_LIB_PATH} -lscalapack -llapack -lblas
CFLAGS =
FFLAGS =
CPPFLAGS = ${PKG_INC}
FPPFLAGS =
CLEANFILES =
include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules
blockCG_1: blockCG_1.o chkopts
-${CLINKER} -o blockCG_1 blockCG_1.o ${PKG_LIB} ${PETSC_LIB}
--------------------------------------------------------------------------------------------------------------------------
and the part of code that include the blacs/scalapack routines call is as below
--------------------------------------------------------------------------------------------------------------------------
nprow = 3; npcol = 2; mb = 4;
Cblacs_pinfo(&taskid, &numtasks);
Cblacs_get(IMONE, IZERO, &ictxt);
Cblacs_gridinit(&ictxt, &ROWMAJOR, nprow, npcol);
Cblacs_gridinfo(ictxt, &nprow, &npcol, &myrow, &mycol);
int descA[9];
mp = numroc_(&m, &mb, &myrow, &IZERO, &nprow );
kp = numroc_(&k, &mb, &mycol, &IZERO, &npcol );
descinit_(descA, &m, &k, &mb, &mb, &IZERO, &IZERO, &ictxt, &mp, &info);
memset(jpvt,0,sizeof(int)*k);
memset(h_tau,0,sizeof(double)*k);
pdgeqpf_(&m, &k, h_Z, &IONE, &IONE, descA, jpvt, h_tau, work, &lwork, &info);
--------------------------------------------------------------------------------------------------------------------------
Can you help me to configure this program to run it correctly.
to run the program i use this command
/export/software/mpich2-1.4/bin/mpirun -np 6 ./blockCG_1 /home/ppatel/MPI/LF10_2
What I need to do so that the routines can find all the 6 processes?
Thanks,
Priyank

