[petsc-users] Problem with DMDAVecGetArrayF90 and DMDAVecRestoreArrayF90

Barry Smith bsmith at mcs.anl.gov
Mon Apr 14 08:05:02 CDT 2014


  Because IO doesn’t always get flushed immediately it may not be hanging at this point.  It is better to use the option -start_in_debugger then type cont in each debugger window and then when you think it is “hanging” do a control C in each debugger window and type where to see where each process is you can also look around in the debugger at variables to see why it is “hanging” at that point.

   Barry

  This routines don’t have any parallel communication in them so are unlikely to hang.

On Apr 14, 2014, at 6:52 AM, TAY wee-beng <zonexo at gmail.com> wrote:

> Hi,
> 
> My code hangs and I added in mpi_barrier and print to catch the bug. I found that it hangs after printing "7". Is it because I'm doing something wrong? I need to access the u,v,w array so I use DMDAVecGetArrayF90. After access, I use DMDAVecRestoreArrayF90.
> 
>         call DMDAVecGetArrayF90(da_u,u_local,u_array,ierr)
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"3" 
>         call DMDAVecGetArrayF90(da_v,v_local,v_array,ierr)
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"4"
>         call DMDAVecGetArrayF90(da_w,w_local,w_array,ierr)
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"5"
>         call I_IIB_uv_initial_1st_dm(I_cell_no_u1,I_cell_no_v1,I_cell_no_w1,I_cell_u1,I_cell_v1,I_cell_w1,u_array,v_array,w_array)    
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"6"
>         call DMDAVecRestoreArrayF90(da_w,w_local,w_array,ierr)  !must be in reverse order
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"7"
>         call DMDAVecRestoreArrayF90(da_v,v_local,v_array,ierr)    
>         call MPI_Barrier(MPI_COMM_WORLD,ierr);  if (myid==0) print *,"8"
>         call DMDAVecRestoreArrayF90(da_u,u_local,u_array,ierr)
> -- 
> Thank you.
> 
> Yours sincerely,
> 
> TAY wee-beng
> 



More information about the petsc-users mailing list