Commit 996faa02 authored by snuverink_j's avatar snuverink_j
Browse files

add some ippl tests to CMake and fix compilation

parent fbc5b473
......@@ -21,18 +21,25 @@ if (ENABLE_DKS)
set (IPPL_LIBS ${IPPL_LIBS} ${DKS_LIBRARY_DIR}/libdks.a)
endif ()
add_executable (TestFFT TestFFT.cpp)
add_executable (TestRC TestRC.cpp)
#add_executable (TestRCGPU TestRCGPU.cpp)
#add_executable (TestRCMIC TestRCMIC.cpp)
add_executable (TestFFTCos TestFFTCos.cpp)
target_link_libraries (TestFFT ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestRC ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
#target_link_libraries (TestRCGPU ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
#target_link_libraries (TestRCMIC ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFTCos ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (fftspeed fftspeed.cpp)
add_executable (TestFFT TestFFT.cpp)
add_executable (TestFFT-1 TestFFT-1.cpp)
add_executable (TestFFT-2 TestFFT-2.cpp)
add_executable (TestFFTCos TestFFTCos.cpp)
add_executable (TestFFTSin TestFFTSin.cpp)
add_executable (TestFFT-XT3 TestFFT-XT3.cpp)
add_executable (TestRC TestRC.cpp)
add_executable (TestRCMIC TestRCMIC.cpp)
target_link_libraries (fftspeed ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFT ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFT-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFT-2 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFTCos ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFTSin ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestFFT-XT3 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestRC ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
target_link_libraries (TestRCMIC ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
# vi: set et ts=4 sw=4 sts=4:
......
......@@ -82,8 +82,8 @@ int main(int argc, char *argv[])
unsigned int nx,ny,nz;
unsigned int nLoop;
bool res = Configure(argc, argv, &nx, &ny, &nz,
&test2do, &serialDim, &processes, &nLoop);
/*bool res = */ Configure(argc, argv, &nx, &ny, &nz,
&test2do, &serialDim, &processes, &nLoop);
// The preceding cpp definition causes compile-time setting of D:
......@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
// Layout information:
e_dim_tag allParallel[D]; // Specifies SERIAL, PARALLEL dims
for (int d=0; d<D; d++)
for (unsigned int d=0; d<D; d++)
allParallel[d] = PARALLEL;
// Compression of temporaries:
......@@ -118,8 +118,8 @@ int main(int argc, char *argv[])
// Complex test Fields
// create standard domain
NDIndex<D> ndiStandard;
for (int d=0; d<D; d++)
ndiStandard[d] = Index(ngrid[d]);
for (unsigned int d=0; d<D; d++)
ndiStandard[d] = Index(ngrid[d]);
// all parallel layout, standard domain, normal axis order
FieldLayout<D> layoutPPStan(ndiStandard,allParallel,processes);
......
......@@ -28,6 +28,9 @@
#include "Ippl.h"
#include <complex>
#include <string>
using namespace std;
enum TestCases {test1,test2};
......@@ -90,8 +93,8 @@ int main(int argc, char *argv[])
static IpplTimings::TimerRef fieldassTimer = IpplTimings::getTimer("field-assigment");
static IpplTimings::TimerRef fieldcompTimer = IpplTimings::getTimer("field-computation");
bool res = Configure(argc, argv, &nx, &ny, &nz,
&test2do, &serialDim, &nLoop);
/*bool res = */ Configure(argc, argv, &nx, &ny, &nz,
&test2do, &serialDim, &nLoop);
// The preceding cpp definition causes compile-time setting of D:
......@@ -109,7 +112,7 @@ int main(int argc, char *argv[])
// Layout information:
e_dim_tag allParallel[D]; // Specifies SERIAL, PARALLEL dims
for (int d=0; d<D; d++)
for (unsigned int d=0; d<D; d++)
allParallel[d] = PARALLEL;
if(serialDim == 0)
......@@ -130,8 +133,8 @@ int main(int argc, char *argv[])
// Complex test Fields
// create standard domain
NDIndex<D> ndiStandard;
for (int d=0; d<D; d++)
ndiStandard[d] = Index(ngrid[d]);
for (unsigned int d=0; d<D; d++)
ndiStandard[d] = Index(ngrid[d]);
// all parallel layout, standard domain, normal axis order
FieldLayout<D> layoutPPStan(ndiStandard,allParallel,Ippl::getNodes());
......
......@@ -31,6 +31,9 @@
#include "Ippl.h"
#include <complex>
#include <string>
using namespace std;
#define THREED
......@@ -104,8 +107,8 @@ int main(int argc, char *argv[])
unsigned int nLoop;
InterPolT interPol;
bool res = Configure(argc, argv, &interPol, &nx, &ny, &nz,
&test2do, &serialDim, &processes, &nLoop);
/*bool res = */ Configure(argc, argv, &interPol, &nx, &ny, &nz,
&test2do, &serialDim, &processes, &nLoop);
// The preceding cpp definition causes compile-time setting of D:
......@@ -119,9 +122,9 @@ int main(int argc, char *argv[])
double realDiff;
// Various counters, constants, etc:
int d;
unsigned int d;
int tag = Ippl::Comm->next_tag(IPPL_APP_TAG0);
/*int tag = */ Ippl::Comm->next_tag(IPPL_APP_TAG0);
double pi = acos(-1.0);
double twopi = 2.0*pi;
......
File mode changed from 100755 to 100644
......@@ -26,7 +26,7 @@ int main(int argc, char *argv[])
double realDiff;
// Various counters, constants, etc:
int d;
unsigned int d;
double pi = acos(-1.0);
double twopi = 2.0*pi;
......
......@@ -13,13 +13,15 @@
#include "Ippl.h"
#include <complex>
#include <string>
#ifdef IPPL_DKS
#include "DKSOPAL.h"
#endif
using namespace std;
bool Configure(int argc, char *argv[],
unsigned int *nx, unsigned int *ny, unsigned int *nz,
int *serialDim, unsigned int *processes, unsigned int *nLoop)
......
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "Only found stub of CMakeList.txt in ${_relPath}")
message (STATUS "Adding ttrack test in ${_relPath}")
include_directories (
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/ippl/src
${CLASSIC_SOURCE_DIR}
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
)
add_compile_options (-std=c++11)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
set (IPPL_LIBS ippl)
if (ENABLE_DKS)
include_directories (${DKS_INCLUDE_DIR})
link_directories (${DKS_LIBRARY_DIR})
#SET (IPPL_LIBS ${IPPL_LIBS} dks)
SET (IPPL_LIBS ${IPPL_LIBS} ${DKS_LIBRARY_DIR}/libdks.a)
endif ()
add_executable (testPwrSpec testPwrSpec.cpp)
target_link_libraries (
testPwrSpec
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
# indent-tabs-mode: nil
# End:
# End:
\ No newline at end of file
......@@ -64,14 +64,14 @@ public:
ChargedParticles(playout_t* pl, BC_t bc, Vector_t hr, Vector_t rmin, Vector_t rmax, e_dim_tag decomp[Dim], bool gCells) :
IpplParticleBase<playout_t>(pl),
bco_m(bc),
hr_m(hr),
rmin_m(rmin),
rmax_m(rmax),
bco_m(bc),
withGuardCells_m(gCells)
{
setupBCs();
for(int i=0; i<Dim; i++)
for(unsigned int i=0; i<Dim; i++)
decomp_m[i]=decomp[i];
}
......@@ -95,7 +95,7 @@ public:
NDIndex<Dim> domain = getFieldLayout().getDomain();
for(int i=0; i<Dim; i++)
for(unsigned int i=0; i<Dim; i++)
nr_m[i] = domain[i].length();
int nx = nr_m[0];
......@@ -130,7 +130,7 @@ public:
private:
inline void setBCAllOpen() {
for (int i=0; i < 2*Dim; i++) {
for (unsigned int i=0; i < 2*Dim; i++) {
this->getBConds()[i] = ParticleNoBCond;
bc_m[i] = new ZeroFace<double ,Dim,Mesh_t,Center_t>(i);
vbc_m[i] = new ZeroFace<Vector_t,Dim,Mesh_t,Center_t>(i);
......@@ -138,7 +138,7 @@ private:
}
inline void setBCAllPeriodic() {
for (int i=0; i < 2*Dim; i++) {
for (unsigned int i=0; i < 2*Dim; i++) {
this->getBConds()[i] = ParticlePeriodicBCond;
bc_m[i] = new PeriodicFace<double ,Dim,Mesh_t,Center_t>(i);
vbc_m[i] = new PeriodicFace<Vector_t,Dim,Mesh_t,Center_t>(i);
......@@ -146,12 +146,12 @@ private:
}
inline void setBCOOP() {
for (int i=0; i < 2*Dim - 2; i++) {
for (unsigned int i=0; i < 2*Dim - 2; i++) {
bc_m[i] = new ZeroFace<double ,Dim,Mesh_t,Center_t>(i);
vbc_m[i] = new ZeroFace<Vector_t,Dim,Mesh_t,Center_t>(i);
this->getBConds()[i] = ParticleNoBCond;
}
for (int i= 2*Dim - 2; i < 2*Dim; i++) {
for (unsigned int i= 2*Dim - 2; i < 2*Dim; i++) {
bc_m[i] = new PeriodicFace<double ,Dim,Mesh_t,Center_t>(i);
vbc_m[i] = new PeriodicFace<Vector_t,Dim,Mesh_t,Center_t>(i);
this->getBConds()[i] = ParticlePeriodicBCond;
......@@ -196,8 +196,8 @@ public:
// constructor and destructor
PwrSpec(Mesh_t *mesh, FieldLayout_t *FL):
layout_m(FL),
mesh_m(mesh)
mesh_m(mesh),
layout_m(FL)
{
Inform msg ("FFT doInit");
......@@ -212,12 +212,12 @@ public:
msg << "GDomain " << gDomain_m << " GDomainL " << gDomainL_m << endl;
for (int i=0; i < 2*Dim; ++i) {
for (unsigned int i=0; i < 2*Dim; ++i) {
bc_m[i] = new ParallelPeriodicFace<T,Dim,Mesh_t,Center_t>(i);
zerobc_m[i] = new ZeroFace<T,Dim,Mesh_t,Center_t>(i);
}
for(int d=0; d<Dim; d++) {
for(unsigned int d=0; d<Dim; d++) {
dcomp_m[d]=layout_m->getRequestedDistribution(d);
nr_m[d] = gDomain_m[d].length();
}
......@@ -404,15 +404,15 @@ int main(int argc, char *argv[]){
NDIndex<Dim> domain;
if (gCells) {
for(int i=0; i<Dim; i++)
for(unsigned int i=0; i<Dim; i++)
domain[i] = domain[i] = Index(nr[i] + 1);
}
else {
for(int i=0; i<Dim; i++)
for(unsigned int i=0; i<Dim; i++)
domain[i] = domain[i] = Index(nr[i]);
}
for (int d=0; d < Dim; ++d)
for (unsigned int d=0; d < Dim; ++d)
decomp[d] = PARALLEL;
// create mesh and layout objects for this problem domain
......
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "Adding test FFT found in ${_relPath}")
message (STATUS "Adding test particle found in ${_relPath}")
include_directories (
${CMAKE_SOURCE_DIR}/src
......@@ -21,7 +21,6 @@ set (IPPL_LIBS ippl)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
if (ENABLE_DKS)
include_directories (${DKS_INCLUDE_DIR})
link_directories (${DKS_LIBRARY_DIR})
#SET (IPPL_LIBS ${IPPL_LIBS} dks)
......@@ -33,8 +32,13 @@ set_source_files_properties(SOURCE PIC3d.cpp p3m3d.cpp
PROPERTY COMPILE_FLAGS
-fno-tree-vrp)
#add_executable (PIC3d PIC3d.cpp)
#target_link_libraries (PIC3d ${IPPL_LIBS})
add_executable (PIC3d PIC3d.cpp)
target_link_libraries (
PIC3d
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (p3m3dHeating p3m3dHeating.cpp)
target_link_libraries (
......@@ -46,14 +50,13 @@ target_link_libraries (
boost_timer
)
#add_executable (p3m3d p3m3d.cpp)
#target_link_libraries (p3m3d ${IPPL_LIBS})
#add_executable (p3m3dleapfrog p3m3dleapfrog.cpp)
#target_link_libraries (p3m3dleapfrog ${IPPL_LIBS})
#add_executable (p3m3dTwoStream p3m3dTwoStream.cpp)
#target_link_libraries (p3m3dTwoStream ${IPPL_LIBS})
add_executable (p3m3d p3m3d.cpp)
target_link_libraries (
p3m3d
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (p3m3dTwoStreamParallel p3m3dTwoStreamParallel.cpp)
target_link_libraries (
......@@ -71,35 +74,29 @@ target_link_libraries (
boost_timer
)
#add_executable (p3m3dMicrobunching p3m3dMicrobunching.cpp)
#target_link_libraries (p3m3dMicrobunching ${IPPL_LIBS} ${H5Hut_LIBRARY} ${HDF5_LIBRARIES} z ${CMAKE_DL_LIBS})
#add_executable (p3m3d_periodic p3m3d_periodic.cpp)
#target_link_libraries (p3m3d_periodic ${IPPL_LIBS})
#add_executable (pm pm.cpp)
#target_link_libraries (pm ${IPPL_LIBS})
#add_executable (pp pp.cpp)
#target_link_libraries (pp ${IPPL_LIBS})
#add_executable (pp_periodic pp_periodic.cpp)
#target_link_libraries (pp_periodic ${IPPL_LIBS})
add_executable (p3m3dMicrobunching p3m3dMicrobunching.cpp)
target_link_libraries (
p3m3dMicrobunching
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
${H5Hut_LIBRARY}
${HDF5_LIBRARIES}
z
boost_timer
)
#add_executable (pm_periodic pm_periodic.cpp)
#target_link_libraries (pm_periodic ${IPPL_LIBS})
add_executable (test-scatter-1 test-scatter-1.cpp)
target_link_libraries (test-scatter-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
#add_executable (domaintest mini_exmpl_domain.cpp)
#target_link_libraries (domaintest ${IPPL_LIBS})
add_executable (salman-1 salman-1.cpp)
target_link_libraries (salman-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
#add_executable (interpolation_test interpolation_test.cpp)
#target_link_libraries (interpolation_test ${IPPL_LIBS})
add_executable (chsr-2 chsr-2.cpp)
target_link_libraries (chsr-2 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
#add_executable (test-scatter-1 test-scatter-1.cpp)
#target_link_libraries (test-scatter-1 ${IPPL_LIBS})
# vi: set et ts=4 sw=4 sts=4:
# Local Variables:
# mode: cmake
# cmake-tab-width: 4
......
......@@ -2,23 +2,8 @@
/***************************************************************************
*
* The IPPL Framework
*
* This program was prepared by PSI.
* All rights in the program are reserved by PSI.
* Neither PSI nor the author(s)
* makes any warranty, express or implied, or assumes any liability or
* responsibility for the use of this software
*
* Visit http://www.acl.lanl.gov/POOMS for more details
*
***************************************************************************/
// -*- C++ -*-
/***************************************************************************
*
* The IPPL Framework
*
* This program was prepared by PSI.
* This program was prepared by PSI.
* All rights in the program are reserved by PSI.
* Neither PSI nor the author(s)
* makes any warranty, express or implied, or assumes any liability or
......@@ -44,7 +29,7 @@
TEST 10: testing field expression and substraction: Field -= ExprElem
TEST 11: testing field expression and multipplication: Field *= ExprElem
TEST 12: testing field expression and division: Field /= ExprElem
TEST 13: testing accumulation with indexed field: IndexingField += IndexingField
TEST 14: testing substraction with indexed field: IndexingField -= IndexingField
TEST 15: testing multipplication with indexed field: IndexingField *= IndexingField
......@@ -64,7 +49,7 @@
TEST 26: testing substraction with IndexingFields on rhs: IndexingField -= ExprElem
TEST 27: testing multipplication with IndexingFields on rhs: IndexingField *= ExprElem
TEST 28: testing divisiond with IndexingFields on rhs: IndexingField /= ExprElem
// testing accumulation: IndexingField += ExprElem
// (with Fields on rhs
......@@ -75,9 +60,9 @@
// A[I][J] += B + C;
// testmsg << A << endl;
usage: chsr-2 <gridSize>
note: gridSize is used for all 6 dimensions in this testprogram
***************************************************************************/
#include "Ippl.h"
......@@ -96,18 +81,18 @@ int n;
const T pi = acos(-1.0);
const T fMax = 1.0; // maximum value for f
void notify( bool passedSingleTest, int *testNum);
void notify( bool passedSingleTest, int *testNum);
void notify( bool passedSingleTest, int *testNum, Timer *t) {
Inform msg;
if (!passedSingleTest)
if (!passedSingleTest)
msg << "test "<< *testNum << " failed" << endl;
else {
msg << "test "<< *testNum << " passed";
msg << " CpuTime= " << t->clock_time() << endl;
}
}
(*testNum)++;
}
......@@ -116,7 +101,7 @@ void notify( bool passedSingleTest, int *testNum, Timer *t) {
int main(int argc, char *argv[]){
Ippl ippl(argc, argv);
Inform msg(argv[0]);
n = atoi(argv[1]);
msg << "Dim=" << Dim << " n= "<< n << " M= " << pow(Dim,n) << endl;
......@@ -126,14 +111,14 @@ int main(int argc, char *argv[]){
const Index L(n), N(n), M(n); // momenta
// Initialize domain objects
NDIndex<Dim> domain, domain1;
domain[0] = n;
domain[1] = n;
domain[2] = n;
domain[3] = n;
domain1[0] = n+1;
domain1[1] = n+1;
domain1[2] = n+1;
......@@ -168,7 +153,7 @@ int main(int argc, char *argv[]){
Field<double,Dim>::iterator fIt;
T a,b,c;
// TEST 1: testing accumulation: Field += Field
a = 0.0; b = 1.0;
......@@ -191,7 +176,7 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 2: testing substraction: Field -= Field
// TEST 2: testing substraction: Field -= Field
a = 0.0; b = 1.0;
timer1.clear();
timer1.start();
......@@ -212,7 +197,7 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 3: testing multipplication: Field *= Field
// TEST 3: testing multipplication: Field *= Field
a = 1.0; b = 2.0;
timer1.clear();
timer1.start();
......@@ -233,7 +218,7 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 4: testing multipplication: Field /= Field
// TEST 4: testing multipplication: Field /= Field
a = 1.0; b = 5.0;
timer1.clear();
timer1.start();
......@@ -255,10 +240,10 @@ int main(int argc, char *argv[]){
// TEST 5: testing scalar addition: Field += T
a = 1.0;
a = 1.0;
timer1.clear();
timer1.start();
A = 0.0;
A = 0.0;
A += a;
timer1.stop();
......@@ -274,10 +259,10 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 6: testing scalar substraction: Field -= T
a = 1.0;
a = 1.0;
timer1.clear();
timer1.start();
A = 2.0;
A = 2.0;
A -= a;
timer1.stop();
......@@ -293,10 +278,10 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 7: testing scalar multipplication: Field *= T
a = 2.0;
a = 2.0;
timer1.clear();
timer1.start();
A = 1.0;
A = 1.0;
A *= a;
timer1.stop();
......@@ -313,10 +298,10 @@ int main(int argc, char *argv[]){
// TEST 8: testing scalar division: Field /= T
a = 2.0;
a = 2.0;
timer1.clear();
timer1.start();
A = 4.0;
A = 4.0;
A /= a;
timer1.stop();
......@@ -332,7 +317,7 @@ int main(int argc, char *argv[]){
// --------------------------------------------
// TEST 9: testing field expression and accumulation: Field += ExprElem
// TEST 9: testing field expression and accumulation: Field += ExprElem
a = 0.0;
b = 1.0;
c = 2.0;
......@@ -345,7 +330,7 @@ int main(int argc, char *argv[]){
timer1.stop();
a += b + c;
passedSingleTest = true;
for (fIt=