Compiling and running with mpi

Asked by Luis M. de la Cruz

Hello every one,
I'm a beginner in FEniCS, however, because the simplicity of the software, I was able to solve a problem on forced convection very soon. I run my script with: python ForcedConv.py

To run it in parallel I just did: mpirun -np 4 python ForcedConv.py
(and to my surprise everything works very well!! ).

Now I'd like to do some speed up study. I'm using PETSc as solver backend.

I got several questions:
How can I measure the time of some part of a python code ?.
To measure the total time, is it correct to use: time mpirun -np 4 python ForcedConv.py ?
How does FEniCS make the partition of the mesh of problem?
Do you think it is better to create a C++ version of my problem to compile with mpicxx?,
if so, how can compile with mpicxx directly?

Best regards,

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Florian Rathgeber
Solved:
Last query:
Last reply:
Revision history for this message
Garth Wells (garth-wells) said :
#1

These are general MPI/profiling questions. Best to use Google to find answers to these queries.

Revision history for this message
Best Florian Rathgeber (florian-rathgeber) said :
#2

For profiling you'll generally want to implement your problem in C++. Have a look at the DOLFIN benchmark suite in /bench.

You can use the Timer class like this:

Timer timer("description"); // initialises and starts the timer
// code to time
timer.stop();

summary(); // Print timing results at the end

Revision history for this message
Luis M. de la Cruz (luiggix) said :
#3

Thanks Florian Rathgeber, that solved my question.