[CIG-SHORT] Cell centroids

Brad Aagaard baagaard at usgs.gov
Sun Sep 9 13:31:39 PDT 2012


On 9/9/12 1:10 PM, Birendra jha wrote:
> I used GeometryHex3D::ptsRefToGlobal. I supplied (0,0,0) as the
> reference point and set vertices equal to coordinatesCell to get the
> centroid co-ordinates for each cell. Is this correct?

This sounds correct.

> I have another question. I am trying to run pylith on multiple cores.
> The problem is that in my code pylith calls another application (c++
> files, linked dynamically) which is parallelized using OpenMP. When I
> run pylith using --nodes=2 (or 4), I see that pylith solver reports 2
> MPI processes which is good. But I see 2 instances of the other
> application running simultaneously.

--nodes=2 will run PyLith on 2 cores, but there will be more processes 
running. PyLith spawns itself from Python in different ways depending on 
the batch/queue system or lack thereof. Only the child processes do any 
work.

I don't know how you are determining how many threads to spawn for each 
MPI process. If you need to know the number of processes, the MPI 
communicator holds this information.

Brad

> When I just run on 1 core, pylith reports 1 MPI process and the other
> application reports using 24 threads. This, I think, is because it
> uses OpenMP to get as many threads as possible.
>
> If I disable the OpenMP part of the other app i.e. remove following
>
> #ifdef _OPENMP #pragma omp parallel #pragma omp master n_threads =
> omp_get_num_threads(); #else n_threads = 1; #endif
>
> so that it can only use 1 thread, will it solve the issue i.e. allow
> running both pylith and the other app on the same no. of cores?


More information about the CIG-SHORT mailing list