Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Multithread

cristian-vasile.achim

Cristian Achim
New Member
Hello,

I am pretty new at this. In the _compile.xml script there is code
Code:
 <LDFLAGS>
    <append compile_threaded="true"> -fopenmp </append>
 </LDFLAGS>
Is the OpenMP support activated by default, or do I need to change some setting when I create a new case? I know that in the _pes.xml there is the variable nthrds to be changed, but is that enough?

Best,

Cristian
 

jedwards

CSEG and Liaisons
Staff member
Yes - there are two ways to enable openmp. One is simply to set the value of any NTHRDS_ variable > 1.
The other is to set the xml variable FORCE_BUILD_SMP=TRUE. This second is because many compilers change
the optimization settings when using openmp and in testing we compare runs using different numbers of threads and expect
the same results. In order to insure that we must sometimes compile with openmp enabled even when NTHRDS=1.

Also note that, in most cases, as long as you have not exceeded the maximum allowed number of mpi tasks - adding mpi tasks is
always more performant than adding threads.
 

cristian-vasile.achim

Cristian Achim
New Member
Thanks for your reply. That's great.
I tried on our cluster Mahti (with 2 x64 cores per node) and got an increase in the throughput by about 1.3 when using 128 mpi tasks per node, vs 64 tasks per node + nthrds =2 , but that was all.

Cristian
 
Top