Skip to content

Commit

Permalink
Merge pull request #322 from project8/feature/metadata
Browse files Browse the repository at this point in the history
Feature/metadata
  • Loading branch information
pslocum authored Dec 10, 2024
2 parents 70d5886 + 4a77aba commit 68f6026
Show file tree
Hide file tree
Showing 27 changed files with 905 additions and 43 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
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 68f6026

Please sign in to comment.