[petsc-users] About efficiency in MatAssembling

PEREZ CERQUERA MANUEL RICARDO manuel.perezcerquera at polito.it
Tue Nov 8 07:49:37 CST 2011


Hi all,

I'm having problems with the efficiency of my code, I 
mean, it's taken so much time when  I'm running in 2 
processors than in 1 Processor. My guess is that the 
communications at low level inside PETSC Directives, 
because I'm generating the elements on wrong processes and 
this is killing me, moreover I'm over estimated my memory 
occupancy,  so my questions are:

1. For The Memory Occupancy , I Know the NonZero Pattern 
of my Matrix, so I'm calling
     CALL 
MatCreateMPIAIJ(PETSC_COMM_WORLD,LocalNOfBEMFunctions,LocalTotalRank,NOfTotalBEMFunctions,GlobalTotalRank,&
                                         PETSC_NULL_INTEGER,NNZ_diagonal(:),&
                                         PETSC_NULL_INTEGER,NNZ_outofdiagonal(:),UFar,ierr)
    So I have a doubt if when I'm doing this Should I 
specify just one NNZ_diagonal(:) or  NNZ_outofdiagonal(:) 
?, not both of them as I'm doing.

2. For the time efficiency, When I'm calling, 
MatSetValues() The Global Index is out of the range set in 
MatCreateMPIAIJ, I mean for example if the range is 
between 1 and 10 in a Matrix of 100 The Global index are 
let's say 1 20 25 2 5 60 85 90 100 3 so there are some 
elements out of the range, moreover I ran with -info 
option and I got this:
[0] MatAssemblyBegin_MPIAIJ(): Stash has 84088 entries, 
uses 3 mallocs. And in the manual is written this actually 
means I'm generating entries in the wrong process,not 
because of the mollocs but because of the entries, Do I'm 
right ?

  So is this indeed not efficient?. If not, Can you 
suggest me a possible way to improve it? , Or there are 
some special way for indexing the elements in order to put 
them in order to solve the system?

Thanks!

Manuel.



  I realized with -info option in run time
  





Eng. Manuel Ricardo Perez Cerquera. MSc. Ph.D student
Antenna and EMC Lab (LACE)
Istituto Superiore Mario Boella (ISMB)
Politecnico di Torino
Via Pier Carlo Boggio 61, Torino 10138, Italy
Email: manuel.perezcerquera at polito.it
Phone: +39 0112276704
Fax: +39 011 2276 299


More information about the petsc-users mailing list