Skip to content

Commit

Permalink
Add read out of OpenMP number of threads
Browse files Browse the repository at this point in the history
Read out of number of threads for OpenMP. Expected to be equal set environment variable OMP_NUM_THREADS
  • Loading branch information
jorgenherje committed Mar 20, 2024
1 parent b9589b3 commit 9b119e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GrpcInterface/RiaGrpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <grpcpp/grpcpp.h>

#include <QTcpServer>
#include <omp.h>

using grpc::CompletionQueue;
using grpc::Server;
Expand Down Expand Up @@ -141,6 +142,13 @@ void RiaGrpcServerImpl::initialize()

ServerBuilder builder;

int numOmpThreads = 0;

This comment has been minimized.

Copy link
@kriben

kriben Mar 20, 2024

Collaborator

Maybe move to RiaOpenMPTools.h?

#pragma omp parallel
{
numOmpThreads = omp_get_num_threads();
}
RiaLogging::info( QString( "OpenMP Num Threads: %1" ).arg( numOmpThreads ) );

// When setting port number to 0, grpc will find and use a valid port number
// The port number is assigned to the m_portNumber variable after calling builder.BuildAndStart()
QString requestedServerAddress = QString( "localhost:%1" ).arg( m_portNumber );
Expand Down

0 comments on commit 9b119e6

Please sign in to comment.