Global to Local Vector Mapping

Matthew Knepley knepley at gmail.com
Mon Dec 3 12:03:50 CST 2007


On Dec 3, 2007 11:49 AM, Tim Stitt <timothy.stitt at ichec.ie> wrote:
> Hi all,
>
> Is there a quick way to map a global index for a parallel vector to a
> local mapping tuple (p,i) were 'p' represents the process containing the
> value and 'i' is the local index number on that process?

PetscMapGetGlobalRange(&v->map,const &range);
for(p = 0; p < numProcs; ++p) if (range[p+1] > globalInd) break;
localInd = globalInd - range[p];

   Matt

> As always, thanks in advance for any information provided.
>
> Tim.
>
> --
> Dr. Timothy Stitt <timothy_dot_stitt_at_ichec.ie>
> HPC Application Consultant - ICHEC (www.ichec.ie)
>
> Dublin Institute for Advanced Studies
> 5 Merrion Square - Dublin 2 - Ireland
>
> +353-1-6621333 (tel) / +353-1-6621477 (fax)
>
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list