<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear Petsc developer:           </div><div>Hi,</div><div>Thank you very much for your previous reply. </div><div>I recently wanted to modify my program to parallel version, and encountered some problems in modifying it.            </div><div>1. There are functions (read matrix) in the program that reads files,will they affect my parallelism?  The codes are as follows:           </div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><font size="1">ierr = PetscViewerBinaryOpen (PETSC_COMM_WORLD, file, FILE_MODE_READ, &viewer); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatCreate (PETSC_COMM_WORLD, &A1); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatSetFromOptions (A1); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatCreate (PETSC_COMM_WORLD, &A2); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatSetFromOptions (A2); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatLoad (A1, viewer); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = MatLoad (A2, viewer); CHKERRQ (ierr);            </font></div></div></div><div><div><div><font size="1">ierr = PetscViewerDestroy (&viewer); CHKERRQ (ierr);  </font>          </div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div>I read two matrix information from a binary file and wanted to use it on each processor (in fact, my goal was to use these two matrices to give initial values to the two field variables). The program can run in serial time. Now I want to change it to parallel program. What do I need to modify?            </div><div>2. Following the last question, I used the following code in giving initial value procedure FormInitialGuess():            </div></div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><div><font size="1">ierr = MatSeqAIJGetArray (A1, &initial_phi1); CHKERRQ (ierr);            </font></div></div></div></div><div><div><div><div><font size="1">ierr = MatSeqAIJGetArray (A2, &initial_phi2); CHKERRQ (ierr); </font>           </div></div></div></div></blockquote><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I found this function on manualpages, and I felt that it could fulfill my need to represent the elements of the matrix in arrays to give field variables an initial value in each grid. The matrix A1 and A2 above are actually the matrix information that was read from the file before. Now I want to modify it as a parallel program. How do I use matrix information to give initial values in parallel? (In p<span style="white-space:pre-wrap">rogram, field variables are implemented through DM because parallel computing and Ghost Value are supported</span>)</div><div><br></div><div>Thanks,</div><div>Yingjie</div></div></div></div></div>