Skip to content

Commit

Permalink
remove threaded calculation stub
Browse files Browse the repository at this point in the history
The calculation of g-2 is so incredibly fast, that opening threads
slows down the computation.
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Oct 4, 2015
1 parent 577e414 commit 5f24be8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions meta/FlexibleSUSY.m
Expand Up @@ -999,14 +999,13 @@ corresponding tadpole is real or imaginary (only in models with CP
(* Write the GMM2 c++ files *)
WriteGMuonMinus2Class[vertexRules_List, files_List] :=
Module[{particles, muonFunctionPrototypes, diagrams, vertexFunctionData,
definitions, calculationCode, threadedCalculationCode},
definitions, calculationCode},
particles = GMuonMinus2`CreateParticles[];
muonFunctionPrototypes = GMuonMinus2`CreateMuonFunctions[vertexRules][[1]];
diagrams = GMuonMinus2`CreateDiagrams[];
vertexFunctionData = GMuonMinus2`CreateVertexFunctionData[vertexRules];
definitions = GMuonMinus2`CreateDefinitions[vertexRules];
calculationCode = GMuonMinus2`CreateCalculation[];
threadedCalculationCode = GMuonMinus2`CreateThreadedCalculation[];

WriteOut`ReplaceInFiles[files,
{ "@GMuonMinus2_Particles@" -> particles,
Expand All @@ -1015,7 +1014,6 @@ corresponding tadpole is real or imaginary (only in models with CP
"@GMuonMinus2_VertexFunctionData@" -> vertexFunctionData,
"@GMuonMinus2_Definitions@" -> definitions,
"@GMuonMinus2_Calculation@" -> IndentText[calculationCode],
"@GMuonMinus2_ThreadedCalculation@" -> IndentText[threadedCalculationCode],
Sequence @@ GeneralReplacementRules[]
} ];
];
Expand Down
3 changes: 0 additions & 3 deletions meta/GMuonMinus2.m
Expand Up @@ -10,7 +10,6 @@
CreateVertexFunctionData::usage="Returns the c++ code that contains all relevant vertex function data";

CreateCalculation::usage="Returns the c++ code that performs the actual calculation the magnetic moment";
CreateThreadedCalculation::usage="Same as above, threaded version";

CreateDefinitions::usage="Returns the c++ that contains all function definitions"

Expand Down Expand Up @@ -164,8 +163,6 @@ If you add new kinds of vertices (e.g for new diagram types):
Return[code];
];

CreateThreadedCalculation[] := CreateCalculation[];

CreateDefinitions[vertexRules_List] := (CreateEvaluationContextSpecializations[] <> "\n\n" <>
CreateMuonFunctions[vertexRules][[2]] <> "\n\n" <>
CreateVertices[vertexRules][[2]]);
Expand Down
5 changes: 0 additions & 5 deletions templates/g_muon_minus_2.cpp.in
Expand Up @@ -28,7 +28,6 @@
#include "@ModelName@_g_muon_minus_2.hpp"
#include "@ModelName@_mass_eigenstates.hpp"

#include "config.h"
#include "numerics2.hpp"
#include "wrappers.hpp"

Expand Down Expand Up @@ -410,11 +409,7 @@ double @ModelName@_GMuonMinus2::calculate_amuon(const @ModelName@_mass_eigenstat
// make copy since model is modified via call to calculate_MFe_pole()
@ModelName@_mass_eigenstates model(model_);

#ifdef ENABLE_THREADS
@GMuonMinus2_ThreadedCalculation@
#else
@GMuonMinus2_Calculation@
#endif
}

namespace {
Expand Down

0 comments on commit 5f24be8

Please sign in to comment.