This is the error message generated by the above code:

#0  0x00000031ee0ac69d in waitpid () from /lib64/libc.so.6
#1  0x00000031ee03e609 in do_system () from /lib64/libc.so.6
#2  0x00000031ee03e940 in system () from /lib64/libc.so.6
#3  0x00002af721f1b1bf in (anonymous
namespace)::gdb_backtrace(std::basic_ostream<char, std::char_traits<char>
>&) () from /home/hsahasra/NEMO5/libs/libmesh/libmesh/.libs/libmesh_opt.so.0
#4  0x00002af721f1c12d in libMesh::print_trace(std::basic_ostream<char,
std::char_traits<char> >&) () from
/home/hsahasra/NEMO5/libs/libmesh/libmesh/.libs/libmesh_opt.so.0
#5  0x00002af721f19145 in libMesh::MacroFunctions::report_error(char
const*, int, char const*, char const*) () from
/home/hsahasra/NEMO5/libs/libmesh/libmesh/.libs/libmesh_opt.so.0
#6  0x0000000000419906 in libMesh::PetscVector<double>::operator()
(this=0xd03510, i=0) at
/home/hsahasra/NEMO5/libs/libmesh/libmesh/include/libmesh/petsc_vector.h:1214
#7  0x000000000040b39d in main (argc=1, argv=0x7fff5d9a5368) at
petsc_vector_test.cpp:47
[0]
/home/hsahasra/NEMO5/libs/libmesh/libmesh/include/libmesh/petsc_vector.h,
line 1214, compiled Mar  8 2016 at 14:08:51


On Tue, Mar 8, 2016 at 2:12 PM, Harshad Sahasrabudhe <hsaha...@purdue.edu>
wrote:

> Hi John,
>
> I assume you mean "opt" mode, otherwise that doesn't make sense because
>> the error you are referring to above is an assert, which is only active in
>> debug mode.
>
>
> Yes, this doesn't make sense to me either. I'm running in "opt" mode, but
> this assert still gets triggered.
>
> I have pasted a very simple code below which causes the assert fail on my
> machine. Could you please check if it fails for you too?
>
> #include "libmesh.h"
> #include "petsc_vector.h"
>
> using namespace libMesh;
>
> int main(int argc, char* argv[])
> {
>   LibMeshInit libmesh_init(argc, argv);
>   Parallel::Communicator comm;
>   libmesh_init.comm().duplicate(comm);
>   int num_procs = comm.size();
>   int rank = comm.rank();
>
>   unsigned int N = 60;
>   unsigned int n = 60/num_procs;
>   std::vector<unsigned int> send_list(2);
>
>   if(num_procs != 1)
>   {
>     if(rank != 0)
>       send_list[0] = rank*n-1;
>     else
>       send_list[0] = n+2;
>
>     if(rank != num_procs - 1)
>       send_list[1] = (rank+1)*n+1;
>     else
>       send_list[1] = rank*n-2;
>   }
>   else
>   {
>     send_list[0] = 0;
>     send_list[1] = N-1;
>   }
>
>
>   PetscVector<double> parallel(comm, N, n, PARALLEL);
>   PetscVector<double> *ghosted = NULL;
>
>   if(num_procs != 1)
>     ghosted = new PetscVector<double>(comm, N, n+2, send_list, GHOSTED);
>   else
>     ghosted = new PetscVector<double>(comm, N, n, send_list, GHOSTED);
>
>   parallel.localize(*ghosted, send_list);
>
>   double a = (*ghosted)(send_list[0]);
>   double b = (*ghosted)(send_list[1]);
>
>   delete ghosted;
> }
>
> Thanks!
> Harshad
>
> On Tue, Mar 8, 2016 at 2:07 PM, John Peterson <jwpeter...@gmail.com>
> wrote:
>
>>
>>
>> On Tue, Mar 8, 2016 at 11:35 AM, Harshad Sahasrabudhe <
>> hsaha...@purdue.edu> wrote:
>>
>>> Hi,
>>>
>>> I'm running into a problem with ghost vectors created with PetscVector in
>>> LibMesh 0.9.5 PETSc 3.5.4. When I call the operator(), the call fails at
>>> the assert local_index < _local_size (petsc_vector.h:1214). The
>>> _local_size
>>> variable in PetscVector is 0 (after _get_array is called) even if the
>>> *ghost
>>> *indices vector is non-zero while creating the vector using the
>>> constructor:
>>>
>>> PetscVector (const Parallel::Communicator &comm_in, const
>>> numeric_index_type N, const numeric_index_type n_local, const
>>> std::vector<
>>> numeric_index_type > &*ghost*, const ParallelType type=AUTOMATIC)
>>>
>>> I checked that the ghost indices are out of the scope of first_local_dof
>>> and last_local_dof in DofMap. I am localizing the vector using the
>>> function
>>>
>>> system->solution->localize(ghost_vector, ghost_indices)
>>>
>>> I don't get any error when I run in debug mode.
>>
>>
>> I assume you mean "opt" mode, otherwise that doesn't make sense because
>> the error you are referring to above is an assert, which is only active in
>> debug mode.
>>
>>
>>> Could this be a compilation
>>> issue? I have no clue what this could be. Any help is appreciated!
>>>
>>
>> I think it's more likely that your application code is doing something
>> incorrectly...
>>
>> --
>> John
>>
>
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to