<div dir="ltr">Xujun,<div>Regarding your original question: please send the complete error message.</div><div>Dmitry.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 17, 2015 at 11:15 AM Xujun Zhao <<a href="mailto:xzhao99@gmail.com">xzhao99@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ahhhh, I should drink some coffee in the morning.<div>Now it passed the test!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 11:13 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Aug 17, 2015 at 11:02 AM, Xujun Zhao <span dir="ltr"><<a href="mailto:xzhao99@gmail.com" target="_blank">xzhao99@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">No. It gives the following error msg:<div></div></div></blockquote><div><br></div></span><div>Did you build the executable?</div><div><br></div><div> cd src/vec/vec/examples/tutorials</div><div> make ex43</div><div><br></div><div> Matt</div><div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>mpirun -np 2 ex43<br></div><div>
<p><span>[<a href="mailto:proxy%3A0%3A0@mcswl164.mcs.anl.gov" target="_blank">proxy:0:0@mcswl164.mcs.anl.gov</a>] [<a href="mailto:proxy%3A0%3A0@mcswl164.mcs.anl.gov" target="_blank">proxy:0:0@mcswl164.mcs.anl.gov</a>] HYDU_create_process (utils/launch/launch.c:75): HYDU_create_process (utils/launch/launch.c:75): execvp error on file ex43 (No such file or directory)</span></p>
<p><span>execvp error on file ex43 (No such file or directory)</span></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 10:57 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Aug 17, 2015 at 10:49 AM, Xujun Zhao <span dir="ltr"><<a href="mailto:xzhao99@gmail.com" target="_blank">xzhao99@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I want PETSc to generate random vector using VecSetRandom() following given examples, but failed and showed some "out of memory" error. The following is the code, which goes well until it reaches VecSetRandom(). Can anyone help me figure out the reason? Thanks a lot.</div></div></blockquote><div><br></div></span><div>Does src/vec/vec/examples/tests/ex43.c run for you?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>XZ<br><br><br>--------------------------------------------------------------------------------------------<br> Vec u;<br> PetscRandom rand_ctx; /* random number generator context */<br> PetscMPIInt size, rank;<br> PetscInt n, dn;<br> <br><br> MPI_Comm_rank(PETSC_COMM_WORLD,&rank);//CHKERRQ(ierr);<br> MPI_Comm_size(PETSC_COMM_WORLD,&size);//CHKERRQ(ierr);<br> n = N/size + 1;<br> dn = n*size - N;<br> if ( dn>0 && rank<dn ) n -= 1;<br> printf("--->test in petsc_random_vector(): rank = %d, n = %d\n",rank,n);<br><br><br> VecCreate(PETSC_COMM_WORLD,&u);<br> VecSetSizes(u,n,N);<br> PetscRandomCreate(PETSC_COMM_WORLD, &rand_ctx);<br>#if defined(PETSC_HAVE_DRAND48)<br> PetscRandomSetType(rand_ctx,PETSCRAND48);<br>#elif defined(PETSC_HAVE_RAND)<br> PetscRandomSetType(rand_ctx,PETSCRAND);<br>#endif<br> PetscRandomSetFromOptions(rand_ctx);<br><br><br> VecSetRandom(u,rand_ctx);<br> PetscRandomDestroy(&rand_ctx);<br></div></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><div><br></div>-- <br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</font></span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div></div></div>
</blockquote></div><br></div>
</blockquote></div>