Manage many linear solvers parallely

Asked by Nguyen Van Dang on 2013-03-29

Hello Fenics supporters,
I have to deal with more than 4 linear systems separately at the same time in a time dependent problem. I am using Fenics C++ on linux. The general form of my linear system is solve(M,rhs,u), where M is PETScMatrix, rhs and u are PETScVector.
I compiled my script with mpirun: mpirun -np 4 ./demo. Then, I used processor ID to manage the solvers but it did not work. Maybe it conflicted with parallel treatment on mesh, on solvers,... Can you show me if there is some technique to deal with this problem?
Thanks a lot,
Best regards,
Dang

Here is the general idea for my code

  int nprocs; //holder for the number of cores
  int rank; //holder for the ID number of this core

  // Initialise MPI
  MPI_Init(NULL, NULL);

  // Get the number of cores in the MPI cluster
  MPI_Comm_size( MPI_COMM_WORLD, &nprocs );

  // Get the ID number of this core in the MPI cluster
  MPI_Comm_rank( MPI_COMM_WORLD, &rank );

    if (rank==0)
    {
       solve(linear system0)
    }
    if (rank==1)
    {
      solve(linear system1)
    }
    ......

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Nguyen Van Dang
Solved:
2013-04-19
Last query:
2013-04-19
Last reply:
2013-04-18

This question was reopened

Jan Blechta (blechta) said : #1

On Fri, 29 Mar 2013 16:41:20 -0000
Nguyen Van Dang <email address hidden> wrote:
> New question #225438 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/225438
>
> Hello Fenics supporters,
> I have to deal with more than 4 linear systems separately at the same
> time in a time dependent problem. I am using Fenics C++ on linux. The
> general form of my linear system is solve(M,rhs,u), where M is
> PETScMatrix, rhs and u are PETScVector. I compiled my script with
> mpirun: mpirun -np 4 ./demo. Then, I used processor ID to manage the
> solvers but it did not work. Maybe it conflicted with parallel
> treatment on mesh, on solvers,... Can you show me if there is some
> technique to deal with this problem? Thanks a lot, Best regards, Dang
>
> Here is the general idea for my code
>
> int nprocs; //holder for the number of cores
> int rank; //holder for the ID number of this core
>
> // Initialise MPI
> MPI_Init(NULL, NULL);
>
> // Get the number of cores in the MPI cluster
> MPI_Comm_size( MPI_COMM_WORLD, &nprocs );
>
> // Get the ID number of this core in the MPI cluster
> MPI_Comm_rank( MPI_COMM_WORLD, &rank );
>
> if (rank==0)
> {
> solve(linear system0)
> }
> if (rank==1)
> {
> solve(linear system1)
> }
> ......
>

If I understand it correctly you want to run parallel task where DOLFIN
objects does not feel parallel. Then you could use my experimental
branch lp:~blechta/dolfin/serial-meshes. It is implemented in a rather
hacky way but it should work for your needs. It also has two demos...

Jan

Nguyen Van Dang (dang-1032170) said : #2

Dear Jan,
That's exactly what I need. I tried to rewrite your code in C++ but you did some changes in MPI.cpp, GlobalParameters.cpp,... How to put these changes in the code? I attached the script and the error message.
Thanks for your help,
Best regards,
Dang

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to access parameter.
*** Reason: Parameter "dolfin.pretend_one_process" not defined.
*** Where: This error was encountered inside Parameters.cpp.
*** -------------------------------------------------------------------------

#include <dolfin.h>
#include "Poisson.h"
#include </home/dang1032170/Documents/parallel_test/poisson/cpp/dolfin/parameter/GlobalParameters.h>

using namespace dolfin;

// Source term (right-hand side)
class Source : public Expression
{
  void eval(Array<double>& values, const Array<double>& x) const
  {
    double dx = x[0] - 0.5;
    double dy = x[1] - 0.5;
    values[0] = 10*exp(-(dx*dx + dy*dy) / 0.02);
  }
};

// Normal derivative (Neumann boundary condition)
class dUdN : public Expression
{
  void eval(Array<double>& values, const Array<double>& x) const
  {
    values[0] = sin(5*x[0]);
  }
};

// Sub domain for Dirichlet boundary condition
class DirichletBoundary : public SubDomain
{
  bool inside(const Array<double>& x, bool on_boundary) const
  {
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS;
  }
};

int main()
{

  int process_number = dolfin::MPI().process_number();
  int num_processes = dolfin::MPI().num_processes();
  std::cout<<"I am processor "<<process_number<<" of "<<num_processes<<" processors\n";
  parameters["linear_algebra_backend"] = "PETSc";
  if (process_number==0)
  {
   parameters["pretend_one_process"] = true;
   // Create mesh and function space
   UnitSquare mesh(32, 32);
   Poisson::FunctionSpace V(mesh);

   // Define boundary condition
   Constant u0(0.0);
   DirichletBoundary boundary;
   DirichletBC bc(V, u0, boundary);

   // Define variational forms
   Poisson::BilinearForm a(V, V);
   Poisson::LinearForm L(V);
   Source f;
   dUdN g;
   L.f = f;
   L.g = g;

   // Compute solution
   Function u(V);
   solve(a == L, u, bc);

   // Save solution in VTK format
   File file("poisson.pvd");
   file << u;

   // Plot solution
   plot(u);
  }
  return 0;
}

Jan Blechta (blechta) said : #3

On Mon, 01 Apr 2013 07:50:57 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> That's exactly what I need. I tried to rewrite your code in C++ but
> you did some changes in MPI.cpp, GlobalParameters.cpp,... How to put
> these changes in the code? I attached the script and the error
> message. Thanks for your help, Best regards, Dang
>
> ***
> -------------------------------------------------------------------------
> *** DOLFIN encountered an error. If you are not able to resolve this
> issue *** using the information listed below, you can ask for help at
> *** *** https://answers.launchpad.net/dolfin
> ***
> *** Remember to include the error message listed below and, if
> possible, *** include a *minimal* running example to reproduce the
> error. ***
> ***
> -------------------------------------------------------------------------
> *** Error: Unable to access parameter. *** Reason: Parameter
> "dolfin.pretend_one_process" not defined. *** Where: This error was
> encountered inside Parameters.cpp. ***
> -------------------------------------------------------------------------
>
> #include <dolfin.h>
> #include "Poisson.h"
> #include
> </home/dang1032170/Documents/parallel_test/poisson/cpp/dolfin/parameter/GlobalParameters.h>
>
> using namespace dolfin;
>
> // Source term (right-hand side)
> class Source : public Expression
> {
> void eval(Array<double>& values, const Array<double>& x) const
> {
> double dx = x[0] - 0.5;
> double dy = x[1] - 0.5;
> values[0] = 10*exp(-(dx*dx + dy*dy) / 0.02);
> }
> };
>
> // Normal derivative (Neumann boundary condition)
> class dUdN : public Expression
> {
> void eval(Array<double>& values, const Array<double>& x) const
> {
> values[0] = sin(5*x[0]);
> }
> };
>
> // Sub domain for Dirichlet boundary condition
> class DirichletBoundary : public SubDomain
> {
> bool inside(const Array<double>& x, bool on_boundary) const
> {
> return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS;
> }
> };
>
> int main()
> {
>
> int process_number = dolfin::MPI().process_number();
> int num_processes = dolfin::MPI().num_processes();
> std::cout<<"I am processor "<<process_number<<" of
> "<<num_processes<<" processors\n";
> parameters["linear_algebra_backend"] = "PETSc"; if (process_number==0)
> {
> parameters["pretend_one_process"] = true;
> // Create mesh and function space
> UnitSquare mesh(32, 32);
> Poisson::FunctionSpace V(mesh);
>
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
>
> // Define variational forms
> Poisson::BilinearForm a(V, V);
> Poisson::LinearForm L(V);
> Source f;
> dUdN g;
> L.f = f;
> L.g = g;
>
> // Compute solution
> Function u(V);
> solve(a == L, u, bc);
>
> // Save solution in VTK format
> File file("poisson.pvd");
> file << u;
>
> // Plot solution
> plot(u);
> }
> return 0;
> }
>

You need to pull the branch using bazaar and compile it. It is
basically same procedure like
http://fenicsproject.org/download/installation_from_source.html#installation-from-source
or
http://fenicsproject.org/download/installation_using_dorsal.html#installation-using-dorsal
but taking branch lp:~blechta/dolfin/serial-meshes instead of
lp:dolfin/1.1.0.

You need to choose other components compatible with dolfin 1.1.0. These
are:
UFL 1.1
UFC 2.1
FFC 1.1
Instant 1.1

Jan

Nguyen Van Dang (dang-1032170) said : #4

Dear Jan,
I downloaded and installed the newest dorsal here https://launchpad.net/dorsal but it failed in the middle

common.copy /home/dang1032170/Work/FEniCS/include/boost/tr1/tr1/algorithm
...failed updating 30 targets...
...skipped 6 targets...
...updated 9740 targets...
Failure with exit status: 1
Exit message: There was a problem building boost_1_47_0.

Moreover, I am still confused about "taking branch lp:~blechta/dolfin/serial-meshes instead of
lp:dolfin/1.1.0.". It means that I have to change the directory somewhere? Can you please show me more details?

Thanks a lot,
Best regards,
Dang

Jan Blechta (blechta) said : #5

On Mon, 01 Apr 2013 20:15:56 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I downloaded and installed the newest dorsal here
> https://launchpad.net/dorsal but it failed in the middle
>
> common.copy /home/dang1032170/Work/FEniCS/include/boost/tr1/tr1/algorithm
> ...failed updating 30 targets...
> ...skipped 6 targets...
> ...updated 9740 targets...
> Failure with exit status: 1
> Exit message: There was a problem building boost_1_47_0.

Navigate to boost src dir and check dorsal_configure.log and
dorsal_build.log for a cause of error.

>
> Moreover, I am still confused about "taking branch
> lp:~blechta/dolfin/serial-meshes instead of lp:dolfin/1.1.0.". It
> means that I have to change the directory somewhere? Can you please
> show me more details?

First of all you need to start from FEniCS 1.1.0 instead of development
release trunk or stable release 1.2.0 as serial-meshes branch will not
probably work with them.

You could switch to dorsal which downloads stable release 1.1.0.
1. Install bzr.
2. Get branch of dorsal at revision 830
     cd /your/work/path
     bzr branch -r 830 lp:dorsal
3. Set in dorsal.cfg STABLE_BUILD=true and tweak your platform file
   for optional packages you need.
4. Build with dorsal
     ./dorsal.sh FEniCS/platforms/supported/your.platform
5. Atter you succeed building go to dolfin dir and switch to
   serial-meshes branch
     cd /your/work/path/fenics/src/dolfin
     bzr branch --use-existing-dir lp:~blechta/dolfin/serial-meshes .
   (note . on the end of line)
6. Rebuild only dolfin
     cd /your/work/path/fenics/src/dolfin
     ./dorsal_build
7. Try running serial-meshes demo.

Maybe Johannes would know clever solution to get 1.1.0 a switch dolfin
to custom branch.

Jan

>
> Thanks a lot,
> Best regards,
> Dang
>

Nguyen Van Dang (dang-1032170) said : #6

Dear Jan,
I tried ./dorsal.sh FEniCS/platforms/supported/lucid.platform and failed at the step 4 with the same error
...failed updating 30 targets...
...skipped 6 targets...
...updated 10232 targets...
Failure with exit status: 1
Exit message: There was a problem building boost_1_51_0.
Here is the dorsal_build.log file I got from working directory. Can you please tell me what the problem is and how to fix it?
 https://transfert.inria.fr/fichiers/7791fefa4570055c037dc146541c4976/dorsal_build.log
Thanks
Best regards,
Dang

Jan Blechta (blechta) said : #7

On Tue, 02 Apr 2013 07:31:17 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I tried ./dorsal.sh FEniCS/platforms/supported/lucid.platform and

Did you read dorsal instructions shown before pulling boost to fetch
dependencies?

# This build script assumes that you have several packages already
# installed via Ubuntu's apt-get using the following command:
#
# sudo apt-get install autoconf bzr bzrtools cmake flex g++ gfortran \
# libatlas-base-dev \
# libcln-dev libcppunit-dev libginac-dev libgmp3-dev \
# liblapack-dev libmpfr-dev libopenmpi-dev libpcre3-dev \
# libsuitesparse-dev libxml2-dev openmpi-bin pkg-config \
# python-dev python-numpy python-scientific python-vtk subversion \
# wget bison libbz2-dev python-ply libvtk5-dev
#
# Also, if you have multiple MPI libraries installed, make sure
# "sudo update-alternatives --config mpi" is set to openmpi.
#
# After Dorsal has completed, please make sure the following
# environment variable is set before running any Python FEniCS
# programs:
#
# export BOOST_DIR=${INSTALL_PATH}

> failed at the step 4 with the same error ...failed updating 30
> targets... ...skipped 6 targets...
> ...updated 10232 targets...
> Failure with exit status: 1
> Exit message: There was a problem building boost_1_51_0.
> Here is the dorsal_build.log file I got from working directory. Can
> you please tell me what the problem is and how to fix it?

I guess there is some problem with python dependency. But I never
installed boost from scratch.

Jan

> https://transfert.inria.fr/fichiers/7791fefa4570055c037dc146541c4976/dorsal_build.log
> Thanks Best regards,
> Dang
>

Johannes Ring (johannr) said : #8

@Jan: I don't know if it's a better solution, but before step 4 you could modify FEniCS/packages/dolfin.package like this:

  -NAME=dolfin
  -SOURCE=lp:
  +NAME=serial-meshes
  +SOURCE=lp:~blechta/dolfin/

Then step 5 and 6 can be skipped.

@Dang: Jan is probably right. It looks like you are missing Python.h, which should be installed by the python-dev package.

Jan Blechta (blechta) said : #9

On Tue, 02 Apr 2013 11:56:18 -0000
Johannes Ring <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Johannes Ring posted a new comment:
> @Jan: I don't know if it's a better solution, but before step 4 you
> could modify FEniCS/packages/dolfin.package like this:
>
> -NAME=dolfin
> -SOURCE=lp:
> +NAME=serial-meshes
> +SOURCE=lp:~blechta/dolfin/

Plus
rm FEniCS/packages/dolfin-stable.package
otherwise dorsal will not look into FEniCS/packages/dolfin.package

>
> Then step 5 and 6 can be skipped.
>
> @Dang: Jan is probably right. It looks like you are missing Python.h,
> which should be installed by the python-dev package.
>

Johannes Ring (johannr) said : #10

Yes. Or you can build everything except DOLFIN, then change STABLE_BUILD=false in dorsal.cfg and then only build DOLFIN.

Dear Jan and Johannes,
I succeeded building all packages listed in lucid.platform except dolfin with following errors:

You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data. See "bzr help launchpad-login".
\ 169775KB 59KB/s | Fetching revisions:Inserting stream

I tried a solution at https://answers.launchpad.net/bzr/+question/151218 but I got error

bzr: ERROR: The user provider11 has not registered any SSH keys with Launchpad.
See <https://launchpad.net/people/+me>

Can you please tell me how to fix this?
Thanks,
Best regards,
Dang

I removed dolfin-stable.package and used following information
In dorsal.cfg
STABLE_BUILD=true
In dolfin.pakage
NAME=serial-meshes
SOURCE=lp:~blechta/dolfin/
PACKING=bzr
BUILDCHAIN=cmake
CONFOPTS="-DCMAKE_SKIP_RPATH:BOOL=ON -DCGAL_DISABLE_ROUNDING_MATH_CHECK:BOOL=ON"

I tried again. It skipped the above error but I still failed
c++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make[2]: *** [dolfin/CMakeFiles/dolfin.dir/generation/CSGCGALMeshGenerator3D.cpp.o] Error 1
make[2]: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
make[1]: *** [dolfin/CMakeFiles/dolfin.dir/all] Error 2
make[1]: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
make: *** [all] Error 2
make: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
Failure with exit status: 2
Exit message: There was a problem building serial-meshes.
Here is the README.Bugs
 https://transfert.inria.fr/fichiers/5b34c4b4cb1f019234691d4195e4bcf6/README.Bugs

Jan Blechta (blechta) said : #14

On Wed, 03 Apr 2013 06:26:17 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan and Johannes,
> I succeeded building all packages listed in lucid.platform except
> dolfin with following errors:
>
> You have not informed bzr of your Launchpad ID, and you must do this
> to write to Launchpad or access private data. See "bzr help
> launchpad-login". \ 169775KB 59KB/s | Fetching revisions:Inserting
> stream
>
> I tried a solution at
> https://answers.launchpad.net/bzr/+question/151218 but I got error
>
> bzr: ERROR: The user provider11 has not registered any SSH keys with
> Launchpad. See <https://launchpad.net/people/+me>

You need to register at launchpad.net, provide public ssh key of your
machine via launchpad web UI and do
  bzr launchpad-login your-launchpad-user-name

>
> Can you please tell me how to fix this?
> Thanks,
> Best regards,
> Dang
>

Jan Blechta (blechta) said : #15

On Wed, 03 Apr 2013 09:21:08 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Nguyen Van Dang gave more information on the question:
> I tried again. It skipped the above error but I still failed
> c++: Internal error: Killed (program cc1plus)
> Please submit a full bug report.
> See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
> make[2]: ***
> [dolfin/CMakeFiles/dolfin.dir/generation/CSGCGALMeshGenerator3D.cpp.o]
> Error 1 make[2]: Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
> make[1]: *** [dolfin/CMakeFiles/dolfin.dir/all] Error 2 make[1]:
> Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
> make: *** [all] Error 2 make: Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
> Failure with exit status: 2 Exit message: There was a problem
> building serial-meshes. Here is the README.Bugs
> https://transfert.inria.fr/fichiers/5b34c4b4cb1f019234691d4195e4bcf6/README.Bugs
>

README.Bugs is manual for submitting bugs to developers of GCC. It is
not useful here. What is in dorsal_configure.log and dorsal_build.log?

Is gcc-4.4 supported, Johannes?

Johannes Ring (johannr) said : #16

@Jan: Yes, we build and run tests with gcc-4.4 on the buildbot (lucid-amd64 has gcc 4.4.3 and squeeze-amd64 has 4.4.5).

@Jan: Here is the dorsal_build.log file I got from Work/FEniCS/src/boost_1_51_0/. The file dorsal_configure.log is empty.
https://transfert.inria.fr/fichiers/30bca61f47ad81befea4d2873aa6096a/dorsal_build.log

Johannes Ring (johannr) said : #18

That was the build log for Boost, which does not contain any errors. In post #13 it looks like it was DOLFIN that failed. Post dorsal_configure.log and dorsal_build.log for DOLFIN instead.

Jan Blechta (blechta) said : #19

On Wed, 03 Apr 2013 11:16:02 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> @Jan: Here is the dorsal_build.log file I got from
> Work/FEniCS/src/boost_1_51_0/. The file dorsal_configure.log is
> empty.
> https://transfert.inria.fr/fichiers/30bca61f47ad81befea4d2873aa6096a/dorsal_build.log
>

I mean the dorsal_configure.log and dorsal_build.log from dolfin src
dir. It would be in something like Work/FEniCS/src/dolfin/ or
Work/FEniCS/src/serial-meshes/

Johannes Ring (johannr) said : #21

The problem might be that you ran out of memory. Try again, but if the same thing happens, you might need to disable CGAL.

Dear Johannes,
I registered SSH at https://launchpad.net/~dang-1032170 and tried bzr launchpad-login dang-1032170 without warnings, error messages.
Then, I built again ./dorsal.sh FEniCS/platforms/supported/lucid.platform
I got these messages at the end:
ssh: connect to host bazaar.launchpad.net port 22: Connection timed out
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist. Can you please tell me how to fix it? It works if I disable CGAL? If yes, how to disable it?
Thanks a lot,
Best regards,
Dang

Jan Blechta (blechta) said : #23

On Wed, 03 Apr 2013 20:45:48 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Johannes,
> I registered SSH at https://launchpad.net/~dang-1032170 and tried bzr
> launchpad-login dang-1032170 without warnings, error messages. Then,
> I built again ./dorsal.sh FEniCS/platforms/supported/lucid.platform I
> got these messages at the end: ssh: connect to host
> bazaar.launchpad.net port 22: Connection timed out bzr: ERROR:

That seems like problem on launchad or with your ssh.

You don't have to ssh to launchpad if you already have source code of
serial-meshes branch. You don't even have to execute dorsal.sh and
build everything from beginning. Just execute ./dorsal_cofigure
&& ./dorsal_build in serial-meshes src dir.

Alternatively you can prepend skip: to lines in platform file which you
don't need to be rebuild. Check dorsal documentation for this feature.
It will save you lot of time.

> Connection closed: Unexpected end of message. Please check
> connectivity and permissions, and report a bug if problems persist.
> Can you please tell me how to fix it? It works if I disable CGAL? If
> yes, how to disable it? Thanks a lot, Best regards, Dang
>

First free some memory and try rebuilding by ./dorsal_build in
serial-meshes src dir.

You can disable CGAL in
file /src/serial-meshes/dorsal_build_dir/CMakeCache.txt by changing
DOLFIN_ENABLE_CGAL

Jan

Dear Jan,
I skipped all installed packages and tried again but I still failed. Moreover, I did not find out the directory serial-meshes in /home/dang1032170/Work/FEniCS/src/.
Best regards,
Found configuration for project FEniCS.
Skipping boost_1_51_0
Skipping armadillo-3.6.1
Skipping parmetis-4.0.2
Skipping CGAL-4.1
Skipping swig-2.0.3
Skipping trilinos-11.0.3-Source
Skipping petsc-3.3-p6
Skipping slepc-3.3-p3
Skipping scotch_6.0.0_esmumps
Skipping fiat-1.1
Skipping ufc-2.1.0
Skipping ufl-1.1.0
Skipping ffc-1.1.0
Skipping viper-1.0.0
Skipping instant-1.1.0
Fetching serial-meshes
ssh: connect to host bazaar.launchpad.net port 22: Connection refused
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.
Failure with exit status: 3
Exit message: Error fetching serial-meshes.

Jan Blechta (blechta) said : #25

On Thu, 04 Apr 2013 05:51:19 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I skipped all installed packages and tried again but I still failed.
> Moreover, I did not find out the directory serial-meshes
> in /home/dang1032170/Work/FEniCS/src/. Best regards, Found
> configuration for project FEniCS. Skipping boost_1_51_0
> Skipping armadillo-3.6.1
> Skipping parmetis-4.0.2
> Skipping CGAL-4.1
> Skipping swig-2.0.3
> Skipping trilinos-11.0.3-Source
> Skipping petsc-3.3-p6
> Skipping slepc-3.3-p3
> Skipping scotch_6.0.0_esmumps
> Skipping fiat-1.1
> Skipping ufc-2.1.0
> Skipping ufl-1.1.0
> Skipping ffc-1.1.0
> Skipping viper-1.0.0
> Skipping instant-1.1.0
> Fetching serial-meshes
> ssh: connect to host bazaar.launchpad.net port 22: Connection refused
> bzr: ERROR: Connection closed: Unexpected end of message. Please
> check connectivity and permissions, and report a bug if problems
> persist. Failure with exit status: 3 Exit message: Error fetching
> serial-meshes.
>

Did you tell to bzr your own launchpad login?
  bzr launchpad-login dang-1032170

Yes, I did but I still got the errors.

On Thu, Apr 4, 2013 at 1:26 PM, Jan Blechta <
<email address hidden>> wrote:

> Your question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Open => Answered
>
> Jan Blechta proposed the following answer:
> On Thu, 04 Apr 2013 05:51:19 -0000
> Nguyen Van Dang <email address hidden> wrote:
> > Question #225438 on FEniCS Project changed:
> > https://answers.launchpad.net/fenics/+question/225438
> >
> > Status: Answered => Open
> >
> > Nguyen Van Dang is still having a problem:
> > Dear Jan,
> > I skipped all installed packages and tried again but I still failed.
> > Moreover, I did not find out the directory serial-meshes
> > in /home/dang1032170/Work/FEniCS/src/. Best regards, Found
> > configuration for project FEniCS. Skipping boost_1_51_0
> > Skipping armadillo-3.6.1
> > Skipping parmetis-4.0.2
> > Skipping CGAL-4.1
> > Skipping swig-2.0.3
> > Skipping trilinos-11.0.3-Source
> > Skipping petsc-3.3-p6
> > Skipping slepc-3.3-p3
> > Skipping scotch_6.0.0_esmumps
> > Skipping fiat-1.1
> > Skipping ufc-2.1.0
> > Skipping ufl-1.1.0
> > Skipping ffc-1.1.0
> > Skipping viper-1.0.0
> > Skipping instant-1.1.0
> > Fetching serial-meshes
> > ssh: connect to host bazaar.launchpad.net port 22: Connection refused
> > bzr: ERROR: Connection closed: Unexpected end of message. Please
> > check connectivity and permissions, and report a bug if problems
> > persist. Failure with exit status: 3 Exit message: Error fetching
> > serial-meshes.
> >
>
> Did you tell to bzr your own launchpad login?
> bzr launchpad-login dang-1032170
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/225438/+confirm?answer_id=24
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/225438
>
> You received this question notification because you asked the question.
>

--
Nguyen Van Dang
Hand phone: +33751354339
Home Tel: +84792213628

Jan Blechta (blechta) said : #27

On Thu, 04 Apr 2013 12:21:09 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Yes, I did but I still got the errors.

It seems like a problem with your ssh.

Are you able to do in some temp dir
branch lp:dolfin
and
branch lp:~blechta/dolfin/serial-meshes
?

>
>
> On Thu, Apr 4, 2013 at 1:26 PM, Jan Blechta <
> <email address hidden>> wrote:
>
> > Your question #225438 on FEniCS Project changed:
> > https://answers.launchpad.net/fenics/+question/225438
> >
> > Status: Open => Answered
> >
> > Jan Blechta proposed the following answer:
> > On Thu, 04 Apr 2013 05:51:19 -0000
> > Nguyen Van Dang <email address hidden> wrote:
> > > Question #225438 on FEniCS Project changed:
> > > https://answers.launchpad.net/fenics/+question/225438
> > >
> > > Status: Answered => Open
> > >
> > > Nguyen Van Dang is still having a problem:
> > > Dear Jan,
> > > I skipped all installed packages and tried again but I still
> > > failed. Moreover, I did not find out the directory serial-meshes
> > > in /home/dang1032170/Work/FEniCS/src/. Best regards, Found
> > > configuration for project FEniCS. Skipping boost_1_51_0
> > > Skipping armadillo-3.6.1
> > > Skipping parmetis-4.0.2
> > > Skipping CGAL-4.1
> > > Skipping swig-2.0.3
> > > Skipping trilinos-11.0.3-Source
> > > Skipping petsc-3.3-p6
> > > Skipping slepc-3.3-p3
> > > Skipping scotch_6.0.0_esmumps
> > > Skipping fiat-1.1
> > > Skipping ufc-2.1.0
> > > Skipping ufl-1.1.0
> > > Skipping ffc-1.1.0
> > > Skipping viper-1.0.0
> > > Skipping instant-1.1.0
> > > Fetching serial-meshes
> > > ssh: connect to host bazaar.launchpad.net port 22: Connection
> > > refused bzr: ERROR: Connection closed: Unexpected end of message.
> > > Please check connectivity and permissions, and report a bug if
> > > problems persist. Failure with exit status: 3 Exit message: Error
> > > fetching serial-meshes.
> > >
> >
> > Did you tell to bzr your own launchpad login?
> > bzr launchpad-login dang-1032170
> >
> > --
> > If this answers your question, please go to the following page to
> > let us know that it is solved:
> > https://answers.launchpad.net/fenics/+question/225438/+confirm?answer_id=24
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https://answers.launchpad.net/fenics/+question/225438
> >
> > You received this question notification because you asked the
> > question.
> >
>
>

Dear Jan,
The problem of ssh was solved since I worked with another proxy. However, I could not finish the installation with following erros:

error: ‘smartarg1’ was not declared in this scope
make[2]: *** [dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/modulePYTHON_wrap.cxx.o] Error 1
make[2]: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
make[1]: *** [dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/all] Error 2
make[1]: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
make: *** [all] Error 2
make: Leaving directory `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'

Here are .log files I got from /home/dang1032170/Work/FEniCS/src/serial-meshes
https://transfert.inria.fr/fichiers/52a18b612998c79ce5883bb9bb428b4c/dorsal_build.log
https://transfert.inria.fr/fichiers/7d0b3fbf5c8e8aa11f361c5b6d7ea03a/dorsal_configure.log

Then, I set DOLFIN_ENABLE_CGAL:BOOL=OFF (in /home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir/CMakeCache.txt) and rebuilt: ./dorsal_build
but I still got the same errors.
Can you please help me again?
Thanks,
Best regards,
Dang

Jan Blechta (blechta) said : #29

On Fri, 05 Apr 2013 14:26:14 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> The problem of ssh was solved since I worked with another proxy.
> However, I could not finish the installation with following erros:
>
> error: ‘smartarg1’ was not declared in this scope
> make[2]: ***
> [dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/modulePYTHON_wrap.cxx.o]
> Error 1 make[2]: Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
> make[1]: *** [dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/all]
> Error 2 make[1]: Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
> make: *** [all] Error 2 make: Leaving directory
> `/home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir'
>
> Here are .log files I got
> from /home/dang1032170/Work/FEniCS/src/serial-meshes
> https://transfert.inria.fr/fichiers/52a18b612998c79ce5883bb9bb428b4c/dorsal_build.log
> https://transfert.inria.fr/fichiers/7d0b3fbf5c8e8aa11f361c5b6d7ea03a/dorsal_configure.log
>
> Then, I set DOLFIN_ENABLE_CGAL:BOOL=OFF
> (in /home/dang1032170/Work/FEniCS/src/serial-meshes/dorsal_build_dir/CMakeCache.txt)
> and rebuilt: ./dorsal_build but I still got the same errors. Can you
> please help me again? Thanks,
> Best regards,
> Dang
>

I don't know at the moment. But you are almost done - keep patiance.

Maybe SWIG expert Johan could know?

Jan

Hello,
I followed the instructions in INSTALL and README using
  cmake .
  make install
in directory
 /home/dang1032170/Work/FEniCS/src/serial-meshes
I could complete the installation:

DOLFIN has now been installed in
    /home/dang1032170/Work/FEniCS
and the demo programs have been installed in
    /home/dang1032170/Work/FEniCS/share/dolfin/demo
Before rushing off to try the demos, don't forget to update your
environment variables. This can be done easily using the helper file
'dolfin.conf' which sets the appropriate variables (for users of the
Bash shell).
To update your environment variables, run the following command:
    source /home/dang1032170/Work/FEniCS/share/dolfin/dolfin.conf
For future reference, we recommend that you add this command to your
configuration (.bashrc, .profile or similar).

I compiled a demo in /Work/FEniCS/share/dolfin/demo/pde/poisson/cpp
cmake . (succeeded)
make (with following error)
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `typeinfo for boost::program_options::error_with_option_name'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::program_options::error_with_option_name::what() const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::system::system_category()'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::filesystem::path::extension() const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::mpi::detail::packed_archive_recv(int, int, int, boost::mpi::packed_iarchive&, MPI_Status&)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::filesystem::path::parent_path() const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::filesystem::path::stem() const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::mpi::communicator::operator int() const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::system::generic_category()'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `vtable for boost::program_options::error_with_option_name'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::mpi::detail::mpi_datatype_map::set(std::type_info const*, int)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::program_options::detail::cmdline::get_canonical_option_prefix()'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::mpi::communicator::communicator(int const&, boost::mpi::comm_create_kind)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::mpi::detail::packed_archive_send(int, int, int, boost::mpi::packed_oarchive const&)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::filesystem::detail::create_directories(boost::filesystem::path const&, boost::system::error_code*)'
/home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
collect2: ld returned 1 exit status
make[2]: *** [demo_poisson] Error 1
make[1]: *** [CMakeFiles/demo_poisson.dir/all] Error 2
make: *** [all] Error 2
Can you please help me to fix it?
Thanks,
Best regards,
Dang

Jan Blechta (blechta) said : #31

On Tue, 09 Apr 2013 07:31:10 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Hello,
> I followed the instructions in INSTALL and README using
> cmake .
> make install
> in directory
> /home/dang1032170/Work/FEniCS/src/serial-meshes
> I could complete the installation:
>
> DOLFIN has now been installed in
> /home/dang1032170/Work/FEniCS
> and the demo programs have been installed in
> /home/dang1032170/Work/FEniCS/share/dolfin/demo
> Before rushing off to try the demos, don't forget to update your
> environment variables. This can be done easily using the helper file
> 'dolfin.conf' which sets the appropriate variables (for users of the
> Bash shell).
> To update your environment variables, run the following command:
> source /home/dang1032170/Work/FEniCS/share/dolfin/dolfin.conf
> For future reference, we recommend that you add this command to your
> configuration (.bashrc, .profile or similar).
>
> I compiled a demo in /Work/FEniCS/share/dolfin/demo/pde/poisson/cpp
> cmake . (succeeded)
> make (with following error)
> /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined reference
> to `typeinfo for
> boost::program_options::error_with_option_name' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to
> `boost::program_options::error_with_option_name::what()
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to
> `boost::filesystem::detail::status(boost::filesystem::path const&,
> boost::system::error_code*)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to
> `boost::system::system_category()' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to `boost::filesystem::path::extension()
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to
> `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to `boost::mpi::detail::packed_archive_recv(int,
> int, int, boost::mpi::packed_iarchive&,
> MPI_Status&)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to `boost::filesystem::path::parent_path()
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to `boost::filesystem::path::stem()
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to `boost::mpi::communicator::operator int()
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to
> `boost::system::generic_category()' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to
> `boost::program_options::error_with_option_name::substitute_placeholders(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&)
> const' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to `vtable for
> boost::program_options::error_with_option_name' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to
> `boost::mpi::detail::mpi_datatype_map::set(std::type_info const*,
> int)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to
> `boost::program_options::detail::cmdline::get_canonical_option_prefix()' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to `boost::mpi::communicator::communicator(int
> const&,
> boost::mpi::comm_create_kind)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to `boost::mpi::detail::packed_archive_send(int,
> int, int, boost::mpi::packed_oarchive
> const&)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so: undefined
> reference to
> `boost::filesystem::detail::create_directories(boost::filesystem::path
> const&,
> boost::system::error_code*)' /home/dang1032170/Work/FEniCS/lib/libdolfin.so:
> undefined reference to
> `boost::program_options::error_with_option_name::error_with_option_name(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&,
> std::basic_string<char, std::char_traits<char>, std::allocator<char>
> > const&, std::basic_string<char, std::char_traits<char>,
> > std::allocator<char> > const&, int)' collect2: ld returned 1 exit
> > status make[2]: *** [demo_poisson] Error 1 make[1]: ***
> > [CMakeFiles/demo_poisson.dir/all] Error 2 make: *** [all] Error 2
> > Can you please help me to fix it? Thanks, Best regards, Dang
>

That seems like problem with finding boost library when linking
executable. You need to have set LD_LIBRARY_PATH with all appropriate
dependencies. Try
  ldd /home/dang1032170/Work/FEniCS/lib/libdolfin.so
to check if all dependencies are found.

Jan

Dear Jan,
That command gives
dang1032170@ubuntu:~$ ldd /home/dang1032170/Work/FEniCS/lib/libdolfin.so
 linux-gate.so.1 => (0x005d4000)
 libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0012e000)
 libarmadillo.so.3 => not found
 liblapack.so.3gf => /usr/lib/atlas/liblapack.so.3gf (0x00cfd000)
 libcblas.so.3gf => /usr/lib/libcblas.so.3gf (0x00259000)
 libf77blas.so.3gf => /usr/lib/libf77blas.so.3gf (0x0027a000)
 libatlas.so.3gf => /usr/lib/libatlas.so.3gf (0x00297000)
 libboost_filesystem.so.1.42.0 => /usr/lib/libboost_filesystem.so.1.42.0 (0x005d5000)
 libboost_program_options.so.1.42.0 => /usr/lib/libboost_program_options.so.1.42.0 (0x005e9000)
 libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0 (0x005c9000)
 libboost_thread.so.1.42.0 => /usr/lib/libboost_thread.so.1.42.0 (0x0063d000)
 libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0x00651000)
 libboost_math_tr1.so.1.42.0 => /usr/lib/libboost_math_tr1.so.1.42.0 (0x0066b000)
 libboost_mpi.so.1.42.0 => /usr/lib/libboost_mpi.so.1.42.0 (0x006b1000)
 libboost_serialization.so.1.42.0 => /usr/lib/libboost_serialization.so.1.42.0 (0x006eb000)
 libml.so => not found
 libgaleri-xpetra.so => not found
 libgaleri.so => not found
 libisorropia.so => not found
 libtpetraext.so => not found
 libtpetrainout.so => not found
 libtpetra.so => not found
 libzoltan.so => not found
 libkokkosdisttsqr.so => not found
 libkokkosnodetsqr.so => not found
 libkokkoslinalg.so => not found
 libkokkosnodeapi.so => not found
 libkokkos.so => not found
 libtpi.so => not found
 libifpack.so => not found
 libaztecoo.so => not found
 libamesos.so => not found
 libepetraext.so => not found
 libtriutils.so => not found
 libepetra.so => not found
 libteuchos.so => not found
 libslepc.so => /usr/lib/libslepc.so (0x0075d000)
 libpetsc.so => /usr/lib/libpetsc.so (0x1f3fb000)
 libumfpack.so.5.4.0 => /usr/lib/libumfpack.so.5.4.0 (0x03387000)
 libamd.so.2.2.0 => /usr/lib/libamd.so.2.2.0 (0x007cb000)
 libcholmod.so.1.7.1 => /usr/lib/libcholmod.so.1.7.1 (0x06cd0000)
 libcamd.so.2.2.0 => /usr/lib/libcamd.so.2.2.0 (0x16e8a000)
 libcolamd.so.2.7.1 => /usr/lib/libcolamd.so.2.7.1 (0x09f8f000)
 libccolamd.so.2.7.1 => /usr/lib/libccolamd.so.2.7.1 (0x126c9000)
 libparmetis.so => /usr/lib/libparmetis.so (0x0898f000)
 libmetis.so => /usr/lib/libmetis.so (0x17b5f000)
 libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x0f6f1000)
 libz.so.1 => /lib/libz.so.1 (0x1d45a000)
 libcppunit-1.12.so.1 => /usr/lib/libcppunit-1.12.so.1 (0x108b1000)
 libmpichcxx.so.1.2 => /usr/lib/libmpichcxx.so.1.2 (0x1b10a000)
 libmpich.so.1.2 => /usr/lib/libmpich.so.1.2 (0x1c001000)
 libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x1639a000)
 librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x10979000)
 libvtkCommon.so.5.2 => /usr/lib/libvtkCommon.so.5.2 (0x0fcd6000)
 libvtkFiltering.so.5.2 => /usr/lib/libvtkFiltering.so.5.2 (0x186e8000)
 libvtkImaging.so.5.2 => /usr/lib/libvtkImaging.so.5.2 (0x07567000)
 libvtkGraphics.so.5.2 => /usr/lib/libvtkGraphics.so.5.2 (0x054c4000)
 libvtkGenericFiltering.so.5.2 => /usr/lib/libvtkGenericFiltering.so.5.2 (0x1abc2000)
 libvtkIO.so.5.2 => /usr/lib/libvtkIO.so.5.2 (0x0f7bd000)
 libvtkRendering.so.5.2 => /usr/lib/libvtkRendering.so.5.2 (0x17392000)
 libvtkVolumeRendering.so.5.2 => /usr/lib/libvtkVolumeRendering.so.5.2 (0x0d3fe000)
 libvtkHybrid.so.5.2 => /usr/lib/libvtkHybrid.so.5.2 (0x12e92000)
 libvtkWidgets.so.5.2 => /usr/lib/libvtkWidgets.so.5.2 (0x1df28000)
 libvtkParallel.so.5.2 => /usr/lib/libvtkParallel.so.5.2 (0x01523000)
 libvtkInfovis.so.5.2 => /usr/lib/libvtkInfovis.so.5.2 (0x166a9000)
 libvtkViews.so.5.2 => /usr/lib/libvtkViews.so.5.2 (0x02aea000)
 libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x1fe14000)
 libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x104c4000)
 libgomp.so.1 => /usr/lib/libgomp.so.1 (0x106ee000)
 libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0409d000)
 libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x13768000)
 libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x005ce000)
 libblas.so.3gf => /usr/lib/atlas/libblas.so.3gf (0x1d7d6000)
 libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x14695000)
 libmpi.so.0 => /usr/lib/libmpi.so.0 (0x0c1bb000)
 libmpi_cxx.so.0 => /usr/lib/libmpi_cxx.so.0 (0x03914000)
 libnsl.so.1 => /lib/tls/i686/cmov/libnsl.so.1 (0x1206f000)
 libopen-pal.so.0 => /usr/lib/libopen-pal.so.0 (0x1b6e2000)
 libopen-rte.so.0 => /usr/lib/libopen-rte.so.0 (0x1e6bc000)
 libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0x007d4000)
 libX11.so.6 => /usr/lib/libX11.so.6 (0x169ee000)
 libspooles.so.2.2 => /usr/lib/libspooles.so.2.2 (0x0169d000)
 libHYPRE-2.4.0.so => /usr/lib/libHYPRE-2.4.0.so (0x007d8000)
 libsuperlu.so.3 => /usr/lib/libsuperlu.so.3 (0x1599c000)
 libmpi_f90.so.0 => /usr/lib/libmpi_f90.so.0 (0x0c292000)
 libmpi_f77.so.0 => /usr/lib/libmpi_f77.so.0 (0x11be1000)
 libscotch-5.1.so => /usr/lib/libscotch-5.1.so (0x20034000)
 libparpack.so.2 => /usr/lib/libparpack.so.2 (0x084a3000)
 libarpack.so.2 => /usr/lib/libarpack.so.2 (0x10e20000)
 libpetscksp.so.3.0.0 => /usr/lib/libpetscksp.so.3.0.0 (0x02622000)
 libpetscdm.so.3.0.0 => /usr/lib/libpetscdm.so.3.0.0 (0x1a959000)
 libpetscmat.so.3.0.0 => /usr/lib/libpetscmat.so.3.0.0 (0x17868000)
 libpetscvec.so.3.0.0 => /usr/lib/libpetscvec.so.3.0.0 (0x0d989000)
 /lib/ld-linux.so.2 (0x00111000)
 libvtksys.so.5.2 => /usr/lib/libvtksys.so.5.2 (0x10d17000)
 libvtkverdict.so.5.2 => /usr/lib/libvtkverdict.so.5.2 (0x183c4000)
 libmysqlclient.so.16 => /usr/lib/libmysqlclient.so.16 (0x017f0000)
 libvtkDICOMParser.so.5.2 => /usr/lib/libvtkDICOMParser.so.5.2 (0x01a18000)
 libvtkNetCDF.so.5.2 => /usr/lib/libvtkNetCDF.so.5.2 (0x01ed2000)
 libvtkmetaio.so.5.2 => /usr/lib/libvtkmetaio.so.5.2 (0x01a31000)
 libvtksqlite.so.5.2 => /usr/lib/libvtksqlite.so.5.2 (0x0e2b7000)
 libpng12.so.0 => /lib/libpng12.so.0 (0x019e0000)
 libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x1ee62000)
 libtiff.so.4 => /usr/lib/libtiff.so.4 (0x215cc000)
 libexpat.so.1 => /lib/libexpat.so.1 (0x0c50e000)
 libavcodec.so.52 => /usr/lib/i686/cmov/libavcodec.so.52 (0x0b3f1000)
 libavformat.so.52 => /usr/lib/i686/cmov/libavformat.so.52 (0x0b266000)
 libavutil.so.49 => /usr/lib/i686/cmov/libavutil.so.49 (0x1a173000)
 libswscale.so.0 => /usr/lib/i686/cmov/libswscale.so.0 (0x1209f000)
 libvtkftgl.so.5.2 => /usr/lib/libvtkftgl.so.5.2 (0x1245a000)
 libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x0f31e000)
 libgl2ps.so.0 => /usr/lib/libgl2ps.so.0 (0x16d24000)
 libGL.so.1 => /usr/lib/mesa/libGL.so.1 (0x1d096000)
 libXt.so.6 => /usr/lib/libXt.so.6 (0x01ab8000)
 libSM.so.6 => /usr/lib/libSM.so.6 (0x18cdb000)
 libICE.so.6 => /usr/lib/libICE.so.6 (0x0a4d4000)
 libXext.so.6 => /usr/lib/libXext.so.6 (0x122c6000)
 libXss.so.1 => /usr/lib/libXss.so.1 (0x20412000)
 libXft.so.2 => /usr/lib/libXft.so.2 (0x1f694000)
 libvtkexoIIc.so.5.2 => /usr/lib/libvtkexoIIc.so.5.2 (0x01b0b000)
 libxcb.so.1 => /usr/lib/libxcb.so.1 (0x01b5b000)
 libHYPRE_utilities-2.4.0.so => /usr/lib/libHYPRE_utilities-2.4.0.so (0x19ad8000)
 libHYPRE_multivector-2.4.0.so => /usr/lib/libHYPRE_multivector-2.4.0.so (0x070a9000)
 libHYPRE_krylov-2.4.0.so => /usr/lib/libHYPRE_krylov-2.4.0.so (0x04136000)
 libHYPRE_struct_mv-2.4.0.so => /usr/lib/libHYPRE_struct_mv-2.4.0.so (0x0738c000)
 libHYPRE_struct_ls-2.4.0.so => /usr/lib/libHYPRE_struct_ls-2.4.0.so (0x17f32000)
 libHYPRE_sstruct_mv-2.4.0.so => /usr/lib/libHYPRE_sstruct_mv-2.4.0.so (0x09cb3000)
 libHYPRE_sstruct_ls-2.4.0.so => /usr/lib/libHYPRE_sstruct_ls-2.4.0.so (0x01b75000)
 libHYPRE_seq_mv-2.4.0.so => /usr/lib/libHYPRE_seq_mv-2.4.0.so (0x199fd000)
 libHYPRE_parcsr_mv-2.4.0.so => /usr/lib/libHYPRE_parcsr_mv-2.4.0.so (0x12036000)
 libHYPRE_parcsr_block_mv-2.4.0.so => /usr/lib/libHYPRE_parcsr_block_mv-2.4.0.so (0x1e328000)
 libHYPRE_DistributedMatrix-2.4.0.so => /usr/lib/libHYPRE_DistributedMatrix-2.4.0.so (0x06031000)
 libHYPRE_MatrixMatrix-2.4.0.so => /usr/lib/libHYPRE_MatrixMatrix-2.4.0.so (0x03bde000)
 libHYPRE_IJ_mv-2.4.0.so => /usr/lib/libHYPRE_IJ_mv-2.4.0.so (0x0cceb000)
 libHYPRE_Euclid-2.4.0.so => /usr/lib/libHYPRE_Euclid-2.4.0.so (0x07297000)
 libHYPRE_ParaSails-2.4.0.so => /usr/lib/libHYPRE_ParaSails-2.4.0.so (0x1ba4e000)
 libHYPRE_DistributedMatrixPilutSolver-2.4.0.so => /usr/lib/libHYPRE_DistributedMatrixPilutSolver-2.4.0.so (0x199a0000)
 libHYPRE_parcsr_ls-2.4.0.so => /usr/lib/libHYPRE_parcsr_ls-2.4.0.so (0x1caa7000)
 libHYPRE_FEI_fgmres-2.4.0.so => /usr/lib/libHYPRE_FEI_fgmres-2.4.0.so (0x0c93b000)
 libHYPRE_mli-2.4.0.so => /usr/lib/libHYPRE_mli-2.4.0.so (0x1333f000)
 libHYPRE_FEI-2.4.0.so => /usr/lib/libHYPRE_FEI-2.4.0.so (0x135e8000)
 libscotcherr-5.1.so => /usr/lib/libscotcherr-5.1.so (0x0b083000)
 libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0x09d69000)
 libgsm.so.1 => /usr/lib/libgsm.so.1 (0x01a05000)
 libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0 (0x20a33000)
 libspeex.so.1 => /usr/lib/sse2/libspeex.so.1 (0x0dc63000)
 libtheora.so.0 => /usr/lib/libtheora.so.0 (0x01bd4000)
 libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x0c5c8000)
 libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x1d0fe000)
 libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x09558000)
 libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x01a13000)
 libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x1cebf000)
 libdrm.so.2 => /lib/libdrm.so.2 (0x0493d000)
 libuuid.so.1 => /lib/libuuid.so.1 (0x0d370000)
 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x1d797000)
 libXrender.so.1 => /usr/lib/libXrender.so.1 (0x0f096000)
 libXau.so.6 => /usr/lib/libXau.so.6 (0x1d6ff000)
 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x123cd000)
 liboil-0.3.so.0 => /usr/lib/liboil-0.3.so.0 (0x1b900000)
 libogg.so.0 => /usr/lib/libogg.so.0 (0x0e584000)
What can I do? Thanks

Jan Blechta (blechta) said : #33

On Tue, 09 Apr 2013 09:11:16 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> That command gives
> dang1032170@ubuntu:~$
> ldd /home/dang1032170/Work/FEniCS/lib/libdolfin.so linux-gate.so.1
> => (0x005d4000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0012e000)
> libarmadillo.so.3 => not found
> liblapack.so.3gf => /usr/lib/atlas/liblapack.so.3gf
> (0x00cfd000) libcblas.so.3gf => /usr/lib/libcblas.so.3gf (0x00259000)
> libf77blas.so.3gf => /usr/lib/libf77blas.so.3gf (0x0027a000)
> libatlas.so.3gf => /usr/lib/libatlas.so.3gf (0x00297000)
> libboost_filesystem.so.1.42.0
> => /usr/lib/libboost_filesystem.so.1.42.0 (0x005d5000)
> libboost_program_options.so.1.42.0
> => /usr/lib/libboost_program_options.so.1.42.0 (0x005e9000)
> libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0
> (0x005c9000) libboost_thread.so.1.42.0
> => /usr/lib/libboost_thread.so.1.42.0 (0x0063d000)
> libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0
> (0x00651000) libboost_math_tr1.so.1.42.0
> => /usr/lib/libboost_math_tr1.so.1.42.0 (0x0066b000)
> libboost_mpi.so.1.42.0 => /usr/lib/libboost_mpi.so.1.42.0
> (0x006b1000) libboost_serialization.so.1.42.0
> => /usr/lib/libboost_serialization.so.1.42.0 (0x006eb000) libml.so =>
> not found libgaleri-xpetra.so => not found libgaleri.so => not found
> libisorropia.so => not found libtpetraext.so => not found
> libtpetrainout.so => not found libtpetra.so => not found libzoltan.so
> => not found libkokkosdisttsqr.so => not found
> libkokkosnodetsqr.so => not found
> libkokkoslinalg.so => not found
> libkokkosnodeapi.so => not found
> libkokkos.so => not found
> libtpi.so => not found
> libifpack.so => not found
> libaztecoo.so => not found
> libamesos.so => not found
> libepetraext.so => not found
> libtriutils.so => not found
> libepetra.so => not found
> libteuchos.so => not found
> libslepc.so => /usr/lib/libslepc.so (0x0075d000)
> libpetsc.so => /usr/lib/libpetsc.so (0x1f3fb000)
> libumfpack.so.5.4.0 => /usr/lib/libumfpack.so.5.4.0
> (0x03387000) libamd.so.2.2.0 => /usr/lib/libamd.so.2.2.0 (0x007cb000)
> libcholmod.so.1.7.1 => /usr/lib/libcholmod.so.1.7.1
> (0x06cd0000) libcamd.so.2.2.0 => /usr/lib/libcamd.so.2.2.0
> (0x16e8a000) libcolamd.so.2.7.1 => /usr/lib/libcolamd.so.2.7.1
> (0x09f8f000) libccolamd.so.2.7.1 => /usr/lib/libccolamd.so.2.7.1
> (0x126c9000) libparmetis.so => /usr/lib/libparmetis.so (0x0898f000)
> libmetis.so => /usr/lib/libmetis.so (0x17b5f000)
> libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x0f6f1000)
> libz.so.1 => /lib/libz.so.1 (0x1d45a000)
> libcppunit-1.12.so.1 => /usr/lib/libcppunit-1.12.so.1
> (0x108b1000) libmpichcxx.so.1.2 => /usr/lib/libmpichcxx.so.1.2
> (0x1b10a000) libmpich.so.1.2 => /usr/lib/libmpich.so.1.2 (0x1c001000)
> libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0
> (0x1639a000) librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x10979000)
> libvtkCommon.so.5.2 => /usr/lib/libvtkCommon.so.5.2
> (0x0fcd6000) libvtkFiltering.so.5.2
> => /usr/lib/libvtkFiltering.so.5.2 (0x186e8000) libvtkImaging.so.5.2
> => /usr/lib/libvtkImaging.so.5.2 (0x07567000) libvtkGraphics.so.5.2
> => /usr/lib/libvtkGraphics.so.5.2 (0x054c4000)
> libvtkGenericFiltering.so.5.2
> => /usr/lib/libvtkGenericFiltering.so.5.2 (0x1abc2000)
> libvtkIO.so.5.2 => /usr/lib/libvtkIO.so.5.2 (0x0f7bd000)
> libvtkRendering.so.5.2 => /usr/lib/libvtkRendering.so.5.2
> (0x17392000) libvtkVolumeRendering.so.5.2
> => /usr/lib/libvtkVolumeRendering.so.5.2 (0x0d3fe000)
> libvtkHybrid.so.5.2 => /usr/lib/libvtkHybrid.so.5.2 (0x12e92000)
> libvtkWidgets.so.5.2 => /usr/lib/libvtkWidgets.so.5.2 (0x1df28000)
> libvtkParallel.so.5.2 => /usr/lib/libvtkParallel.so.5.2 (0x01523000)
> libvtkInfovis.so.5.2 => /usr/lib/libvtkInfovis.so.5.2 (0x166a9000)
> libvtkViews.so.5.2 => /usr/lib/libvtkViews.so.5.2 (0x02aea000)
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x1fe14000) libm.so.6
> => /lib/tls/i686/cmov/libm.so.6 (0x104c4000) libgomp.so.1
> => /usr/lib/libgomp.so.1 (0x106ee000) libgcc_s.so.1
> => /lib/libgcc_s.so.1 (0x0409d000) libc.so.6
> => /lib/tls/i686/cmov/libc.so.6 (0x13768000) libdl.so.2
> => /lib/tls/i686/cmov/libdl.so.2 (0x005ce000) libblas.so.3gf
> => /usr/lib/atlas/libblas.so.3gf (0x1d7d6000) libbz2.so.1.0
> => /lib/libbz2.so.1.0 (0x14695000) libmpi.so.0
> => /usr/lib/libmpi.so.0 (0x0c1bb000) libmpi_cxx.so.0
> => /usr/lib/libmpi_cxx.so.0 (0x03914000) libnsl.so.1
> => /lib/tls/i686/cmov/libnsl.so.1 (0x1206f000) libopen-pal.so.0
> => /usr/lib/libopen-pal.so.0 (0x1b6e2000) libopen-rte.so.0
> => /usr/lib/libopen-rte.so.0 (0x1e6bc000) libutil.so.1
> => /lib/tls/i686/cmov/libutil.so.1 (0x007d4000) libX11.so.6
> => /usr/lib/libX11.so.6 (0x169ee000) libspooles.so.2.2
> => /usr/lib/libspooles.so.2.2 (0x0169d000) libHYPRE-2.4.0.so
> => /usr/lib/libHYPRE-2.4.0.so (0x007d8000) libsuperlu.so.3
> => /usr/lib/libsuperlu.so.3 (0x1599c000) libmpi_f90.so.0
> => /usr/lib/libmpi_f90.so.0 (0x0c292000) libmpi_f77.so.0
> => /usr/lib/libmpi_f77.so.0 (0x11be1000) libscotch-5.1.so
> => /usr/lib/libscotch-5.1.so (0x20034000) libparpack.so.2
> => /usr/lib/libparpack.so.2 (0x084a3000) libarpack.so.2
> => /usr/lib/libarpack.so.2 (0x10e20000) libpetscksp.so.3.0.0
> => /usr/lib/libpetscksp.so.3.0.0 (0x02622000) libpetscdm.so.3.0.0
> => /usr/lib/libpetscdm.so.3.0.0 (0x1a959000) libpetscmat.so.3.0.0
> => /usr/lib/libpetscmat.so.3.0.0 (0x17868000) libpetscvec.so.3.0.0
> => /usr/lib/libpetscvec.so.3.0.0 (0x0d989000) /lib/ld-linux.so.2
> (0x00111000) libvtksys.so.5.2 => /usr/lib/libvtksys.so.5.2
> (0x10d17000) libvtkverdict.so.5.2 => /usr/lib/libvtkverdict.so.5.2
> (0x183c4000) libmysqlclient.so.16 => /usr/lib/libmysqlclient.so.16
> (0x017f0000) libvtkDICOMParser.so.5.2
> => /usr/lib/libvtkDICOMParser.so.5.2 (0x01a18000) libvtkNetCDF.so.5.2
> => /usr/lib/libvtkNetCDF.so.5.2 (0x01ed2000) libvtkmetaio.so.5.2
> => /usr/lib/libvtkmetaio.so.5.2 (0x01a31000) libvtksqlite.so.5.2
> => /usr/lib/libvtksqlite.so.5.2 (0x0e2b7000) libpng12.so.0
> => /lib/libpng12.so.0 (0x019e0000) libjpeg.so.62
> => /usr/lib/libjpeg.so.62 (0x1ee62000) libtiff.so.4
> => /usr/lib/libtiff.so.4 (0x215cc000) libexpat.so.1
> => /lib/libexpat.so.1 (0x0c50e000) libavcodec.so.52
> => /usr/lib/i686/cmov/libavcodec.so.52 (0x0b3f1000) libavformat.so.52
> => /usr/lib/i686/cmov/libavformat.so.52 (0x0b266000) libavutil.so.49
> => /usr/lib/i686/cmov/libavutil.so.49 (0x1a173000) libswscale.so.0
> => /usr/lib/i686/cmov/libswscale.so.0 (0x1209f000) libvtkftgl.so.5.2
> => /usr/lib/libvtkftgl.so.5.2 (0x1245a000) libfreetype.so.6
> => /usr/lib/libfreetype.so.6 (0x0f31e000) libgl2ps.so.0
> => /usr/lib/libgl2ps.so.0 (0x16d24000) libGL.so.1
> => /usr/lib/mesa/libGL.so.1 (0x1d096000) libXt.so.6
> => /usr/lib/libXt.so.6 (0x01ab8000) libSM.so.6 => /usr/lib/libSM.so.6
> (0x18cdb000) libICE.so.6 => /usr/lib/libICE.so.6 (0x0a4d4000)
> libXext.so.6 => /usr/lib/libXext.so.6 (0x122c6000) libXss.so.1
> => /usr/lib/libXss.so.1 (0x20412000) libXft.so.2
> => /usr/lib/libXft.so.2 (0x1f694000) libvtkexoIIc.so.5.2
> => /usr/lib/libvtkexoIIc.so.5.2 (0x01b0b000) libxcb.so.1
> => /usr/lib/libxcb.so.1 (0x01b5b000) libHYPRE_utilities-2.4.0.so
> => /usr/lib/libHYPRE_utilities-2.4.0.so (0x19ad8000)
> libHYPRE_multivector-2.4.0.so
> => /usr/lib/libHYPRE_multivector-2.4.0.so (0x070a9000)
> libHYPRE_krylov-2.4.0.so => /usr/lib/libHYPRE_krylov-2.4.0.so
> (0x04136000) libHYPRE_struct_mv-2.4.0.so
> => /usr/lib/libHYPRE_struct_mv-2.4.0.so (0x0738c000)
> libHYPRE_struct_ls-2.4.0.so => /usr/lib/libHYPRE_struct_ls-2.4.0.so
> (0x17f32000) libHYPRE_sstruct_mv-2.4.0.so
> => /usr/lib/libHYPRE_sstruct_mv-2.4.0.so (0x09cb3000)
> libHYPRE_sstruct_ls-2.4.0.so => /usr/lib/libHYPRE_sstruct_ls-2.4.0.so
> (0x01b75000) libHYPRE_seq_mv-2.4.0.so
> => /usr/lib/libHYPRE_seq_mv-2.4.0.so (0x199fd000)
> libHYPRE_parcsr_mv-2.4.0.so => /usr/lib/libHYPRE_parcsr_mv-2.4.0.so
> (0x12036000) libHYPRE_parcsr_block_mv-2.4.0.so
> => /usr/lib/libHYPRE_parcsr_block_mv-2.4.0.so (0x1e328000)
> libHYPRE_DistributedMatrix-2.4.0.so
> => /usr/lib/libHYPRE_DistributedMatrix-2.4.0.so (0x06031000)
> libHYPRE_MatrixMatrix-2.4.0.so
> => /usr/lib/libHYPRE_MatrixMatrix-2.4.0.so (0x03bde000)
> libHYPRE_IJ_mv-2.4.0.so => /usr/lib/libHYPRE_IJ_mv-2.4.0.so
> (0x0cceb000) libHYPRE_Euclid-2.4.0.so
> => /usr/lib/libHYPRE_Euclid-2.4.0.so (0x07297000)
> libHYPRE_ParaSails-2.4.0.so => /usr/lib/libHYPRE_ParaSails-2.4.0.so
> (0x1ba4e000) libHYPRE_DistributedMatrixPilutSolver-2.4.0.so
> => /usr/lib/libHYPRE_DistributedMatrixPilutSolver-2.4.0.so
> (0x199a0000) libHYPRE_parcsr_ls-2.4.0.so
> => /usr/lib/libHYPRE_parcsr_ls-2.4.0.so (0x1caa7000)
> libHYPRE_FEI_fgmres-2.4.0.so => /usr/lib/libHYPRE_FEI_fgmres-2.4.0.so
> (0x0c93b000) libHYPRE_mli-2.4.0.so => /usr/lib/libHYPRE_mli-2.4.0.so
> (0x1333f000) libHYPRE_FEI-2.4.0.so => /usr/lib/libHYPRE_FEI-2.4.0.so
> (0x135e8000) libscotcherr-5.1.so => /usr/lib/libscotcherr-5.1.so
> (0x0b083000) libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1
> (0x09d69000) libgsm.so.1 => /usr/lib/libgsm.so.1 (0x01a05000)
> libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0
> (0x20a33000) libspeex.so.1 => /usr/lib/sse2/libspeex.so.1
> (0x0dc63000) libtheora.so.0 => /usr/lib/libtheora.so.0 (0x01bd4000)
> libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x0c5c8000)
> libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x1d0fe000)
> libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x09558000)
> libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x01a13000)
> libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x1cebf000) libdrm.so.2
> => /lib/libdrm.so.2 (0x0493d000) libuuid.so.1 => /lib/libuuid.so.1
> (0x0d370000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1
> (0x1d797000) libXrender.so.1 => /usr/lib/libXrender.so.1 (0x0f096000)
> libXau.so.6 => /usr/lib/libXau.so.6 (0x1d6ff000) libXdmcp.so.6
> => /usr/lib/libXdmcp.so.6 (0x123cd000) liboil-0.3.so.0
> => /usr/lib/liboil-0.3.so.0 (0x1b900000) libogg.so.0
> => /usr/lib/libogg.so.0 (0x0e584000) What can I do? Thanks
>

Paths to all libraries which are 'not found' have to be added to
LD_LIBRARY_PATH environment variable when linking program using dolfin.
I don't how did you install these libraries and what is a default way
to set paths in your system. Perhaps some paths can be set by module
package and some must be set manually. For example I add
  module load scientific boost petsc armadillo
  module unload numpy
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/fenics/fenics-1.1.0/lib:~/fenics/fenics-1.1.0/lib/vtk-5.8
to the end of my fenics.conf to adjust paths.

But make sure that your fenics.conf contains everything from your
dolfin.conf as you finished installation of FEniCS by dorsal_build in
dolfin dir instead of dorsal.sh so fenics.conf was not generated.

Maybe you also need to set BOOST_DIR. You may find all paths manually
or use the ones from src/serial-meshes/dorsal_build_dir/CMakeCache.txt

Jan

Thanks Jan Blechta, that solved my question.

Hello,
It worked well on the python version with two files demo_serial-meshes_2.py and demo_serial-meshes.py
Then, I revised the content of poisson demo to test the parallel computing but I got some errors (see below).
Can you please help me?
Thanks a lot,
Dang

===========================C++==============================
#include <dolfin.h>
#include "Poisson.h"

using namespace dolfin;

// Source term (right-hand side)
class Source : public Expression
{
  void eval(Array<double>& values, const Array<double>& x) const
  {
    double dx = x[0] - 0.5;
    double dy = x[1] - 0.5;
    values[0] = 10*exp(-(dx*dx + dy*dy) / 0.02);
  }
};

// Normal derivative (Neumann boundary condition)
class dUdN : public Expression
{
  void eval(Array<double>& values, const Array<double>& x) const
  {
    values[0] = sin(5*x[0]);
  }
};

// Sub domain for Dirichlet boundary condition
class DirichletBoundary : public SubDomain
{
  bool inside(const Array<double>& x, bool on_boundary) const
  {
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS;
  }
};

int main()
{
  parameters["linear_algebra_backend"] = "PETSc";
  // Create mesh and function space
  UnitSquareMesh mesh(32, 32);
  Poisson::FunctionSpace V(mesh);

  // Define boundary condition
  Constant u0(0.0);
  DirichletBoundary boundary;
  DirichletBC bc(V, u0, boundary);

  // Define variational forms
  Poisson::BilinearForm a(V, V);
  Poisson::LinearForm L(V);

  Function u(V);
  int process_number = dolfin::MPI().process_number();
  int num_processes = dolfin::MPI().num_processes();
  std::cout<<"I am processor "<<process_number<<" of "<<num_processes<<" processes.\n";

  if (process_number == 0)
  {
 // Let dolfin believe that there is only one process
 parameters["pretend_one_process"] = true;

 Source f;
 dUdN g;
 L.f = f;
 L.g = g;

 // Compute solution
 solve(a == L, u, bc);

 // Save solution in VTK format
 File file("poisson.pvd");
 file << u;
 // Plot solution
 parameters["pretend_one_process"] = false;
  }

  if (process_number == 1)
  {
 // Let dolfin believe that there is only one process
 parameters["pretend_one_process"] = true;

 Constant zero(0);
 L.f = zero;
 L.g = zero;

 // Compute solution
 solve(a == L, u, bc);

 // Save solution in VTK format
 File file("poisson.pvd");
 file << u;
 // Plot solution
 parameters["pretend_one_process"] = false;

  }

  dolfin::MPI().barrier();
  //plot(u);
  //interactive();

  return 0;
}

====================Error====================================

dang@ubuntu:~/Documents/serial-meshes/cpp$ mpirun -np 2 ./demo_poisson
Process 0: Number of global vertices: 1089
Process 0: Number of global cells: 2048
I am processor 1 of 2 processes.
Solving linear variational problem.
I am processor 0 of 2 processes.
Process 0: Solving linear variational problem.
terminate called after throwing an instance of 'std::runtime_error'
  what():

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https://answers.launchpad.net/dolfin
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error: Unable to apply changes to sparsity pattern.
*** Reason: Received illegal sparsity pattern entry for row/column 42, not in range [521, 1089].
*** Where: This error was encountered inside SparsityPattern.cpp.
*** Process: 0
*** -------------------------------------------------------------------------

[ubuntu:07630] *** Process received signal ***
[ubuntu:07630] Signal: Aborted (6)
[ubuntu:07630] Signal code: (-6)
--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 7629 on node ubuntu exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------

Jan Blechta (blechta) said : #36

On Fri, 12 Apr 2013 20:36:06 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Solved => Open
>
> Nguyen Van Dang is still having a problem:
> Hello,
> It worked well on the python version with two files
> demo_serial-meshes_2.py and demo_serial-meshes.py Then, I revised the
> content of poisson demo to test the parallel computing but I got some
> errors (see below). Can you please help me? Thanks a lot,
> Dang
>
> ===========================C++==============================
> #include <dolfin.h>
> #include "Poisson.h"
>
> using namespace dolfin;
>
> // Source term (right-hand side)
> class Source : public Expression
> {
> void eval(Array<double>& values, const Array<double>& x) const
> {
> double dx = x[0] - 0.5;
> double dy = x[1] - 0.5;
> values[0] = 10*exp(-(dx*dx + dy*dy) / 0.02);
> }
> };
>
> // Normal derivative (Neumann boundary condition)
> class dUdN : public Expression
> {
> void eval(Array<double>& values, const Array<double>& x) const
> {
> values[0] = sin(5*x[0]);
> }
> };
>
> // Sub domain for Dirichlet boundary condition
> class DirichletBoundary : public SubDomain
> {
> bool inside(const Array<double>& x, bool on_boundary) const
> {
> return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS;
> }
> };
>
> int main()
> {
> parameters["linear_algebra_backend"] = "PETSc";
> // Create mesh and function space
> UnitSquareMesh mesh(32, 32);
> Poisson::FunctionSpace V(mesh);
>
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
>
> // Define variational forms
> Poisson::BilinearForm a(V, V);
> Poisson::LinearForm L(V);
>
> Function u(V);
> int process_number = dolfin::MPI().process_number();
> int num_processes = dolfin::MPI().num_processes();
> std::cout<<"I am processor "<<process_number<<" of
> "<<num_processes<<" processes.\n";
>
> if (process_number == 0)
> {
> // Let dolfin believe that there is only one process
> parameters["pretend_one_process"] = true;
>
> Source f;
> dUdN g;
> L.f = f;
> L.g = g;
>
> // Compute solution
> solve(a == L, u, bc);
>
> // Save solution in VTK format
> File file("poisson.pvd");
> file << u;
> // Plot solution
> parameters["pretend_one_process"] = false;
> }
>
> if (process_number == 1)
> {
> // Let dolfin believe that there is only one process
> parameters["pretend_one_process"] = true;
>
> Constant zero(0);
> L.f = zero;
> L.g = zero;
>
> // Compute solution
> solve(a == L, u, bc);
>
> // Save solution in VTK format
> File file("poisson.pvd");
> file << u;
> // Plot solution
> parameters["pretend_one_process"] = false;
>
> }
>
> dolfin::MPI().barrier();
> //plot(u);
> //interactive();
>
> return 0;
> }
>
> ====================Error====================================
>
> dang@ubuntu:~/Documents/serial-meshes/cpp$ mpirun -np
> 2 ./demo_poisson Process 0: Number of global vertices: 1089
> Process 0: Number of global cells: 2048
> I am processor 1 of 2 processes.
> Solving linear variational problem.
> I am processor 0 of 2 processes.
> Process 0: Solving linear variational problem.
> terminate called after throwing an instance of 'std::runtime_error'
> what():
>
> ***
> -------------------------------------------------------------------------
> *** DOLFIN encountered an error. If you are not able to resolve this
> issue *** using the information listed below, you can ask for help at
> *** *** https://answers.launchpad.net/dolfin
> ***
> *** Remember to include the error message listed below and, if
> possible, *** include a *minimal* running example to reproduce the
> error. ***
> ***
> -------------------------------------------------------------------------
> *** Error: Unable to apply changes to sparsity pattern. ***
> Reason: Received illegal sparsity pattern entry for row/column 42,
> not in range [521, 1089]. *** Where: This error was encountered
> inside SparsityPattern.cpp. *** Process: 0 ***
> -------------------------------------------------------------------------
>
> [ubuntu:07630] *** Process received signal ***
> [ubuntu:07630] Signal: Aborted (6)
> [ubuntu:07630] Signal code: (-6)
> --------------------------------------------------------------------------
> mpirun noticed that process rank 0 with PID 7629 on node ubuntu
> exited on signal 11 (Segmentation fault).
> --------------------------------------------------------------------------
>

Try moving
 parameters["pretend_one_process"] = true;
to the beginning to tell DOLFIN to initialize all objects
non-distributed.

Jan

Dear Jan,
It worked. However, when we set parameters["pretend_one_process"] = true at the beginning, we do not create parallel mesh, function space and functions but they are created multiple times. How to fix it?
Thanks,
Best regards,
Dang

Jan Blechta (blechta) said : #38

On Mon, 15 Apr 2013 12:46:14 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> It worked. However, when we set parameters["pretend_one_process"] =
> true at the beginning, we do not create parallel mesh, function space
> and functions but they are created multiple times. How to fix it?
> Thanks, Best regards, Dang
>

I don't understand. I thought you wanted to make multiple serial
meshes, function spaces, ... Could you write shortly what do you want
to do?

Jan

Dear Jan,
In fact, I would like to solve multiple linear systems using the same mesh, function space,...
Here is a simple example where I solve 2 linear systems using some common information (mesh, function space,..). So, I want to create the common information by just one process and one time. However, when I set parameters["pretend_one_process"]=true at the beginning, the common information was created multiple times by process 0 (if I understood correctly?)
Thanks,
Best regards,
Dang

// COMMON INFORMATION
  // Is it possible to create this information one time by 1 process?
    // Mesh and function space
    UnitSquareMesh mesh(32, 32);
    Poisson::FunctionSpace V(mesh);
    // Define boundary condition
    Constant u0(0.0);
    DirichletBoundary boundary;
    DirichletBC bc(V, u0, boundary);
   // Define variational forms
    Poisson::BilinearForm a(V, V);
    Poisson::LinearForm L(V);
    Function u1(V);
    Function u2(V);
    int process_number = dolfin::MPI().process_number();
    int num_processes = dolfin::MPI().num_processes();
// MANAGING 2 LINEAR SYSTEMS PARALLELY
  if (process_number == 0) // solve system 1 with process 0
  {
     // Let dolfin believe that there is only one process
     parameters["pretend_one_process"] = true;
     Source f;
     dUdN g;
     L.f = f;
     L.g = g;
     // Compute solution
     solve(a == L, u1, bc);
     parameters["pretend_one_process"] = false;
  }

  if (process_number == 1) // solve system 2 with process 1
  {
     // Let dolfin believe that there is only one process
    parameters["pretend_one_process"] = true;
    Constant zero(0);
    L.f = zero;
    L.g = zero;
    // Compute solution
    solve(a == L, u2, bc);
    parameters["pretend_one_process"] = false;
  }
  dolfin::MPI().barrier();
  return 0;
}

Jan Blechta (blechta) said : #40

On Mon, 15 Apr 2013 14:36:15 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> In fact, I would like to solve multiple linear systems using the same
> mesh, function space,... Here is a simple example where I solve 2
> linear systems using some common information (mesh, function
> space,..). So, I want to create the common information by just one
> process and one time. However, when I set
> parameters["pretend_one_process"]=true at the beginning, the common
> information was created multiple times by process 0 (if I understood
> correctly?) Thanks, Best regards, Dang

If you create Mesh when running in parallel mesh is partitioned and
each process holds some piece of underlying physical mesh. Same holds
also for objects arising from Mesh, i.e. FunctionSpace, Function, ...

If you set pretend_one_process each process does think it is run in
serial hence it does not partition mesh. Therefore each process (you
give it such an instruction) creates its own non-partitioned mesh. If
you do

parameters["pretend_one_process"] = true;
UnitSquareMesh mesh(32, 32);

every proccess creates its own serial mesh (they will be same). If you
do

if (process_number == 0)
{
  parameters["pretend_one_process"] = true;
  UnitSquareMesh mesh(32, 32);
}

Then only process 0 creates serial mesh and you could transfer it by
file or by MPI to other processes. This would be quite easy in python
where you just pickle Mesh object, send it by mpi4py and unpickle. I
don't know how to do that in C++. Or you can write mesh to file and
read it by other processes. But note that first option when mesh is
created by each proccess is probably preferable as it would have no
time advantage to create mesh by only one process and let other
processes waiting. Similiar considerations are valid for other DOLFIN
objects.

>
> // COMMON INFORMATION
> // Is it possible to create this information one time by 1 process?
> // Mesh and function space
> UnitSquareMesh mesh(32, 32);
> Poisson::FunctionSpace V(mesh);
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
> // Define variational forms
> Poisson::BilinearForm a(V, V);
> Poisson::LinearForm L(V);
> Function u1(V);
> Function u2(V);
> int process_number = dolfin::MPI().process_number();
> int num_processes = dolfin::MPI().num_processes();
> // MANAGING 2 LINEAR SYSTEMS PARALLELY
> if (process_number == 0) // solve system 1 with process 0
> {
> // Let dolfin believe that there is only one process
> parameters["pretend_one_process"] = true;
> Source f;
> dUdN g;
> L.f = f;
> L.g = g;
> // Compute solution
> solve(a == L, u1, bc);
> parameters["pretend_one_process"] = false;
> }
>
> if (process_number == 1) // solve system 2 with process 1
> {
> // Let dolfin believe that there is only one process
> parameters["pretend_one_process"] = true;
> Constant zero(0);
> L.f = zero;
> L.g = zero;
> // Compute solution
> solve(a == L, u2, bc);
> parameters["pretend_one_process"] = false;
> }
> dolfin::MPI().barrier();
> return 0;
> }
>

It seems for me that your parallel tasks are in no way coupled. You
should just then run many serial tasks. I don't see the point of
running them through MPI.

Jan

Dear Jan,
It seems that I have to use OpenMP instead. I knew that parameters["num_threads"]=num_threads can manage different parts of the mesh but it is not my case. I want to use a 'full' OpenMPI like pure C++. I encountered segmentation faut error with follwoing code.
  omp_set_num_threads(2);
  # pragma omp parallel
  {
     // Let dolfin believe that there is only one process
     parameters["pretend_one_process"] = true;
     Source f;
     dUdN g;
     L.f = f;
     L.g = g;
     // Compute solution
     solve(a == L, u1, bc);
     parameters["pretend_one_process"] = false;
  }

  # pragma omp parallel
  {
     // Let dolfin believe that there is only one process
    parameters["pretend_one_process"] = true;
    Constant zero(0);
    L.f = zero;
    L.g = zero;
    // Compute solution
    solve(a == L, u2, bc);
    parameters["pretend_one_process"] = false;
  }
Can you please give me some suggestions to solve this problem?
Thanks a lot,
Best regards,
Dang

Jan Blechta (blechta) said : #42

On Mon, 15 Apr 2013 17:01:32 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> It seems that I have to use OpenMP instead. I knew that
> parameters["num_threads"]=num_threads can manage different parts of
> the mesh but it is not my case. I want to use a 'full' OpenMPI like
> pure C++. I encountered segmentation faut error with follwoing code.
> omp_set_num_threads(2); # pragma omp parallel { // Let dolfin believe
> that there is only one process parameters["pretend_one_process"] =
> true; Source f;
> dUdN g;
> L.f = f;
> L.g = g;
> // Compute solution
> solve(a == L, u1, bc);
> parameters["pretend_one_process"] = false;
> }
>
> # pragma omp parallel
> {
> // Let dolfin believe that there is only one process
> parameters["pretend_one_process"] = true;
> Constant zero(0);
> L.f = zero;
> L.g = zero;
> // Compute solution
> solve(a == L, u2, bc);
> parameters["pretend_one_process"] = false;
> }
> Can you please give me some suggestions to solve this problem?
> Thanks a lot,
> Best regards,
> Dang
>

Dang, still I don't see the point of doing some parallel computations
if you have many uncoupled problems. Simply do many serial computations.

You don't need pretend_one_process functionality when running without
MPI parallelization. It has no meaning.

Regarding OpenMP, I'm not sure if DOLFIN can be used with explicit
OpenMP statements. Anders probably would know.

Jan

Dear Jan.
I have to find another solution. In fact, I need to solve some linear systems at each time step. After each time step, the data should be summarized once. So, serial computations are not very suitable in this case.
Thanks a lot for your help,
Best regards,
Dang

Dear Jan,
I am using your serial computations for another problem. Unfortunately, I encountered an error related to PETScMatrix. My code is following:

 // Create mesh and function space
 UnitSquareMesh mesh(500, 500);
 Poisson::FunctionSpace V(mesh);

 // Define variational forms
 Poisson::BilinearForm a(V, V);

 PETScMatrix M;
 assemble(M,a);

 std::vector<dolfin::la_index> columns(2);
 std::vector<double> values(2);
 dolfin::la_index master_row = 0;

 columns[0]=1;
 columns[0]=10;
 values[0]=10.0;
 values[0]=10.0;

 M.set(values.data(), 1, &master_row, columns.size(), columns.data());
 M.apply("add");

Errors:

[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Argument out of range!
[0]PETSC ERROR: New nonzero at (0,10) caused a malloc!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11 12:26:34 CST 2013
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Unknown Name on a linux-gnu named ubuntu by dang Thu Apr 18 11:53:37 2013
[0]PETSC ERROR: Libraries linked from /home/dang/Work/FEniCS/lib
[0]PETSC ERROR: Configure run at Thu Apr 11 08:38:04 2013
[0]PETSC ERROR: Configure options COPTFLAGS=-O2 --with-debugging=0 --with-shared-libraries=1 --with-clanguage=cxx --with-c-support=1 --download-umfpack=1 --download-hypre=1 --download-mumps=1 --download-scalapack=1 --download-blacs=1 --download-ptscotch=1 --download-scotch=1 --download-metis=1 --download-parmetis=1 --with-ml=1 --with-ml-lib=/home/dang/Work/FEniCS/lib/libml.so --with-ml-include=/home/dang/Work/FEniCS/include/trilinos --prefix=/home/dang/Work/FEniCS
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: MatSetValues_SeqAIJ() line 345 in /home/dang/Work/FEniCS/src/petsc-3.3-p6/src/mat/impls/aij/seq/aij.c
[0]PETSC ERROR: MatSetValues() line 1025 in /home/dang/Work/FEniCS/src/petsc-3.3-p6/src/mat/interface/matrix.c

I looked at https://bugs.launchpad.net/dolfin/+bug/1033611 but I could not find the solution for your serial computations. Can you please help me?
Thanks a lot,
Best regards,
Dang

Jan Blechta (blechta) said : #45

On Thu, 18 Apr 2013 18:41:35 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Solved => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I am using your serial computations for another problem.
> Unfortunately, I encountered an error related to PETScMatrix. My code
> is following:
>
> // Create mesh and function space
> UnitSquareMesh mesh(500, 500);
> Poisson::FunctionSpace V(mesh);
>
> // Define variational forms
> Poisson::BilinearForm a(V, V);
>
> PETScMatrix M;
> assemble(M,a);
>
>
> std::vector<dolfin::la_index> columns(2);
> std::vector<double> values(2);
> dolfin::la_index master_row = 0;
>
> columns[0]=1;
> columns[0]=10;
> values[0]=10.0;
> values[0]=10.0;
>
> M.set(values.data(), 1, &master_row, columns.size(),
> columns.data()); M.apply("add");

Here it fails because PETScMatrix M does not have entry (0, 10).
You need to create custom sparsity pattern which would include all
entries you need. Then you create PETScMatrix out of this pattern,
assemble and set your additional values.

>
> Errors:
>
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------ [0]PETSC ERROR: Argument out of
> range! [0]PETSC ERROR: New nonzero at (0,10) caused a malloc!
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 6, Mon Feb 11
> 12:26:34 CST 2013 [0]PETSC ERROR: See docs/changes/index.html for
> recent updates. [0]PETSC ERROR: See docs/faq.html for hints about
> trouble shooting. [0]PETSC ERROR: See docs/index.html for manual
> pages. [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Unknown Name on a linux-gnu named ubuntu by dang Thu
> Apr 18 11:53:37 2013 [0]PETSC ERROR: Libraries linked
> from /home/dang/Work/FEniCS/lib [0]PETSC ERROR: Configure run at Thu
> Apr 11 08:38:04 2013 [0]PETSC ERROR: Configure options COPTFLAGS=-O2
> --with-debugging=0 --with-shared-libraries=1 --with-clanguage=cxx
> --with-c-support=1 --download-umfpack=1 --download-hypre=1
> --download-mumps=1 --download-scalapack=1 --download-blacs=1
> --download-ptscotch=1 --download-scotch=1 --download-metis=1
> --download-parmetis=1 --with-ml=1
> --with-ml-lib=/home/dang/Work/FEniCS/lib/libml.so
> --with-ml-include=/home/dang/Work/FEniCS/include/trilinos
> --prefix=/home/dang/Work/FEniCS [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: MatSetValues_SeqAIJ() line 345
> in /home/dang/Work/FEniCS/src/petsc-3.3-p6/src/mat/impls/aij/seq/aij.c
> [0]PETSC ERROR: MatSetValues() line 1025
> in /home/dang/Work/FEniCS/src/petsc-3.3-p6/src/mat/interface/matrix.c
>
> I looked at https://bugs.launchpad.net/dolfin/+bug/1033611 but I

This does not apply to your situation as keep_diagonal assembler option
helps to keep diagonal entries in sparsity pattern. (0, 10) is
off-diagonal.

> could not find the solution for your serial computations. Can you
> please help me? Thanks a lot, Best regards,
> Dang
>

Dear Jan,
Thanks a lot for your quick response. In fact, my work is further than that. I need to write a method myself to impose one kind of boundary conditions, like PeriodicBC, in which I have to interact a lot with the PETSc matrices. It worked well with the old version of FENICS. Now, I would like to use serial computations to speed up my code. Obviously, it is not convenient to create an additional matrix at each task.
I looked at the periodic demo. It works perfectly. How can you do that without error?
Best regards,
Dang

Jan Blechta (blechta) said : #47

On Thu, 18 Apr 2013 20:31:13 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> Thanks a lot for your quick response. In fact, my work is further
> than that. I need to write a method myself to impose one kind of
> boundary conditions, like PeriodicBC, in which I have to interact a
> lot with the PETSc matrices. It worked well with the old version of
> FENICS. Now, I would like to use serial computations to speed up my
> code. Obviously, it is not convenient to create an additional matrix

You don't need to do that. Create one matrix but with sparsity pattern
having all entries you need. Or use dense matrices.

> at each task. I looked at the periodic demo. It works perfectly. How
> can you do that without error? Best regards, Dang
>

I can't see how periodic demo is related to this problem. In demo there
is no fiddling with matrix entries.

Jan

Dear Jan,
I will describle more details. In order to apply the periodic BCs to a matrix A, we need a dof_pair to store the master row and slave row. Here is a small part of the modified code I am using
   std::vector<dolfin::uint> columns;
   std::vector<double> values;
   dolfin::uint master_row;
   dolfin::uint slave_row;
   dolfin::uint num_dof_pairs = dof_pairs.size();
   for (dolfin::uint i=0;i<num_dof_pairs;i++)
   {
     //int num_loops = 1;
     master_row = dof_pairs[i].first;
     slave_row = dof_pairs[i].second;
     if (master_row<INT_MAX and slave_row<INT_MAX)
     {

 // take slave_row
 A.getrow(slave_row, columns, values);

 // add slave_row to master_row.
 A.add(&values[0], 1, &master_row, columns.size(), &columns[0]);
 A.apply("add");

 // zero out slave_row
 A.zero(1, &slave_row);

 //set {1.0,-1.0} to 2 columns {slave_row, master_row}
 dolfin::uint cols[2];
 double vals[2] = {1.0,-1.0};
 const dolfin::uint row = dof_pairs[i].second;
 cols[0] = slave_row;
 cols[1] = master_row;
 A.set(vals, 1, &row, 2, cols);
 A.apply("insert");
     }
   }
When I run this code in new version of Fenics, I usually encountered the error.
Hope this is clear.
Dang

Jan Blechta (blechta) said : #49

On Thu, 18 Apr 2013 21:06:07 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I will describle more details. In order to apply the periodic BCs to
> a matrix A, we need a dof_pair to store the master row and slave row.
> Here is a small part of the modified code I am using
> std::vector<dolfin::uint> columns; std::vector<double> values;
> dolfin::uint master_row; dolfin::uint slave_row;
> dolfin::uint num_dof_pairs = dof_pairs.size();
> for (dolfin::uint i=0;i<num_dof_pairs;i++)
> {
> //int num_loops = 1;
> master_row = dof_pairs[i].first;
> slave_row = dof_pairs[i].second;
> if (master_row<INT_MAX and slave_row<INT_MAX)
> {
>
> // take slave_row
> A.getrow(slave_row, columns, values);
>
> // add slave_row to master_row.
> A.add(&values[0], 1, &master_row, columns.size(),
> &columns[0]); A.apply("add");
>
> // zero out slave_row
> A.zero(1, &slave_row);
>
> //set {1.0,-1.0} to 2 columns {slave_row, master_row}
> dolfin::uint cols[2];
> double vals[2] = {1.0,-1.0};
> const dolfin::uint row = dof_pairs[i].second;
> cols[0] = slave_row;
> cols[1] = master_row;
> A.set(vals, 1, &row, 2, cols);
> A.apply("insert");
> }
> }
> When I run this code in new version of Fenics, I usually encountered
> the error. Hope this is clear.

Yes, this is clear. And as I said you need to build custom sparsity
pattern to avoid these PETSc errors.

I guess that in older versions you were enabled to write to matrix
entries which were not preallocated but this was forbidden because of
major performance issues.

Jan

> Dang
>

Dear Jan,
I found a temporary solution here https://answers.launchpad.net/dolfin/+question/212407
 PETScMatrix& petsc_A = A.down_cast<PETScMatrix>();
 MatSetOption(*petsc_A.mat(), MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE);
Best regards,
Dang

Jan Blechta (blechta) said : #51

On Fri, 19 Apr 2013 06:06:21 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/225438
>
> Status: Answered => Solved
>
> Nguyen Van Dang confirmed that the question is solved:
> Dear Jan,
> I found a temporary solution here
> https://answers.launchpad.net/dolfin/+question/212407 PETScMatrix&
> petsc_A = A.down_cast<PETScMatrix>(); MatSetOption(*petsc_A.mat(),
> MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE); Best regards,
> Dang
>

You might want to look into development version of DOLFIN if you don't
need serial-meshes functionality. I think there has been done much work
since 1.1.0 branch on which is serial-meshes branch based.

Jan