Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
pslocum committed Dec 13, 2024
2 parents b6eb63e + e4338b6 commit 615dc0f
Show file tree
Hide file tree
Showing 33 changed files with 984 additions and 114 deletions.
38 changes: 0 additions & 38 deletions CMakeCache.txt

This file was deleted.

8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required( VERSION 3.1 )

# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
project( locust_mc VERSION 3.0.0)
project( locust_mc VERSION 3.1.0)


list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake )
Expand Down Expand Up @@ -189,12 +189,18 @@ if (ROOT_FOUND)
add_definitions(-DROOT_FOUND)
pbuilder_add_ext_libraries (${ROOT_LIBRARIES})
message(STATUS "ROOT_LIBRARIES is ${ROOT_LIBRARIES}")
message(STATUS "ROOT_INCLUDE_DIRS is ${ROOT_INCLUDE_DIRS}")
else (ROOT_FOUND)
message(STATUS "Building without ROOT")
remove_definitions(-DROOT_FOUND)
endif (ROOT_FOUND)
include_directories (${ROOT_INCLUDE_DIR})

option (locust_mc_USE_MPI "Use MPI to accelerate calculations using multiple processors" OFF)
if (locust_mc_USE_MPI)
find_package(MPI REQUIRED)
endif (locust_mc_USE_MPI)

# Boost (1.46 required for filesystem version 3)
list (APPEND Boost_COMPONENTS date_time filesystem program_options system thread)
find_package (Boost 1.46.0 REQUIRED COMPONENTS ${Boost_COMPONENTS})
Expand Down
4 changes: 4 additions & 0 deletions Source/Applications/Testing/testFFT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ double GetPower(bool bTime)
ptransform += data[j][0]*data[j][0]+data[j][1]*data[j][1];
}

fftw_destroy_plan( plan);
fftw_free( data );
data = NULL;

if (bTime)
{
LPROG(testlog, "power of original data time series is: " << pdata);
Expand Down
5 changes: 5 additions & 0 deletions Source/Applications/Testing/testLMCTestSignal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ class testLMCTestSignal
ptransform += data[j][0]*data[j][0]+data[j][1]*data[j][1];
}

fftw_destroy_plan( plan);
fftw_free( data );
data = NULL;

if (bTime)
{
LPROG(testlog, "fft power of original data time series is: " << pdata);
Expand Down Expand Up @@ -161,6 +165,7 @@ TEST_CASE( "LMCTestSignal with default parameter values (pass)", "[single-file]"
double threshold = 1.e-4;
REQUIRE( fabs( aTestLMCTestSignal.GetPower(aSignal, N0, 1) - aTestLMCTestSignal.GetPower(aSignal, N0, 0) ) < threshold*aTestLMCTestSignal.GetPower(aSignal, N0, 1) );
REQUIRE( fabs( aTestLMCTestSignal.GetPower(aSignal, N0, 1)/N0/50. - pow(aTestLMCTestSignal.GetAmplitude(),2.) ) < threshold*aTestLMCTestSignal.GetPower(aSignal, N0, 1)/N0/50.);
aSignal->Reset();
}


3 changes: 3 additions & 0 deletions Source/Applications/Testing/testMockEGun.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ double GetPower()
}

LPROG(testlog, "E-gun transformed data sum is: " << ptransform/N0);

fftw_destroy_plan(plan);
fftw_free( data );
data = NULL;

return ptransform/N0;

Expand Down
2 changes: 2 additions & 0 deletions Source/Applications/Testing/testMockFreeField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ TEST_CASE( "Mock free space Larmor power. (pass)", "[single-file]" )


fftw_destroy_plan(plan);
fftw_free( data );
data = NULL;


double threshold = 1.e-4;
Expand Down
20 changes: 13 additions & 7 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set( LOCUST_MC_HEADER_FILES
Core/LMCHFSSResponseFileHandler.hh
Core/LMCFIRFileHandler.hh
Core/LMCTFFileHandler.hh
Core/LMCMPIEnvironment.hh

Utilities/LMCUtility.hh
Utilities/LMCCavityUtility.hh
Expand All @@ -34,8 +35,6 @@ set( LOCUST_MC_HEADER_FILES
Generators/LMCTestSignalGenerator.hh
Generators/LMCDecimateSignalGenerator.hh
Generators/LMCLowPassFilterFFTGenerator.hh
Generators/LMCHighPassFilterFFTGenerator.hh
Generators/LMCLocalOscillatorGenerator.hh
Generators/LMCButterworthLPFGenerator.hh

Transmitters/LMCFieldBuffer.hh
Expand Down Expand Up @@ -108,8 +107,6 @@ set( LOCUST_MC_SOURCE_FILES
Generators/LMCTestSignalGenerator.cc
Generators/LMCDecimateSignalGenerator.cc
Generators/LMCLowPassFilterFFTGenerator.cc
Generators/LMCHighPassFilterFFTGenerator.cc
Generators/LMCLocalOscillatorGenerator.cc
Generators/LMCButterworthLPFGenerator.cc


Expand Down Expand Up @@ -146,16 +143,25 @@ set( LOCUST_MC_SOURCE_FILES

)

if (locust_mc_USE_MPI)
set( LOCUST_MC_HEADER_FILES ${LOCUST_MC_HEADER_FILES}
Core/LMCMPIInterface.hh
)

set( LOCUST_MC_SOURCE_FILES ${LOCUST_MC_SOURCE_FILES}
Core/LMCMPIInterface.cc
)
endif (locust_mc_USE_MPI)


if (locust_mc_BUILD_WITH_KASSIOPEIA)
# Here we only need to add the Kassiopeia-dependent header/source files to the header/source-file lists

set( LOCUST_MC_HEADER_FILES ${LOCUST_MC_HEADER_FILES}

Generators/LMCFreeFieldSignalGenerator.hh
Generators/LMCKassSignalGenerator.hh
Generators/LMCArraySignalGenerator.hh
Generators/LMCCavitySignalGenerator.hh

Generators/LMCCavitySignalGenerator.hh

Transmitters/LMCKassTransmitter.hh
Transmitters/LMCKassCurrentTransmitter.hh
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/LMCFIRFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ namespace locust

bool FIRTransmitterHandler::Configure(const scarab::param_node& aParam)
{
int fNModes = 2;
if( aParam.has( "n-modes" ) )
int fNModes = 2;
if( aParam.has( "n-modes" ) )
{
fNModes = aParam["n-modes"]().as_int();
fNModes = aParam["n-modes"]().as_int();
}
if( aParam.has( "fir-transmitter-filename" ) )
{
Expand Down
17 changes: 17 additions & 0 deletions Source/Core/LMCHFSSResponseFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,24 @@ namespace locust
fftw_free(fFIRComplex);
fFIRComplex = NULL;
}


for( int bTE=0; bTE<2; bTE++)
{
for(int l=0; l<fNModes; l++)
{
for(int m=0; m<fNModes; m++)
{
for(int n=0; n<fNModes; n++)
{
fftw_free(fFilterComplexArray[bTE][l][m][n]);
fFilterComplexArray[bTE][l][m][n] = NULL;
}
}
}
}
}

bool TFFileHandlerCore::Configure(const scarab::param_node& aParam)
{
return true;
Expand Down
25 changes: 25 additions & 0 deletions Source/Core/LMCMPIEnvironment.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* MPIEnvironment.hh
*
* Includes MPI and defines common macros.
*
* Created on: 17 Aug 2015
* Author: wolfgang
*/

#ifndef KMPIENVIRONMENT_HH_
#define KMPIENVIRONMENT_HH_

#ifdef KEMFIELD_USE_MPI
#include "KMPIInterface.hh"
#endif

#ifdef KEMFIELD_USE_MPI
#define MPI_SINGLE_PROCESS if (KEMField::KMPIInterface::GetInstance()->GetProcess() == 0)
#define MPI_SECOND_PROCESS if (KEMField::KMPIInterface::GetInstance()->GetProcess() == 1)
#else
#define MPI_SINGLE_PROCESS
#define MPI_SECOND_PROCESS
#endif

#endif /* KMPIENVIRONMENT_HH_ */
Loading

0 comments on commit 615dc0f

Please sign in to comment.