Skip to content
Snippets Groups Projects
Commit 867ae079 authored by Matteo Cicuttin's avatar Matteo Cicuttin
Browse files

Testing OpenMP.

parent 70bf1061
Branches
Tags
No related merge requests found
#pragma once
//#include <omp.h>
template<size_t AK>
struct num_dofs_3D
{
......@@ -39,7 +41,7 @@ void compute_field_derivatives_kernel_planar(const entity_data_cpu& ed,
size_t num_elems = ed.num_elems[iO];
size_t orient_base = orient_elem_base * ed.num_bf;
#pragma omp parallel for schedule(dynamic)
for (size_t iT = 0; iT < num_elems; iT++)
{
size_t ent_iT = orient_elem_base + iT;
......@@ -104,8 +106,10 @@ void compute_field_derivatives_kernel_curved(const entity_data_cpu& ed,
size_t orient_base = orient_elem_base * ed.num_bf;
#pragma omp parallel for schedule(dynamic)
for (size_t iT = 0; iT < num_elems; iT++)
{
//printf( "Thread %d works with idx %lu\n", omp_get_thread_num(), iT);
size_t ent_iT = orient_elem_base + iT;
size_t dofofs = ed.dofs_base + orient_base + iT*ed.num_bf;
......
#include <iostream>
#include <unistd.h>
#include "gmsh_io.h"
......
#include <iostream>
#include <unistd.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#include "test.h"
#include "gmsh_io.h"
#include "sgr.hpp"
......@@ -12,6 +15,12 @@ using namespace sgr;
int main(void)
{
#ifdef _OPENMP
std::cout << "OMP: " << omp_get_max_threads() << std::endl;
omp_set_num_threads( omp_get_max_threads() );
std::cout << "OMP: " << omp_get_num_threads() << std::endl;
#endif
gmsh::initialize();
gmsh::option::setNumber("General.Terminal", 0);
gmsh::option::setNumber("Mesh.Algorithm", 1);
......@@ -40,8 +49,8 @@ int main(void)
#endif
std::cout << Bmagentafg << " *** TESTING: DIFFERENTIATION ***" << reset << std::endl;
for (size_t go = 2; go < 4; go++)
for (size_t ao = go; ao < 4; ao++)
for (size_t go = 1; go < 5; go++)
for (size_t ao = go; ao < 5; ao++)
failed_tests += test_differentiation_convergence(go, ao);
/*****************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment