Manage many linear solvers parallely
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
- Assignee:
- No assignee Edit question
- Solved by:
- Nguyen Van Dang
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
On Fri, 29 Mar 2013 16:41:20 -0000
Nguyen Van Dang <email address hidden> wrote:
> New question #225438 on FEniCS Project:
> https:/
>
> 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
Revision history for this message
|
#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, GlobalParameter
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:/
***
*** 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.
*** Where: This error was encountered inside Parameters.cpp.
*** -------
#include <dolfin.h>
#include "Poisson.h"
#include </home/
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:
int num_processes = dolfin:
std::cout<<"I am processor "<<process_
parameters[
if (process_number==0)
{
parameters[
// Create mesh and function space
UnitSquare mesh(32, 32);
Poisson:
// Define boundary condition
Constant u0(0.0);
DirichletBou
DirichletBC bc(V, u0, boundary);
// Define variational forms
Poisson:
Poisson:
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.
file << u;
// Plot solution
plot(u);
}
return 0;
}
Revision history for this message
|
#3 |
On Mon, 01 Apr 2013 07:50:57 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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, GlobalParameter
> 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:/
> ***
> *** 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.
> encountered inside Parameters.cpp. ***
> -------
>
> #include <dolfin.h>
> #include "Poisson.h"
> #include
> </home/
>
> 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:
> int num_processes = dolfin:
> std::cout<<"I am processor "<<process_
> "<<num_processes<<" processors\n";
> parameters[
> {
> parameters[
> // Create mesh and function space
> UnitSquare mesh(32, 32);
> Poisson:
>
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
>
> // Define variational forms
> Poisson:
> 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.
> 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://
or
http://
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
Revision history for this message
|
#4 |
Dear Jan,
I downloaded and installed the newest dorsal here https:/
common.copy /home/dang10321
...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
Revision history for this message
|
#5 |
On Mon, 01 Apr 2013 20:15:56 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I downloaded and installed the newest dorsal here
> https:/
>
> common.copy /home/dang10321
> ...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_
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/
5. Atter you succeed building go to dolfin dir and switch to
serial-meshes branch
cd /your/work/
bzr branch --use-existing-dir lp:~blechta/dolfin/serial-meshes .
(note . on the end of line)
6. Rebuild only dolfin
cd /your/work/
./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
>
Revision history for this message
|
#6 |
Dear Jan,
I tried ./dorsal.sh FEniCS/
...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:/
Thanks
Best regards,
Dang
Revision history for this message
|
#7 |
On Tue, 02 Apr 2013 07:31:17 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> I tried ./dorsal.sh FEniCS/
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=
> 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:/
> Thanks Best regards,
> Dang
>
Revision history for this message
|
#8 |
@Jan: I don't know if it's a better solution, but before step 4 you could modify FEniCS/
-NAME=dolfin
-SOURCE=lp:
+NAME=
+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.
Revision history for this message
|
#9 |
On Tue, 02 Apr 2013 11:56:18 -0000
Johannes Ring <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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/
>
> -NAME=dolfin
> -SOURCE=lp:
> +NAME=serial-meshes
> +SOURCE=lp:~blechta/dolfin/
Plus
rm FEniCS/
otherwise dorsal will not look into FEniCS/
>
> 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.
>
Revision history for this message
|
#10 |
Yes. Or you can build everything except DOLFIN, then change STABLE_BUILD=false in dorsal.cfg and then only build DOLFIN.
Revision history for this message
|
#11 |
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:/
bzr: ERROR: The user provider11 has not registered any SSH keys with Launchpad.
See <https:/
Can you please tell me how to fix this?
Thanks,
Best regards,
Dang
Revision history for this message
|
#12 |
I removed dolfin-
In dorsal.cfg
STABLE_BUILD=true
In dolfin.pakage
NAME=serial-meshes
SOURCE=lp:~blechta/dolfin/
PACKING=bzr
BUILDCHAIN=cmake
CONFOPTS=
Revision history for this message
|
#13 |
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:/
make[2]: *** [dolfin/
make[2]: Leaving directory `/home/
make[1]: *** [dolfin/
make[1]: Leaving directory `/home/
make: *** [all] Error 2
make: Leaving directory `/home/
Failure with exit status: 2
Exit message: There was a problem building serial-meshes.
Here is the README.Bugs
https:/
Revision history for this message
|
#14 |
On Wed, 03 Apr 2013 06:26:17 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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:/
>
> bzr: ERROR: The user provider11 has not registered any SSH keys with
> Launchpad. See <https:/
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-
>
> Can you please tell me how to fix this?
> Thanks,
> Best regards,
> Dang
>
Revision history for this message
|
#15 |
On Wed, 03 Apr 2013 09:21:08 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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:/
> make[2]: ***
> [dolfin/
> Error 1 make[2]: Leaving directory
> `/home/
> make[1]: *** [dolfin/
> Leaving directory
> `/home/
> make: *** [all] Error 2 make: Leaving directory
> `/home/
> Failure with exit status: 2 Exit message: There was a problem
> building serial-meshes. Here is the README.Bugs
> https:/
>
README.Bugs is manual for submitting bugs to developers of GCC. It is
not useful here. What is in dorsal_
Is gcc-4.4 supported, Johannes?
Revision history for this message
|
#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).
Revision history for this message
|
#17 |
@Jan: Here is the dorsal_build.log file I got from Work/FEniCS/
https:/
Revision history for this message
|
#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_
Revision history for this message
|
#19 |
On Wed, 03 Apr 2013 11:16:02 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> @Jan: Here is the dorsal_build.log file I got from
> Work/FEniCS/
> empty.
> https:/
>
I mean the dorsal_
dir. It would be in something like Work/FEniCS/
Work/FEniCS/
Revision history for this message
|
#20 |
Dear Jan,
Here are two files I got from /home/dang10321
https:/
https:/
Best regards,
Dang
Revision history for this message
|
#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.
Revision history for this message
|
#22 |
Dear Johannes,
I registered SSH at https:/
Then, I built again ./dorsal.sh FEniCS/
I got these messages at the end:
ssh: connect to host bazaar.
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
Revision history for this message
|
#23 |
On Wed, 03 Apr 2013 20:45:48 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Johannes,
> I registered SSH at https:/
> launchpad-login dang-1032170 without warnings, error messages. Then,
> I built again ./dorsal.sh FEniCS/
> got these messages at the end: ssh: connect to host
> bazaar.
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-
DOLFIN_ENABLE_CGAL
Jan
Revision history for this message
|
#24 |
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/dang10321
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-
Skipping petsc-3.3-p6
Skipping slepc-3.3-p3
Skipping scotch_
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.
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.
Revision history for this message
|
#25 |
On Thu, 04 Apr 2013 05:51:19 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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/dang10321
> 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-
> Skipping petsc-3.3-p6
> Skipping slepc-3.3-p3
> Skipping scotch_
> 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.
> 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
Revision history for this message
|
#26 |
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:/
>
> 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:/
> >
> > 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/dang10321
> > 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-
> > Skipping petsc-3.3-p6
> > Skipping slepc-3.3-p3
> > Skipping scotch_
> > 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.
> > 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:/
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https:/
>
> You received this question notification because you asked the question.
>
--
Nguyen Van Dang
Hand phone: +33751354339
Home Tel: +84792213628
Revision history for this message
|
#27 |
On Thu, 04 Apr 2013 12:21:09 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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:/
> >
> > 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:/
> > >
> > > 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/dang10321
> > > 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-
> > > Skipping petsc-3.3-p6
> > > Skipping slepc-3.3-p3
> > > Skipping scotch_
> > > 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.
> > > 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:/
> >
> > If you still need help, you can reply to this email or go to the
> > following page to enter your feedback:
> > https:/
> >
> > You received this question notification because you asked the
> > question.
> >
>
>
Revision history for this message
|
#28 |
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/
make[2]: Leaving directory `/home/
make[1]: *** [dolfin/
make[1]: Leaving directory `/home/
make: *** [all] Error 2
make: Leaving directory `/home/
Here are .log files I got from /home/dang10321
https:/
https:/
Then, I set DOLFIN_
but I still got the same errors.
Can you please help me again?
Thanks,
Best regards,
Dang
Revision history for this message
|
#29 |
On Fri, 05 Apr 2013 14:26:14 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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/
> Error 1 make[2]: Leaving directory
> `/home/
> make[1]: *** [dolfin/
> Error 2 make[1]: Leaving directory
> `/home/
> make: *** [all] Error 2 make: Leaving directory
> `/home/
>
> Here are .log files I got
> from /home/dang10321
> https:/
> https:/
>
> Then, I set DOLFIN_
> (in /home/dang10321
> 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
Revision history for this message
|
#30 |
Hello,
I followed the instructions in INSTALL and README using
cmake .
make install
in directory
/home/
I could complete the installation:
DOLFIN has now been installed in
/home/
and the demo programs have been installed in
/home/
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/dang10321
For future reference, we recommend that you add this command to your
configuration (.bashrc, .profile or similar).
I compiled a demo in /Work/FEniCS/
cmake . (succeeded)
make (with following error)
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
/home/dang10321
collect2: ld returned 1 exit status
make[2]: *** [demo_poisson] Error 1
make[1]: *** [CMakeFiles/
make: *** [all] Error 2
Can you please help me to fix it?
Thanks,
Best regards,
Dang
Revision history for this message
|
#31 |
On Tue, 09 Apr 2013 07:31:10 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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/dang10321
> I could complete the installation:
>
> DOLFIN has now been installed in
> /home/dang10321
> and the demo programs have been installed in
> /home/dang10321
> 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/dang10321
> For future reference, we recommend that you add this command to your
> configuration (.bashrc, .profile or similar).
>
> I compiled a demo in /Work/FEniCS/
> cmake . (succeeded)
> make (with following error)
> /home/dang10321
> to `typeinfo for
> boost::
> undefined reference to
> `boost:
> const' /home/dang10321
> reference to
> `boost:
> boost::
> undefined reference to
> `boost:
> undefined reference to `boost:
> const' /home/dang10321
> reference to
> `boost:
> undefined reference to `boost:
> int, int, boost::
> MPI_Status&)' /home/dang10321
> undefined reference to `boost:
> const' /home/dang10321
> reference to `boost:
> const' /home/dang10321
> reference to `boost:
> const' /home/dang10321
> reference to
> `boost:
> undefined reference to
> `boost:
> std::char_
> const' /home/dang10321
> reference to `vtable for
> boost::
> undefined reference to
> `boost:
> int)' /home/dang10321
> reference to
> `boost:
> undefined reference to `boost:
> const&,
> boost::
> undefined reference to `boost:
> int, int, boost::
> const&)' /home/dang10321
> reference to
> `boost:
> const&,
> boost::
> undefined reference to
> `boost:
> std::char_
> std::basic_
> > const&, std::basic_
> > std::allocator<
> > status make[2]: *** [demo_poisson] Error 1 make[1]: ***
> > [CMakeFiles/
> > 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/dang10321
to check if all dependencies are found.
Jan
Revision history for this message
|
#32 |
Dear Jan,
That command gives
dang1032170@
linux-gate.so.1 => (0x005d4000)
libxml2.so.2 => /usr/lib/
libarmadillo.so.3 => not found
liblapack.so.3gf => /usr/lib/
libcblas.so.3gf => /usr/lib/
libf77blas.so.3gf => /usr/lib/
libatlas.so.3gf => /usr/lib/
libboost_
libboost_
libboost_
libboost_
libboost_
libboost_
libboost_
libboost_
libml.so => not found
libgaleri-
libgaleri.so => not found
libisorropia.so => not found
libtpetraext.so => not found
libtpetrainout.so => not found
libtpetra.so => not found
libzoltan.so => not found
libkokkosdistt
libkokkosnodet
libkokkoslinalg.so => not found
libkokkosnodea
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/
libpetsc.so => /usr/lib/
libumfpack.
libamd.so.2.2.0 => /usr/lib/
libcholmod.
libcamd.so.2.2.0 => /usr/lib/
libcolamd.so.2.7.1 => /usr/lib/
libccolamd.
libparmetis.so => /usr/lib/
libmetis.so => /usr/lib/
libgfortran.so.3 => /usr/lib/
libz.so.1 => /lib/libz.so.1 (0x1d45a000)
libcppunit-
libmpichcxx.so.1.2 => /usr/lib/
libmpich.so.1.2 => /usr/lib/
libpthread.so.0 => /lib/tls/
librt.so.1 => /lib/tls/
libvtkCommon.
libvtkFilterin
libvtkImaging.
libvtkGraphics
libvtkGenericF
libvtkIO.so.5.2 => /usr/lib/
libvtkRenderin
libvtkVolumeRe
libvtkHybrid.
libvtkWidgets.
libvtkParallel
libvtkInfovis.
libvtkViews.so.5.2 => /usr/lib/
libstdc++.so.6 => /usr/lib/
libm.so.6 => /lib/tls/
libgomp.so.1 => /usr/lib/
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0409d000)
libc.so.6 => /lib/tls/
libdl.so.2 => /lib/tls/
libblas.so.3gf => /usr/lib/
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x14695000)
libmpi.so.0 => /usr/lib/
libmpi_cxx.so.0 => /usr/lib/
libnsl.so.1 => /lib/tls/
libopen-pal.so.0 => /usr/lib/
libopen-rte.so.0 => /usr/lib/
libutil.so.1 => /lib/tls/
libX11.so.6 => /usr/lib/
libspooles.so.2.2 => /usr/lib/
libHYPRE-2.4.0.so => /usr/lib/
libsuperlu.so.3 => /usr/lib/
libmpi_f90.so.0 => /usr/lib/
libmpi_f77.so.0 => /usr/lib/
libscotch-5.1.so => /usr/lib/
libparpack.so.2 => /usr/lib/
libarpack.so.2 => /usr/lib/
libpetscksp.
libpetscdm.
libpetscmat.
libpetscvec.
/lib/ld-linux.so.2 (0x00111000)
libvtksys.so.5.2 => /usr/lib/
libvtkverdict.
libmysqlclient
libvtkDICOMPar
libvtkNetCDF.
libvtkmetaio.
libvtksqlite.
libpng12.so.0 => /lib/libpng12.so.0 (0x019e0000)
libjpeg.so.62 => /usr/lib/
libtiff.so.4 => /usr/lib/
libexpat.so.1 => /lib/libexpat.so.1 (0x0c50e000)
libavcodec.so.52 => /usr/lib/
libavformat.so.52 => /usr/lib/
libavutil.so.49 => /usr/lib/
libswscale.so.0 => /usr/lib/
libvtkftgl.so.5.2 => /usr/lib/
libfreetype.so.6 => /usr/lib/
libgl2ps.so.0 => /usr/lib/
libGL.so.1 => /usr/lib/
libXt.so.6 => /usr/lib/libXt.so.6 (0x01ab8000)
libSM.so.6 => /usr/lib/libSM.so.6 (0x18cdb000)
libICE.so.6 => /usr/lib/
libXext.so.6 => /usr/lib/
libXss.so.1 => /usr/lib/
libXft.so.2 => /usr/lib/
libvtkexoIIc.
libxcb.so.1 => /usr/lib/
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libHYPRE_
libscotcherr-
libcrypt.so.1 => /lib/tls/
libgsm.so.1 => /usr/lib/
libschroedinge
libspeex.so.1 => /usr/lib/
libtheora.so.0 => /usr/lib/
libvorbisenc.so.2 => /usr/lib/
libvorbis.so.0 => /usr/lib/
libXxf86vm.so.1 => /usr/lib/
libXdamage.so.1 => /usr/lib/
libXfixes.so.3 => /usr/lib/
libdrm.so.2 => /lib/libdrm.so.2 (0x0493d000)
libuuid.so.1 => /lib/libuuid.so.1 (0x0d370000)
libfontconfig.so.1 => /usr/lib/
libXrender.so.1 => /usr/lib/
libXau.so.6 => /usr/lib/
libXdmcp.so.6 => /usr/lib/
liboil-0.3.so.0 => /usr/lib/
libogg.so.0 => /usr/lib/
What can I do? Thanks
Revision history for this message
|
#33 |
On Tue, 09 Apr 2013 09:11:16 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> That command gives
> dang1032170@
> ldd /home/dang10321
> => (0x005d4000) libxml2.so.2 => /usr/lib/
> libarmadillo.so.3 => not found
> liblapack.so.3gf => /usr/lib/
> (0x00cfd000) libcblas.so.3gf => /usr/lib/
> libf77blas.so.3gf => /usr/lib/
> libatlas.so.3gf => /usr/lib/
> libboost_
> => /usr/lib/
> libboost_
> => /usr/lib/
> libboost_
> (0x005c9000) libboost_
> => /usr/lib/
> libboost_
> (0x00651000) libboost_
> => /usr/lib/
> libboost_
> (0x006b1000) libboost_
> => /usr/lib/
> 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 libkokkosdistts
> libkokkosnodets
> 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/
> libpetsc.so => /usr/lib/
> libumfpack.so.5.4.0 => /usr/lib/
> (0x03387000) libamd.so.2.2.0 => /usr/lib/
> libcholmod.so.1.7.1 => /usr/lib/
> (0x06cd0000) libcamd.so.2.2.0 => /usr/lib/
> (0x16e8a000) libcolamd.so.2.7.1 => /usr/lib/
> (0x09f8f000) libccolamd.so.2.7.1 => /usr/lib/
> (0x126c9000) libparmetis.so => /usr/lib/
> libmetis.so => /usr/lib/
> libgfortran.so.3 => /usr/lib/
> libz.so.1 => /lib/libz.so.1 (0x1d45a000)
> libcppunit-
> (0x108b1000) libmpichcxx.so.1.2 => /usr/lib/
> (0x1b10a000) libmpich.so.1.2 => /usr/lib/
> libpthread.so.0 => /lib/tls/
> (0x1639a000) librt.so.1 => /lib/tls/
> libvtkCommon.so.5.2 => /usr/lib/
> (0x0fcd6000) libvtkFiltering
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> libvtkGenericFi
> => /usr/lib/
> libvtkIO.so.5.2 => /usr/lib/
> libvtkRendering
> (0x17392000) libvtkVolumeRen
> => /usr/lib/
> libvtkHybrid.so.5.2 => /usr/lib/
> libvtkWidgets.
> libvtkParallel.
> libvtkInfovis.
> libvtkViews.so.5.2 => /usr/lib/
> libstdc++.so.6 => /usr/lib/
> => /lib/tls/
> => /usr/lib/
> => /lib/libgcc_s.so.1 (0x0409d000) libc.so.6
> => /lib/tls/
> => /lib/tls/
> => /usr/lib/
> => /lib/libbz2.so.1.0 (0x14695000) libmpi.so.0
> => /usr/lib/
> => /usr/lib/
> => /lib/tls/
> => /usr/lib/
> => /usr/lib/
> => /lib/tls/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> (0x00111000) libvtksys.so.5.2 => /usr/lib/
> (0x10d17000) libvtkverdict.
> (0x183c4000) libmysqlclient.
> (0x017f0000) libvtkDICOMPars
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /lib/libpng12.so.0 (0x019e0000) libjpeg.so.62
> => /usr/lib/
> => /usr/lib/
> => /lib/libexpat.so.1 (0x0c50e000) libavcodec.so.52
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/libXt.so.6 (0x01ab8000) libSM.so.6 => /usr/lib/libSM.so.6
> (0x18cdb000) libICE.so.6 => /usr/lib/
> libXext.so.6 => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x04136000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x17f32000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x01b75000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x12036000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> => /usr/lib/
> libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x0cceb000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x1ba4e000) libHYPRE_
> => /usr/lib/
> (0x199a0000) libHYPRE_
> => /usr/lib/
> libHYPRE_
> (0x0c93b000) libHYPRE_
> (0x1333f000) libHYPRE_
> (0x135e8000) libscotcherr-5.1.so => /usr/lib/
> (0x0b083000) libcrypt.so.1 => /lib/tls/
> (0x09d69000) libgsm.so.1 => /usr/lib/
> libschroedinger
> (0x20a33000) libspeex.so.1 => /usr/lib/
> (0x0dc63000) libtheora.so.0 => /usr/lib/
> libvorbisenc.so.2 => /usr/lib/
> libvorbis.so.0 => /usr/lib/
> libXxf86vm.so.1 => /usr/lib/
> libXdamage.so.1 => /usr/lib/
> libXfixes.so.3 => /usr/lib/
> => /lib/libdrm.so.2 (0x0493d000) libuuid.so.1 => /lib/libuuid.so.1
> (0x0d370000) libfontconfig.so.1 => /usr/lib/
> (0x1d797000) libXrender.so.1 => /usr/lib/
> libXau.so.6 => /usr/lib/
> => /usr/lib/
> => /usr/lib/
> => /usr/lib/
>
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_
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-
Jan
Revision history for this message
|
#34 |
Thanks Jan Blechta, that solved my question.
Revision history for this message
|
#35 |
Hello,
It worked well on the python version with two files demo_serial-
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
=======
#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[
// Create mesh and function space
UnitSquareMesh mesh(32, 32);
Poisson:
// Define boundary condition
Constant u0(0.0);
DirichletBoundary boundary;
DirichletBC bc(V, u0, boundary);
// Define variational forms
Poisson:
Poisson:
Function u(V);
int process_number = dolfin:
int num_processes = dolfin:
std::cout<<"I am processor "<<process_
if (process_number == 0)
{
// Let dolfin believe that there is only one process
parameters[
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.
file << u;
// Plot solution
parameters[
}
if (process_number == 1)
{
// Let dolfin believe that there is only one process
parameters[
Constant zero(0);
L.f = zero;
L.g = zero;
// Compute solution
solve(a == L, u, bc);
// Save solution in VTK format
File file("poisson.
file << u;
// Plot solution
parameters[
}
dolfin:
//plot(u);
//interactive();
return 0;
}
=======
dang@ubuntu:
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_
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:/
***
*** 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
*** 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).
-------
Revision history for this message
|
#36 |
On Fri, 12 Apr 2013 20:36:06 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Solved => Open
>
> Nguyen Van Dang is still having a problem:
> Hello,
> It worked well on the python version with two files
> demo_serial-
> 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
>
> =======
> #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[
> // Create mesh and function space
> UnitSquareMesh mesh(32, 32);
> Poisson:
>
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
>
> // Define variational forms
> Poisson:
> Poisson::LinearForm L(V);
>
> Function u(V);
> int process_number = dolfin:
> int num_processes = dolfin:
> std::cout<<"I am processor "<<process_
> "<<num_processes<<" processes.\n";
>
> if (process_number == 0)
> {
> // Let dolfin believe that there is only one process
> parameters[
>
> 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.
> file << u;
> // Plot solution
> parameters[
> }
>
> if (process_number == 1)
> {
> // Let dolfin believe that there is only one process
> parameters[
>
> Constant zero(0);
> L.f = zero;
> L.g = zero;
>
> // Compute solution
> solve(a == L, u, bc);
>
> // Save solution in VTK format
> File file("poisson.
> file << u;
> // Plot solution
> parameters[
>
> }
>
> dolfin:
> //plot(u);
> //interactive();
>
> return 0;
> }
>
> =======
>
> dang@ubuntu:
> 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_
> 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:/
> ***
> *** 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
> -------
>
> [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[
to the beginning to tell DOLFIN to initialize all objects
non-distributed.
Jan
Revision history for this message
|
#37 |
Dear Jan,
It worked. However, when we set parameters[
Thanks,
Best regards,
Dang
Revision history for this message
|
#38 |
On Mon, 15 Apr 2013 12:46:14 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Open
>
> Nguyen Van Dang is still having a problem:
> Dear Jan,
> It worked. However, when we set parameters[
> 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
Revision history for this message
|
#39 |
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[
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:
// Define boundary condition
Constant u0(0.0);
DirichletBo
DirichletBC bc(V, u0, boundary);
// Define variational forms
Poisson:
Poisson:
Function u1(V);
Function u2(V);
int process_number = dolfin:
int num_processes = dolfin:
// 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
Source f;
dUdN g;
L.f = f;
L.g = g;
// Compute solution
solve(a == L, u1, bc);
parameters
}
if (process_number == 1) // solve system 2 with process 1
{
// Let dolfin believe that there is only one process
parameters[
Constant zero(0);
L.f = zero;
L.g = zero;
// Compute solution
solve(a == L, u2, bc);
parameters[
}
dolfin:
return 0;
}
Revision history for this message
|
#40 |
On Mon, 15 Apr 2013 14:36:15 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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[
> 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[
UnitSquareMesh mesh(32, 32);
every proccess creates its own serial mesh (they will be same). If you
do
if (process_number == 0)
{
parameters[
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:
> // Define boundary condition
> Constant u0(0.0);
> DirichletBoundary boundary;
> DirichletBC bc(V, u0, boundary);
> // Define variational forms
> Poisson:
> Poisson::LinearForm L(V);
> Function u1(V);
> Function u2(V);
> int process_number = dolfin:
> int num_processes = dolfin:
> // 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[
> Source f;
> dUdN g;
> L.f = f;
> L.g = g;
> // Compute solution
> solve(a == L, u1, bc);
> parameters[
> }
>
> if (process_number == 1) // solve system 2 with process 1
> {
> // Let dolfin believe that there is only one process
> parameters[
> Constant zero(0);
> L.f = zero;
> L.g = zero;
> // Compute solution
> solve(a == L, u2, bc);
> parameters[
> }
> dolfin:
> 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
Revision history for this message
|
#41 |
Dear Jan,
It seems that I have to use OpenMP instead. I knew that parameters[
omp_set_
# pragma omp parallel
{
// Let dolfin believe that there is only one process
parameters
Source f;
dUdN g;
L.f = f;
L.g = g;
// Compute solution
solve(a == L, u1, bc);
parameters
}
# pragma omp parallel
{
// Let dolfin believe that there is only one process
parameters[
Constant zero(0);
L.f = zero;
L.g = zero;
// Compute solution
solve(a == L, u2, bc);
parameters[
}
Can you please give me some suggestions to solve this problem?
Thanks a lot,
Best regards,
Dang
Revision history for this message
|
#42 |
On Mon, 15 Apr 2013 17:01:32 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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[
> 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_
> that there is only one process parameters[
> true; Source f;
> dUdN g;
> L.f = f;
> L.g = g;
> // Compute solution
> solve(a == L, u1, bc);
> parameters[
> }
>
> # pragma omp parallel
> {
> // Let dolfin believe that there is only one process
> parameters[
> Constant zero(0);
> L.f = zero;
> L.g = zero;
> // Compute solution
> solve(a == L, u2, bc);
> parameters[
> }
> 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
Revision history for this message
|
#43 |
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
Revision history for this message
|
#44 |
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:
// Define variational forms
Poisson:
PETScMatrix M;
assemble(M,a);
std::vector<
std::vector<
dolfin::la_index master_row = 0;
columns[0]=1;
columns[0]=10;
values[0]=10.0;
values[0]=10.0;
M.set(
M.apply("add");
Errors:
[0]PETSC ERROR: -------
[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/
[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/
[0]PETSC ERROR: Configure run at Thu Apr 11 08:38:04 2013
[0]PETSC ERROR: Configure options COPTFLAGS=-O2 --with-debugging=0 --with-
[0]PETSC ERROR: -------
[0]PETSC ERROR: MatSetValues_
[0]PETSC ERROR: MatSetValues() line 1025 in /home/dang/
I looked at https:/
Thanks a lot,
Best regards,
Dang
Revision history for this message
|
#45 |
On Thu, 18 Apr 2013 18:41:35 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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:
>
> // Define variational forms
> Poisson:
>
> PETScMatrix M;
> assemble(M,a);
>
>
> std::vector<
> 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.
> 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: -------
> -------
> 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/
> 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/
> Apr 11 08:38:04 2013 [0]PETSC ERROR: Configure options COPTFLAGS=-O2
> --with-debugging=0 --with-
> --with-c-support=1 --download-
> --download-mumps=1 --download-
> --download-
> --download-
> --with-
> --with-
> --prefix=
> -------
> [0]PETSC ERROR: MatSetValues_
> in /home/dang/
> [0]PETSC ERROR: MatSetValues() line 1025
> in /home/dang/
>
> I looked at https:/
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
>
Revision history for this message
|
#46 |
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
Revision history for this message
|
#47 |
On Thu, 18 Apr 2013 20:31:13 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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
Revision history for this message
|
#48 |
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:
std:
dolfin::uint master_row;
dolfin::uint slave_row;
dolfin::uint num_dof_pairs = dof_pairs.size();
for (dolfin::uint i=0;i<num_
{
//int num_loops = 1;
master_row = dof_pairs[i].first;
slave_row = dof_pairs[
if (master_row<INT_MAX and slave_row<INT_MAX)
{
// take slave_row
A.getrow(
// 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[
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
Revision history for this message
|
#49 |
On Thu, 18 Apr 2013 21:06:07 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> 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 master_row; dolfin::uint slave_row;
> dolfin::uint num_dof_pairs = dof_pairs.size();
> for (dolfin::uint i=0;i<num_
> {
> //int num_loops = 1;
> master_row = dof_pairs[i].first;
> slave_row = dof_pairs[
> 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[
> 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
>
Revision history for this message
|
#50 |
Dear Jan,
I found a temporary solution here https:/
PETScMatrix& petsc_A = A.down_
MatSetOption(
Best regards,
Dang
Revision history for this message
|
#51 |
On Fri, 19 Apr 2013 06:06:21 -0000
Nguyen Van Dang <email address hidden> wrote:
> Question #225438 on FEniCS Project changed:
> https:/
>
> Status: Answered => Solved
>
> Nguyen Van Dang confirmed that the question is solved:
> Dear Jan,
> I found a temporary solution here
> https:/
> petsc_A = A.down_
> MAT_NEW_
> 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