src issueshttps://gitlab.psi.ch/OPAL/src/-/issues2020-04-30T13:29:10+02:00https://gitlab.psi.ch/OPAL/src/-/issues/531including `cmath` required on macOS2020-04-30T13:29:10+02:00gsellincluding `cmath` required on macOS### Summary
On macOS we have to include `cmath` in several files otherwise compilation fails
### Steps to reproduce
Compile on macOS with current Xcode
### Relevant logs and/or screenshots
```
/Users/gsell/src/OPAL/src/src/Classic/...### Summary
On macOS we have to include `cmath` in several files otherwise compilation fails
### Steps to reproduce
Compile on macOS with current Xcode
### Relevant logs and/or screenshots
```
/Users/gsell/src/OPAL/src/src/Classic/Filters/RelativeFFTLowPass.cpp:28:12: error: call to 'abs' is ambiguous
if(std::abs(LD[i]) > max_four_coef) {
^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:132:6: note:
candidate function
int abs(int) __pure2;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:110:44: note:
candidate function
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:112:44: note:
candidate function
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
```
### Possible fixes
include `cmath`
(If you can, link to the line of code that might be responsible for the problem)OPAL 2.4.0gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/528Add missing ENABLE_AMR2020-04-29T10:10:14+02:00frey_mAdd missing ENABLE_AMRThere's a missing preprocessor directive causing the compilation to fail if AMR is not enabled (i.e. `ENABLE_AMR=FALSE`).
This error was introduced with !312.There's a missing preprocessor directive causing the compilation to fail if AMR is not enabled (i.e. `ENABLE_AMR=FALSE`).
This error was introduced with !312.frey_mfrey_mhttps://gitlab.psi.ch/OPAL/src/-/issues/527runtime error on macOS: uncaught exception of type Teuchos::Exceptions::Inval...2020-07-06T13:48:05+02:00gsellruntime error on macOS: uncaught exception of type Teuchos::Exceptions::InvalidParameterType### Summary
Spiral inflector simulation crashes with uncaught exception (see below) on macOS. On Linux this error does **not** occur!
### Steps to reproduce
Run Daniel spiral inflector simulation
### Relevant logs and/or screenshots...### Summary
Spiral inflector simulation crashes with uncaught exception (see below) on macOS. On Linux this error does **not** occur!
### Steps to reproduce
Run Daniel spiral inflector simulation
### Relevant logs and/or screenshots
```
OPAL> * --------------------------------- Start tracking ------------------------------------ *
libc++abi.dylib: terminating with uncaught exception of type Teuchos::Exceptions::InvalidParameterType: Error! An attempt was made to access parameter "Nullspace" of type "Teuchos::RCP<Xpetra::MultiVector<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace> > >"
in the parameter (sub)list "ANONYMOUS->user data"
using the incorrect type "Teuchos::RCP<Tpetra::MultiVector<double, int, int, Kokkos::Compat::KokkosDeviceWrapperNode<Kokkos::Serial, Kokkos::HostSpace>, false> >"!
```OPAL 2.4.0gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/526Runtime error on macOS: reduction MPI_SUM is not defined on MPI_INTEGER2020-04-29T09:51:03+02:00gsellRuntime error on macOS: reduction MPI_SUM is not defined on MPI_INTEGER### Summary
Runtime error on macOS: reduction MPI_SUM is not defined on MPI_INTEGER
### Steps to reproduce
Run spiral inflector simulation
### What is the current *bug* behavior?
run-time error
### Relevant logs and/or screenshots
...### Summary
Runtime error on macOS: reduction MPI_SUM is not defined on MPI_INTEGER
### Steps to reproduce
Run spiral inflector simulation
### What is the current *bug* behavior?
run-time error
### Relevant logs and/or screenshots
```
OPAL> * --------------------------------- Start tracking ------------------------------------ *
[Nimloth:21640] *** An error occurred in MPI_Scan: the reduction operation MPI_SUM is not defined on the MPI_INTEGER datatype
[Nimloth:21640] *** reported by process [922615809,0]
[Nimloth:21640] *** on communicator MPI_COMM_WORLD
[Nimloth:21640] *** MPI_ERR_OP: invalid reduce operation
[Nimloth:21640] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
[Nimloth:21640] *** and potentially your MPI job)
```
### Possible fixes
`MPI_INTEGER` is a type for Fortran, use `MPI_INT` instead.OPAL 2.4.0gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/524Distribution Unit Tests failing2020-05-27T09:44:41+02:00snuverink_jjochem.snuverink@psi.chDistribution Unit Tests failing### Summary
The distribution unit tests are failing. See also http://amas.web.psi.ch/opal/unitTests/master/results_2020-04-25.xml
### Steps to reproduce
compile OPAL with `BUILD_UNIT_TESTS`
```
./tests/opal_unit_tests --gtest_filter=...### Summary
The distribution unit tests are failing. See also http://amas.web.psi.ch/opal/unitTests/master/results_2020-04-25.xml
### Steps to reproduce
compile OPAL with `BUILD_UNIT_TESTS`
```
./tests/opal_unit_tests --gtest_filter=Binomial*
./tests/opal_unit_tests --gtest_filter=Gauss*
```
### What is the current *bug* behavior?
Segmentation fault
### What is the expected *correct* behavior?
Successful test
### Relevant logs and/or screenshots
```
Ippl> CommMPI: Parent process waiting for children ...
Ippl> CommMPI: Initialization complete.
Note: Google Test filter = Gauss*
[==========] Running 3 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 2 tests from GaussTest
[ RUN ] GaussTest.FullSigmaTest1
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00007fff92fdfa8d in __dynamic_cast ()
(gdb) bt
#0 0x00007fff92fdfa8d in __dynamic_cast ()
#1 0x0000000100567089 in Attributes::setString (attr=@0x105808a00, val=@0x7fff5fbfee80) at /Users/jsnuverink/Documents/OPAL/fork/src/src/Attributes/Attributes.cpp:363
#2 0x0000000100013301 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long () at /opt/local/libexec/llvm-9.0/include/c++/v1/string:37
#3 0x0000000100013301 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string () at /Users/jsnuverink/Documents/OPAL/fork/src/tests/opal_src/Distribution/GaussTest.cpp:2137
#4 0x0000000100013301 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string () at /opt/local/libexec/llvm-9.0/include/c++/v1/string:2133
#5 0x0000000100013301 in GaussTest_FullSigmaTest1_Test::TestBody () at /Users/jsnuverink/Documents/OPAL/fork/src/tests/opal_src/Distribution/GaussTest.cpp:37
#6 0x0000000100b7ef03 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::TestSuite, void> () at gtest.cc:2433
#7 0x0000000100b63757 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x104600c80, method=not implemented: member type in c_val_print
) at gtest.cc:2469
#8 0x0000000100b23932 in testing::Test::Run (this=0x104600c80) at gtest.cc:2508
#9 0x0000000100b2533a in testing::TestInfo::Run (this=0x104414330) at gtest.cc:2684
#10 0x0000000100b263af in testing::TestSuite::Run (this=0x1044144a0) at gtest.cc:2816
#11 0x0000000100b3efe9 in testing::internal::UnitTestImpl::RunAllTests (this=0x104412ff0) at gtest.cc:5338
#12 0x0000000100b7fe73 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x104412ff0, method=not implemented: member type in c_val_print
) at gtest.cc:2433
#13 0x0000000100b65bd7 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x104412ff0, method=not implemented: member type in c_val_print
) at gtest.cc:2469
#14 0x0000000100b3e902 in testing::UnitTest::Run (this=0x100d863a0) at gtest.cc:4925
#15 0x0000000100003502 in RUN_ALL_TESTS () at /opt/local/include/gtest/gtest.h:2473
```
### Possible fixes
The Distribution attribute `TYPE` has been changed in !341 to uppercase. All setString methods should be changed in setUpperCaseString.
```
Attributes::setString(dist.itsAttr[Attrib::Distribution::TYPE], "GAUSS");
```
to
```
Attributes::setUpperCaseString(dist.itsAttr[Attrib::Distribution::TYPE], "GAUSS");
```OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/515Not all (Opal-T) field maps expect same origin for position2020-07-16T22:35:05+02:00krausNot all (Opal-T) field maps expect same origin for positionIn the method `getFieldstrength` some field maps expect the origin of the position at which the field should be evaluated to be at the beginning of the field map others at the origin of the element (`z = 0` in the field map).
All field ...In the method `getFieldstrength` some field maps expect the origin of the position at which the field should be evaluated to be at the beginning of the field map others at the origin of the element (`z = 0` in the field map).
All field maps should expect the position to be at the origin of the element.krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/514Fix error message in MGPoissonSolver2020-05-08T13:50:00+02:00frey_mFix error message in MGPoissonSolverThe following discussion from !327 should be addressed:
- [ ] @snuverink_j started a [discussion](https://gitlab.psi.ch/OPAL/src/merge_requests/327#note_20154):
> This message seems completely wrong. Can you fix it (or resolve by ...The following discussion from !327 should be addressed:
- [ ] @snuverink_j started a [discussion](https://gitlab.psi.ch/OPAL/src/merge_requests/327#note_20154):
> This message seems completely wrong. Can you fix it (or resolve by opening a new issue?)
```cpp
throw OpalException("ArbitraryDomain::compute",
"The class ArbitraryDomain only works with parallelization\n"
"in z-direction.\n"
"Please set PARFFTX=FALSE, PARFFTY=FALSE, PARFFTT=TRUE in \n"
"the definition of the field solver in the input file.\n");
```OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/513Improving reading of pressure data2020-07-06T11:54:52+02:00ext-calvo_ppedro.calvo@ciemat.esImproving reading of pressure dataThe pressure data from field map include holes from components as part of the geometry. To skip the LogicalError when particles hit with boundaries of the geometry (with pressure value null), the `checkPressure` function has been improvedThe pressure data from field map include holes from components as part of the geometry. To skip the LogicalError when particles hit with boundaries of the geometry (with pressure value null), the `checkPressure` function has been improvedOPAL 2.4.0ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/512compiler errors in tests/ippl_src with clang92021-01-13T22:09:20+01:00snuverink_jjochem.snuverink@psi.chcompiler errors in tests/ippl_src with clang9### Summary
Compiler errors with clang with `BUILD_OPAL_UNIT_TESTS=ON`
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/...### Summary
Compiler errors with clang with `BUILD_OPAL_UNIT_TESTS=ON`
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
```
### Relevant logs and/or screenshots
```
src/tests/ippl_src/Field/Field.cpp:1205:57: error: using integer absolute
value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
Vektor<unsigned,D3> N(static_cast<unsigned> (ceil( (abs(boxMin[0])+boxMax[0])/h[0])),
^
src/tests/ippl_src/Field/Field.cpp:1205:57: note: use function 'std::abs'
instead
```OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/511Link error if OpenMP is enabled2020-04-16T15:42:52+02:00gsellLink error if OpenMP is enabled### Summary
The linker reports undefined symbols if OpenMP is enabled.
### Steps to reproduce
```
cmake -DENABLE_OPENMP=TRUE ...
```
### What is the current *bug* behavior?
```
libOPAL.a(EnvelopeBunch.cpp.o): En la función `Envelo...### Summary
The linker reports undefined symbols if OpenMP is enabled.
### Steps to reproduce
```
cmake -DENABLE_OPENMP=TRUE ...
```
### What is the current *bug* behavior?
```
libOPAL.a(EnvelopeBunch.cpp.o): En la función `EnvelopeBunch::calcI() [clone ._omp_fn.0]':
EnvelopeBunch.cpp:(.text+0x82): referencia a `omp_get_num_threads' sin definir
EnvelopeBunch.cpp:(.text+0x89): referencia a `omp_get_thread_num' sin definir
libOPAL.a(EnvelopeBunch.cpp.o): En la función `EnvelopeBunch::calcI()':
EnvelopeBunch.cpp:(.text+0x9451): referencia a `GOMP_parallel' sin definir
../ippl/src/libippl.a(CommMPI.cpp.o): En la función `CommMPI::CommMPI(int&, char**&, int, bool, ompi_communicator_t*)':
CommMPI.cpp:(.text+0xf40): referencia a `omp_get_max_threads' sin definir
collect2: error: ld devolvió el estado de salida 1
make[2]: *** [src/CMakeFiles/opal.dir/build.make:117: src/opal] Error 1
make[1]: *** [CMakeFiles/Makefile2:738: src/CMakeFiles/opal.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
```
### Possible fixes
Set `-fopenmp` as a linker option.OPAL 2.4.0gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/510compiler errors in ippl/test with clang92020-04-17T09:43:25+02:00snuverink_jjochem.snuverink@psi.chcompiler errors in ippl/test with clang9### Summary
Reported by @adelmann.
Compiler errors with clang with `ENABLE_IPPLTESTS=ON`
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for worki...### Summary
Reported by @adelmann.
Compiler errors with clang with `ENABLE_IPPLTESTS=ON`
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
```
### Relevant logs and/or screenshots
```
clang: error: optimization flag '-fno-tree-vrp'
```
```
ippl/test/particle/p3m3d.cpp:170:72: error: implicit instantiation of
undefined template 'ApplyField<double>'
HPB.for_each(RadiusCondition<double, Dim>(interaction_radius), ApplyField<double>(-1,interaction_radius));
```
```
ippl/test/particle/ChargedParticleFactory.hpp:564:73: error: unused
parameter 'extend_l' [-Werror,-Wunused-parameter]
void createParticleDistributionEquiPart(Particles & P, Vektor<double,3> extend_l, Vektor<double,3> extend_r...
```
### Possible fixes
* remove the `-fno-tree-vrp` flag
* comment out function parameters
* reorder code to avoid undefined template errorOPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/509OrbitThreader::computeMaximalImplicitDrift not yielding correct results2020-07-22T09:47:42+02:00krausOrbitThreader::computeMaximalImplicitDrift not yielding correct results### Summary
The method OrbitThreader::computeMaximalImplicitDrift doesn't yield correct results if elements are placed in 3D in the input file.
### Steps to reproduce
Download and unpack the attached [tar file](/uploads/b1fb3a7ed314c...### Summary
The method OrbitThreader::computeMaximalImplicitDrift doesn't yield correct results if elements are placed in 3D in the input file.
### Steps to reproduce
Download and unpack the attached [tar file](/uploads/b1fb3a7ed314c1a6d3141f6a4fa53646/3dplacedElement.tgz) and then run it with the current master version of OPAL.
### What is the current *bug* behavior?
The rotated quadrupole in the beam line is neglected in the output of the orbit threader and stops tracking after the second element.
### What is the expected *correct* behavior?
OPAL should track the beam through all elements.
### Relevant logs and/or screenshots
### Possible fixes
Track with a single particle until it leaves the bounding box which encloses all elements.
(If you can, link to the line of code that might be responsible for the problem)OPAL 2.4.0krauskraus2020-07-24https://gitlab.psi.ch/OPAL/src/-/issues/494Orbit threader throws an exception when TRACKBACK = TRUE and traveling wave s...2020-06-20T13:33:16+02:00krausOrbit threader throws an exception when TRACKBACK = TRUE and traveling wave structure present### Summary
When tracking the bunch back in time through a traveling wave structure then an exception is thrown in the method `TravelingWave::trackOnAxisParticle` which is used in the OrbitThreader.
### Steps to reproduce
Set `TRACK...### Summary
When tracking the bunch back in time through a traveling wave structure then an exception is thrown in the method `TravelingWave::trackOnAxisParticle` which is used in the OrbitThreader.
### Steps to reproduce
Set `TRACKBACK = TRUE` and add a traveling wave to the beamline.
### What is the current *bug* behavior?
Throws an exception.
### What is the expected *correct* behavior?
It should track the bunch back in time through a TWS.
### Possible fixes
Don't override the method of the base class RFCavity.OPAL 2.4.0krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/493Template directory not found when path contains spaces2020-03-31T17:10:45+02:00bellotti_rTemplate directory not found when path contains spacesFor OPAL sampler runs, the template file is not found when the path contains spaces. This could be easily solved by adding quotes `"` around the template directory path.For OPAL sampler runs, the template file is not found when the path contains spaces. This could be easily solved by adding quotes `"` around the template directory path.OPAL 2.4.0krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/490BEAM without particles specified crashes2020-07-06T08:44:02+02:00snuverink_jjochem.snuverink@psi.chBEAM without particles specified crashes### Summary
When the `BEAM` command has no particles (`NPARTS`) specified, OPAL crashes.
### Steps to reproduce
[drift-noparts.in](/uploads/a9848fe46eceb6059924d5971f621442/drift-noparts.in)
### What is the current *bug* behavior?
C...### Summary
When the `BEAM` command has no particles (`NPARTS`) specified, OPAL crashes.
### Steps to reproduce
[drift-noparts.in](/uploads/a9848fe46eceb6059924d5971f621442/drift-noparts.in)
### What is the current *bug* behavior?
Crash.
### What is the expected *correct* behavior?
Exit with error that no particles are specified.
### Relevant logs and/or screenshots
traceback:
```
Program received signal SIGSEGV, Segmentation fault.
Distribution::createOpalT(PartBunchBase<double, 3u>*, unsigned long&) ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Distribution/Distribution.cpp:2820
2820 double maxTOrZ = *longIt;
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.212.el6.x86_64 infinipath-psm-3.0.1-115.1015_open.2.el6.x86_64 libnl-1.1.4-2.el6.x86_64 nss-pam-ldapd-0.7.5-20.el6_6.3.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0 Distribution::createOpalT(PartBunchBase<double, 3u>*, unsigned long&) ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Distribution/Distribution.cpp:2820
#1 0x0000000000885814 in TrackRun::setDistributionParallelT(Beam*) ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Classic/Algorithms/PartBunchBase.hpp:254
#2 0x000000000088861f in TrackRun::setupTTracker() () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Track/TrackRun.cpp:505
#3 0x000000000088914c in TrackRun::execute() () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Track/TrackRun.cpp:197
#4 0x00000000006ea0aa in OpalParser::execute(Object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:139
#5 0x00000000006ee452 in OpalParser::parseAction(Statement&) const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:172
#6 0x00000000006edcf3 in OpalParser::parse(Statement&) const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:90
#7 0x00000000006e9d4c in OpalParser::run() const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:607
#8 0x000000000088276a in TrackCmd::execute() () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Track/TrackCmd.cpp:212
#9 0x00000000006ea0aa in OpalParser::execute(Object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:139
#10 0x00000000006ee452 in OpalParser::parseAction(Statement&) const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:172
#11 0x00000000006edcf3 in OpalParser::parse(Statement&) const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:90
#12 0x00000000006e9d4c in OpalParser::run() const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:607
#13 0x00000000006eeb90 in OpalParser::run(TokenStream*) const ()
at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/OpalParser/OpalParser.cpp:632
#14 0x0000000000642812 in main () at /home/scratch/OPAL/OPAL-fork/OPAL-src/src/Main.cpp:360
```
### Possible fixes
The method that crashes, takes the first entry without checking its size:
https://gitlab.psi.ch/OPAL/src/blob/master/src/Distribution/Distribution.cpp#L2817
```cpp
double Distribution::getMaxTOrZ() {
std::vector<double>::iterator longIt = tOrZDist_m.begin();
double maxTOrZ = *longIt;
```
This should be fixed. But in addition, it would be good to catch this when parsing, and OPAL can exit with an exception.OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/489clang compiler warnings in unit tests2020-03-18T21:09:58+01:00snuverink_jjochem.snuverink@psi.chclang compiler warnings in unit testsThere are some clang (9.0.1) compiler warnings (-Wunused, -Wuninitialized) in the unit tests.There are some clang (9.0.1) compiler warnings (-Wunused, -Wuninitialized) in the unit tests.OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/488clang compiler error: unmatched template parameter `const CenteringEnum*`2020-03-18T10:54:28+01:00snuverink_jjochem.snuverink@psi.chclang compiler error: unmatched template parameter `const CenteringEnum*`### Summary
Clang compiler errors for ippl unit test BCond.
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/m...### Summary
Clang compiler errors for ippl unit test BCond.
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
```
### Relevant logs and/or screenshots
```
[ 97%] Building CXX object tests/CMakeFiles/opal_unit_tests.dir/ippl_src/Field/BCond.cpp.o
In file included from /Users/jsnuverink/Documents/OPAL/fork/src/tests/ippl_src/Field/BCond.cpp:7:
In file included from /Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.h:127:
/Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.hpp:313:3: error: no matching
function for call to 'centeredInitialize'
centeredInitialize(*this, mesh, p, vnodes);
^~~~~~~~~~~~~~~~~~
/Users/jsnuverink/Documents/OPAL/fork/src/tests/ippl_src/Field/BCond.cpp:411:38: note: in instantiation of member
function 'CenteredFieldLayout<2, UniformCartesian<2, double>, CartesianCentering<&CCCEnums<2, 2,
0>::vectorFace, 2, 2> >::CenteredFieldLayout' requested here
CenteredFieldLayout<Dim,M,vFace> layoutVFace(mesh);
^
/Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.hpp:93:1: note: candidate
template ignored: substitution failure : deduced non-type template argument does not have the same type as
the corresponding template parameter ('CenteringEnum *' vs 'const CenteringEnum *')
centeredInitialize(CenteredFieldLayout<Dim,Mesh,
^
...
```
### Possible fixes
The template parameter CenteringEnum* always has a const qualifier, for example,
https://gitlab.psi.ch/OPAL/src/blob/master/ippl/src/Meshes/CartesianCentering.h#L35:
```c++
template<const CenteringEnum* CE, unsigned Dim, unsigned NComponents=1U>
class CartesianCentering
{
```
However the const qualifier seems too restrictive and I propose to remove it.OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/487Clang compiler warning for IntTSC (-Wsign-compare)2020-03-20T11:54:33+01:00snuverink_jjochem.snuverink@psi.chClang compiler warning for IntTSC (-Wsign-compare)### Summary
Clang compiler warning for IntTSC (-Wsign-compare).
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/b...### Summary
Clang compiler warning for IntTSC (-Wsign-compare).
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
```
### Relevant logs and/or screenshots
```
ippl/src/Particle/IntTSC.h:284:8: error: comparison of integers of
different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
if (p==-1) return .125*(1.-4.*dpos(i)+4.*dpos(i)*dpos(i));
~^ ~~
```
and many similar ones
### Possible fixes
The warning comes from
https://gitlab.psi.ch/OPAL/src/blob/master/ippl/src/Particle/IntTSC.h#L283
```c
auto W = [dpos](unsigned p, unsigned i) {
if (p==-1) return .125*(1.-4.*dpos(i)+4.*dpos(i)*dpos(i));
else if (p==0) return .25*(3.-4.*dpos(i)*dpos(i));
else if (p==+1) return .125*(1.+4.*dpos(i)+4.*dpos(i)*dpos(i)); };
```
`p` should be a signed integer instead of unsiged.OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/485clang compiler errors for MPI_AllReduce (-Wtype-safety)2020-03-18T14:13:52+01:00snuverink_jjochem.snuverink@psi.chclang compiler errors for MPI_AllReduce (-Wtype-safety)### Summary
Clang compiler errors with MPI_AllReduce (-Wtype-safety)
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/lo...### Summary
Clang compiler errors with MPI_AllReduce (-Wtype-safety)
### Steps to reproduce
```
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
```
### Relevant logs and/or screenshots
1.
```
src/Algorithms/ParallelSliceTracker.cpp:291:41: error: argument type
'bool *' doesn't match specified 'MPI' type tag that requires 'int *' [-Werror,-Wtype-safety]
MPI_Allreduce(MPI_IN_PLACE, &globalEOL_m, 1, MPI_INT, MPI_LAND, Ippl::getComm());
^~~~~~~~~~~~ ~~~~~~~
```
2.
```
src/Algorithms/bet/EnvelopeBunch.cpp:1458:33: error: argument type
'size_t *' (aka 'unsigned long *') doesn't match specified 'MPI' type tag that requires 'long *'
[-Werror,-Wtype-safety]
MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_LONG, MPI_SUM, Ippl::getComm());
^~~~~~ ~~~~~~~~
```
3. some more similar to 2.
### Possible fixes
1.
https://gitlab.psi.ch/OPAL/src/blob/4868efe8cf31c3646c49387a293852acf215c2bb/src/Algorithms/ParallelSliceTracker.cpp#L291
```c++
MPI_Allreduce(MPI_IN_PLACE, &globalEOL_m, 1, MPI_INT, MPI_LAND, Ippl::getComm());
```
`globalEOL_m` is a boolean and this doesn't combine properly with `MPI_INT`.
Instead, the commented out line above:
```
reduce(&globalEOL_m, &globalEOL_m + 1, &globalEOL_m, OpBitwiseAndAssign());
```
compiles fine.
@kraus: there is a similar line in `ParallelTTracker.cpp`. Is that line correct in this case as well?
2.
https://gitlab.psi.ch/OPAL/src/blob/4868efe8cf31c3646c49387a293852acf215c2bb/src/Algorithms/bet/EnvelopeBunch.cpp#L1458
```c++
MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_LONG, MPI_SUM, Ippl::getComm());
```
should rather be:
```c++
MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_UNSIGNED_LONG, MPI_SUM, Ippl::getComm());
```OPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/484clang compiler error for VerticalFFAMagnet (-Wabsolute-value)2020-03-17T10:48:05+01:00snuverink_jjochem.snuverink@psi.chclang compiler error for VerticalFFAMagnet (-Wabsolute-value)### Summary
Compiler error for VerticalFFAMagnet
### Steps to reproduce
```
Host OS System: Darwin-14.5.0
The C++ compiler identification is: AppleClang
The C++ compiler version is: 7.0.2.7000181
```
### Relevant logs and/or screensh...### Summary
Compiler error for VerticalFFAMagnet
### Steps to reproduce
```
Host OS System: Darwin-14.5.0
The C++ compiler identification is: AppleClang
The C++ compiler version is: 7.0.2.7000181
```
### Relevant logs and/or screenshots
```
src/Classic/AbsBeamline/VerticalFFAMagnet.cpp:82:9: error:
using integer absolute value function 'abs' when argument is of floating point type
[-Werror,-Wabsolute-value]
if (abs(R[0]) > halfWidth_m ||
^
/Users/jsnuverink/Documents/OPAL/fork/src/src/Classic/AbsBeamline/VerticalFFAMagnet.cpp:82:9: note:
use function 'std::abs' instead
if (abs(R[0]) > halfWidth_m ||
^~~
std::abs
```
### Possible fixes
Use `std::` namespaceOPAL 2.4.0snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.ch