Updating the ghost nodes for distributed arrays
Hi guys, Is it possible to update the ghost values from a global to a local vector for distributed arrays when global and local vectors are not from the same DA, but the global vectors are the same? This is the the code that I have, (the only difference between the two DA's is the width. So, I am assuming that any global vector created based on those are going to be the same) G_data is created based on DA_3D, whereas L_data2 is created based on DA_3D2. Vec G_data, L_data; Vec G_data2, L_data2; ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D); ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width+2, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D2); ierr = DACreateGlobalVector(DA_3D, &G_data); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D, &L_data); CHKERRQ(ierr); ierr = DACreateGlobalVector(DA_3D2, &G_data2); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D2, &L_data2); CHKERRQ(ierr); /* =====> Is this possible? */ ierr = DAGlobalToLocalBegin(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr); ierr = DAGlobalToLocalEnd(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr); Thanks, Mohamad
On Dec 14, 2010, at 4:15 AM, Mohamad M. Nasr-Azadani wrote:
Hi guys,
Is it possible to update the ghost values from a global to a local vector for distributed arrays when global and local vectors are not from the same DA, but the global vectors are the same?
Yes
This is the the code that I have, (the only difference between the two DA's is the width. So, I am assuming that any global vector created based on those are going to be the same)
Yes
G_data is created based on DA_3D, whereas L_data2 is created based on DA_3D2.
Vec G_data, L_data; Vec G_data2, L_data2;
ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D); ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width+2, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D2);
ierr = DACreateGlobalVector(DA_3D, &G_data); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D, &L_data); CHKERRQ(ierr);
ierr = DACreateGlobalVector(DA_3D2, &G_data2); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D2, &L_data2); CHKERRQ(ierr);
/* =====> Is this possible? */ ierr = DAGlobalToLocalBegin(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr); ierr = DAGlobalToLocalEnd(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr);
Thanks, Mohamad
Thanks Barry for your help. M On Tue, Dec 14, 2010 at 6:12 AM, Barry Smith <[email protected]> wrote:
On Dec 14, 2010, at 4:15 AM, Mohamad M. Nasr-Azadani wrote:
Hi guys,
Is it possible to update the ghost values from a global to a local vector for distributed arrays when global and local vectors are not from the same DA, but the global vectors are the same?
Yes
This is the the code that I have, (the only difference between the two DA's is the width. So, I am assuming that any global vector created based on those are going to be the same)
Yes
G_data is created based on DA_3D, whereas L_data2 is created based on
DA_3D2.
Vec G_data, L_data; Vec G_data2, L_data2;
ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ,
PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D);
ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ,
PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width+2, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D2);
ierr = DACreateGlobalVector(DA_3D, &G_data); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D, &L_data); CHKERRQ(ierr);
ierr = DACreateGlobalVector(DA_3D2, &G_data2); CHKERRQ(ierr); ierr = DACreateLocalVector(DA_3D2, &L_data2); CHKERRQ(ierr);
/* =====> Is this possible? */ ierr = DAGlobalToLocalBegin(DA_3D2, G_data, INSERT_VALUES,
L_data2);CHKERRQ(ierr);
ierr = DAGlobalToLocalEnd(DA_3D2, G_data, INSERT_VALUES,
L_data2);CHKERRQ(ierr);
Thanks, Mohamad
participants (2)
-
Barry Smith -
Mohamad M. Nasr-Azadani