src issueshttps://gitlab.psi.ch/OPAL/src/-/issues2022-09-21T15:16:30+02:00https://gitlab.psi.ch/OPAL/src/-/issues/738Fix some uninitialized variables2022-09-21T15:16:30+02:00muralikrishnanFix some uninitialized variablesSome of the newly added quantities such as temperature, DebyeLength and plasma parameter in the stat file were uninitialized. Since during emission we do not compute them this may cause an issue.Some of the newly added quantities such as temperature, DebyeLength and plasma parameter in the stat file were uninitialized. Since during emission we do not compute them this may cause an issue.2022.1muralikrishnanmuralikrishnanhttps://gitlab.psi.ch/OPAL/src/-/issues/736Trimcoil implementation bug2023-02-13T15:50:53+01:00snuverink_jjochem.snuverink@psi.chTrimcoil implementation bug### Summary
In #276 and !53 a trim coil range in the azimuthal direction was introduced. However, this was not properly tested and it contained a bug, that was discovered by @zhang_h.
### What is the current *bug* behavior?
The trim c...### Summary
In #276 and !53 a trim coil range in the azimuthal direction was introduced. However, this was not properly tested and it contained a bug, that was discovered by @zhang_h.
### What is the current *bug* behavior?
The trim coils do not work anymore.
### What is the expected *correct* behavior?
Trim coils working as normal.
### Possible fixes
The bug was introduced in 77c975dcca3b99cf195cbf020d5039f8be745646, specifically in line
https://gitlab.psi.ch/OPAL/src/-/blob/160558d02705876d15775fe7527227a142bc2088/src/Classic/AbsBeamline/Cyclotron.cpp#L101
the order of the arguments is wrong, see also https://gitlab.psi.ch/OPAL/src/-/blob/0601ed262da6cd29690abff38053c900f9bafacc/src/Classic/TrimCoils/TrimCoil.cpp#L432022.1snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/734SDDS wake function read error2022-09-14T11:28:20+02:00adelmannSDDS wake function read errorError>
Error> *** User error detected by function "Attributes::getString()"
Error> Attribute "FNAME" is not string.
Error> Attribute "FNAME" is not string.
application called MPI_Abort(MPI_COMM_WORLD, -100) - process 0
[unset]: ...Error>
Error> *** User error detected by function "Attributes::getString()"
Error> Attribute "FNAME" is not string.
Error> Attribute "FNAME" is not string.
application called MPI_Abort(MPI_COMM_WORLD, -100) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=-100
wakecorr: WAKE, TYPE="LONG-SHORT-RANGE", NBIN=500, FNAME="testWake220GHz.sdds" ;2022.1https://gitlab.psi.ch/OPAL/src/-/issues/730OPAL (master) gives a segfault when ending2022-09-14T11:29:06+02:00ext-piot_pOPAL (master) gives a segfault when ending### Summary
The most recent master version compiles fine on fedora fc35 but it gives a segfault upon finishing
A checkout of the OPAL-2011-1 compile on the same distro works just fine.
### Steps to reproduce the failure
git check out ...### Summary
The most recent master version compiles fine on fedora fc35 but it gives a segfault upon finishing
A checkout of the OPAL-2011-1 compile on the same distro works just fine.
### Steps to reproduce the failure
git check out
git checkout master
cd ../master
CC=mpicc CXX=mpicxx cmake ../src/ -DHDF5_C_COMPILER_EXECUTABLE=/usr/lib64/openmpi/bin/h5pcc -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_FLAGS="-Wno-error=cast-function-type -Wno-cast-function-type -Wl,--copy-dt-needed-entries"
make -j 24
cd ../example
mpirun -np 8 ../master/src/opal awaDrive_all.in
### What is the current *bug* behavior?
```
Timings{0}> WakeField........... Wall max = 0, CPU max = 0
Timings{0}> Wall avg = 0, CPU avg = 0
Timings{0}> Wall min = 0, CPU min = 0
Timings{0}>
Timings{0}> Write H5-File....... Wall max = 2.27603, CPU max = 1.23
Timings{0}> Wall avg = 2.27519, CPU avg = 1.115
Timings{0}> Wall min = 2.27071, CPU min = 1.03
Timings{0}>
Timings{0}> Write Stat.......... Wall max = 0.105094, CPU max = 0.07
Timings{0}> Wall avg = 0.0356317, CPU avg = 0.02625
Timings{0}> Wall min = 0.0245887, CPU min = 0
Timings{0}>
Timings{0}> -----------------------------------------------------------------
[localhost:356319:0:356319] Caught signal 11 (Segmentation fault: address not mapped to object at address (nil))
[localhost:356320:0:356320] Caught signal 11 (Segmentation fault: address not mapped to object at address (nil))
[localhost:356318:0:356318] Caught signal 11 (Segmentation fault: address not mapped to object at address (nil))
[localhost:356321:0:356321] Caught signal 11 (Segmentation fault: address not mapped to object at address (nil))
==== backtrace (tid: 356320) ====
0 /lib64/libucs.so.0(ucs_handle_error+0x2a4) [0x7f1d48c29864]
1 /lib64/libucs.so.0(+0x2a41d) [0x7f1d48c2d41d]
2 /lib64/libucs.so.0(+0x2a5fa) [0x7f1d48c2d5fa]
3 opal() [0xc8f6c0]
4 opal() [0x910701]
5 opal() [0x7eb18c]
6 opal() [0xb935d9]
7 opal() [0x918acf]
8 opal() [0xa1a7af]
9 opal() [0x72c16a]
10 opal() [0x72c189]
11 opal() [0x6f368a]
12 /lib64/libc.so.6(+0x57a15) [0x7f1d4d257a15]
13 /lib64/libc.so.6(on_exit+0) [0x7f1d4d257b90]
14 /lib64/libc.so.6(+0x40447) [0x7f1d4d240447]
15 /lib64/libc.so.6(__libc_start_main+0x80) [0x7f1d4d2404f0]
16 opal() [0x4abbd5]
=================================
==== backtrace (tid: 356319) ====
0 /lib64/libucs.so.0(ucs_handle_error+0x2a4) [0x7fa60d660864]
1 /lib64/libucs.so.0(+0x2a41d) [0x7fa60d66441d]
2 /lib64/libucs.so.0(+0x2a5fa) [0x7fa60d6645fa]
3 opal() [0xc8f6c0]
4 opal() [0x910701]
5 opal() [0x7eb18c]
6 opal() [0xb935d9]
7 opal() [0x918acf]
```
### What is the expected *correct* behavior?
git check out git checkout OPAL-2011-1
cd ../OPAL-2011-1
CC=mpicc CXX=mpicxx cmake ../src/ -DHDF5_C_COMPILER_EXECUTABLE=/usr/lib64/openmpi/bin/h5pcc -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_FLAGS="-Wno-error=cast-function-type -Wno-cast-function-type -Wl,--copy-dt-needed-entries"
make -j 24
cd ../example
mpirun -np 8 ../OPAL-2011-1/src/opal awaDrive_all.in
works fine
### Relevant logs and/or screenshots
the input file I use are the AWA photoinjector; the specific version is available at https://xgitlab.cels.anl.gov/awa/awa-opal-lattices2022.1https://gitlab.psi.ch/OPAL/src/-/issues/728Error in AsymmetricEnge derivatives2022-09-14T13:27:24+02:00ext-rogers_cError in AsymmetricEnge derivativesI found a bug in the AsymmetricEnge derivatives. Should be like:
```
f(x) = E(x-x0) + E(-x-x0) - 1
f^{(2n)} = E^{(2n)}(x-x0) + E^{(2n)}(-x-x0)
f^{(2n+1)} = E^{(2n)}(x-x0) - E^{(2n)}(-x-x0)
```
but I forgot to include the higher derivat...I found a bug in the AsymmetricEnge derivatives. Should be like:
```
f(x) = E(x-x0) + E(-x-x0) - 1
f^{(2n)} = E^{(2n)}(x-x0) + E^{(2n)}(-x-x0)
f^{(2n+1)} = E^{(2n)}(x-x0) - E^{(2n)}(-x-x0)
```
but I forgot to include the higher derivatives code.2022.1ext-rogers_cext-rogers_chttps://gitlab.psi.ch/OPAL/src/-/issues/727Hard coded momentum tolerance2023-08-30T10:35:27+02:00ext-rogers_cHard coded momentum tolerance### Summary
In Opal-Cycl, there is a hardcoded parameter which requires the mean beam momentum to be within 1e-2 of the reference particle momentum. This is completely inappropriate for many simulations.
### Steps to reproduce
Run a l...### Summary
In Opal-Cycl, there is a hardcoded parameter which requires the mean beam momentum to be within 1e-2 of the reference particle momentum. This is completely inappropriate for many simulations.
### Steps to reproduce
Run a lattice with PC != mean momentum of the beam
### What is the current *bug* behavior?
Opal throws an exception. This comes from line 2411 of ParallelCyclotronTracker.cpp
### What is the expected *correct* behavior?
Really, opal should not throw an exception at all. There are many use cases where the reference momentum does not want to be the same as the actual distribution. At the very least the tolerance should be soft coded.
### Relevant logs and/or screenshots
Line 2414 of src/Algorithms/ParallelCyclotronTracker.cpp
```
if (std::abs(pTotalMean - referencePtot) / pTotalMean > 1e-2) { // ROGERS BUG; 1e-2 should be user parameter
throw OpalException("ParallelCyclotronTracker::checkFileMomentum",
"The total momentum of the particle distribution\n"
"in the global reference frame: " +
std::to_string(pTotalMean) + ",\n"
"is different from the momentum given\n"
"in the \"BEAM\" command: " +
std::to_string(referencePtot) + ".\n"
"In Opal-cycl the initial distribution\n"
"is specified in the local reference frame.\n"
"When using a \"FROMFILE\" type distribution, the momentum \n"
"must be the same as the specified in the \"BEAM\" command,\n"
"which is in global reference frame.");
}
```
I guess easiest would be to add a tolerance parameter to the FROMFILE distribution type. Default to 1e-2.2023.1ext-rogers_cext-rogers_chttps://gitlab.psi.ch/OPAL/src/-/issues/726OPAL compilation fails2022-07-26T17:47:43+02:00ext-calvo_ppedro.calvo@ciemat.esOPAL compilation failsSince MR !579 the [compilation of OPAL](http://amas.web.psi.ch/opal/master/output/2022-07-14_10-49.txt) is failing. I am not sure if the Python configuration has been completed.Since MR !579 the [compilation of OPAL](http://amas.web.psi.ch/opal/master/output/2022-07-14_10-49.txt) is failing. I am not sure if the Python configuration has been completed.2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/725test_field.py failing test2022-07-18T10:26:54+02:00ext-rogers_ctest_field.py failing testTest is failing:
tests/opal_src/PyOpal/PyObjects/test_field.py
Segmentation fault because Ring.cpp refPartBunch_m is set to nullptr during Ring::finalise(). The refPartBunch_m is a borrowed reference and can be left as not null.Test is failing:
tests/opal_src/PyOpal/PyObjects/test_field.py
Segmentation fault because Ring.cpp refPartBunch_m is set to nullptr during Ring::finalise(). The refPartBunch_m is a borrowed reference and can be left as not null.2022.1ext-rogers_cext-rogers_chttps://gitlab.psi.ch/OPAL/src/-/issues/724Fix particle deletion by beam stripping interactions2022-07-13T13:47:19+02:00ext-calvo_ppedro.calvo@ciemat.esFix particle deletion by beam stripping interactionsThe deletion of the particles is performed differently in Opal-cycl and Opal-t. Therefore, the call to `destroyT` in beam stripping algorithm must be restricted to simulations in Opal-t. Opal-cycl remove particles from the bunch in a spe...The deletion of the particles is performed differently in Opal-cycl and Opal-t. Therefore, the call to `destroyT` in beam stripping algorithm must be restricted to simulations in Opal-t. Opal-cycl remove particles from the bunch in a specific method in `ParallelCyclotronTracker`2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/721error: variable set but not used2022-09-14T11:30:36+02:00adelmannerror: variable set but not usedNew clang is very picky: variable set but not used
./400-build-opal: error in compiling the software!New clang is very picky: variable set but not used
./400-build-opal: error in compiling the software!2022.1adelmannadelmannhttps://gitlab.psi.ch/OPAL/src/-/issues/720anonymous non-C-compatible type given name for linkage purposes by typedef de...2022-07-07T13:13:10+02:00adelmannanonymous non-C-compatible type given name for linkage purposes by typedef declaration;### Summary
Compile master with clang 13.1.6
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
### Steps to reproduce
Compile build-recipes
### What is the current *bug* behavior?
...### Summary
Compile master with clang 13.1.6
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
### Steps to reproduce
Compile build-recipes
### What is the current *bug* behavior?
compilation results in error
### What is the expected *correct* behavior?
obvious
### Relevant logs and/or screenshots
''' /Users/adelmann/OPAL/tmp/src/OPAL/OPAL-2021.1.0/optimizer/Util/Types.h:65:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage]
typedef struct {
'''
### Possible fixes
name the struct2022.1adelmannadelmann2022-06-30https://gitlab.psi.ch/OPAL/src/-/issues/719ScalingFFAMagnet still using wrong units2022-07-18T10:27:39+02:00ext-rogers_cScalingFFAMagnet still using wrong unitsScalingFFAMagnet still seems to be using kG. Note the manual says it is Tesla.ScalingFFAMagnet still seems to be using kG. Note the manual says it is Tesla.2022.1ext-rogers_cext-rogers_chttps://gitlab.psi.ch/OPAL/src/-/issues/718Wrong particle counting in CCollimator with particle-matter interactions2022-06-30T11:45:47+02:00ext-calvo_ppedro.calvo@ciemat.esWrong particle counting in CCollimator with particle-matter interactionsThe following discussion from !577 should be addressed:
- @ext-calvo_p started a [discussion](https://gitlab.psi.ch/OPAL/src/-/merge_requests/577#note_38608): (+1 comment)
> There is an additional problem with particle counting. T...The following discussion from !577 should be addressed:
- @ext-calvo_p started a [discussion](https://gitlab.psi.ch/OPAL/src/-/merge_requests/577#note_38608): (+1 comment)
> There is an additional problem with particle counting. The cyclotron tracker does not detect the particles that are in the material, and therefore always thrown the exception in `ParallelCyclotronTracker::deleteParticle()`.
>
> To reproduce it, just run the input file attached in the issue description. I've just updated it to the current format
The ScatteringPhysics algorithm delete from the bunch the particles that collide with the material. It then performs energy loss and Coulomb scattering calculations. Particles with energy above the threshold are returned to the beam by `addBackToBunch`, otherwise, the particles are considered lost.
OpalCycl updates the number of particles in a specific method focused on delete particles, so the local number of particles must coincide with the accumulated particles in all bunches after deletion. Therefore, the particles lost in ScatteringPhysics must be included in the bunch with the proper attribute to be deleted.2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/715Missing attributes values for AMR solver2022-05-03T09:22:53+02:00ext-calvo_ppedro.calvo@ciemat.esMissing attributes values for AMR solverThe attributes `ITSOLVER` and `AMR_MG_REUSE` are not considering all the options described in the [Manual](http://amas.web.psi.ch/opal/Documentation/master/#tab_AMR_MG_Commands) for the AMR Poisson Solver.
The lists of accepted predefin...The attributes `ITSOLVER` and `AMR_MG_REUSE` are not considering all the options described in the [Manual](http://amas.web.psi.ch/opal/Documentation/master/#tab_AMR_MG_Commands) for the AMR Poisson Solver.
The lists of accepted predefined string values have to be extended.2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/714Fieldsolver types for AMR not considered2022-05-03T09:22:53+02:00ext-calvo_ppedro.calvo@ciemat.esFieldsolver types for AMR not consideredReported by Sherlp: AMR solver types are not declared as `PredefinedString` in `FSTYPE` attribute, so all simulations will be finished in an exception.
This bug had gone unnoticed until now because the AMR regression tests are not enab...Reported by Sherlp: AMR solver types are not declared as `PredefinedString` in `FSTYPE` attribute, so all simulations will be finished in an exception.
This bug had gone unnoticed until now because the AMR regression tests are not enabled (see OPAL/regression-tests#95).2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/713Check assignation of BEAM, FIELDSOLVER and DISTRIBUTION in RUN command2022-03-21T07:59:48+01:00ext-calvo_ppedro.calvo@ciemat.esCheck assignation of BEAM, FIELDSOLVER and DISTRIBUTION in RUN commandThe attributes `BEAM`, `FIELDSOLVER` and `DISTRIBUTION` in the `RUN` command take default values when they are not specifically defined.
Currently, in the case that `FIELDSOLVER` is not defined, a segmentation fault is raised. In the ca...The attributes `BEAM`, `FIELDSOLVER` and `DISTRIBUTION` in the `RUN` command take default values when they are not specifically defined.
Currently, in the case that `FIELDSOLVER` is not defined, a segmentation fault is raised. In the case of `BEAM` or `DISTRIBUTION`, an exception is thrown, since OPAL does not find the internal attributes of those commands when taking the default value.
Early exceptions should be thrown in TrackRun to guarantee the assignation of these attributes.2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/709Missing std header result in compilation bug2022-02-23T14:43:10+01:00ext-calvo_ppedro.calvo@ciemat.esMissing std header result in compilation bugCompilation has failed (see [link](http://amas.web.psi.ch/opal/master/output/2022-02-22_10-49.txt)) after MR OPAL/src!558. Missing include in `ValueRange.h` could be a possible cause of the failure, because `std::numeric_limits` needs h...Compilation has failed (see [link](http://amas.web.psi.ch/opal/master/output/2022-02-22_10-49.txt)) after MR OPAL/src!558. Missing include in `ValueRange.h` could be a possible cause of the failure, because `std::numeric_limits` needs header `<limits>`.2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/707Segmentation fault with COMPUTEPERCENTILES2022-03-07T16:38:50+01:00ext-calvo_ppedro.calvo@ciemat.esSegmentation fault with COMPUTEPERCENTILES`COMPUTEPERCENTILES` gives a segmentation fault when all particles die during the simulation. It can happen when the whole beam collides with the geometry, by particle-matter interaction or by interaction with interceptive elements (stri...`COMPUTEPERCENTILES` gives a segmentation fault when all particles die during the simulation. It can happen when the whole beam collides with the geometry, by particle-matter interaction or by interaction with interceptive elements (stripper, collimator...).
A simple way to reproduce the bug is to run GasStripping regression test increasing the pressure level enough to achieve total particle loss (`PRESSURE=1.0e-1`) with `OPTION, COMPUTEPERCENTILES=TRUE;`2022.1krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/706Bug with Temporal Monitor when running in parallel2022-01-31T16:15:22+01:00albajacas_aarnau.albajacas@psi.chBug with Temporal Monitor when running in parallel### Summary
@muralikrishnan pointed out that he was having this error:
When a temporal monitor is used, and you run on multiple cores, you get the following error:
```
Error{1}> ...### Summary
@muralikrishnan pointed out that he was having this error:
When a temporal monitor is used, and you run on multiple cores, you get the following error:
```
Error{1}>
Error{1}> *** Error:
Error{1}> Internal OPAL error:
Error{1}> basic_string::_M_construct null not valid
Error{1}> basic_string::_M_construct null not valid
```
This happens for example running [test_fft.in](/uploads/da1a334c67bed7c2c6fe692cea331714/test_fft.in), only when run on multiple cores. When running on a single core it works fine.
The problem seems to come from the line `auto stats = lossDs_m->computeStatistics(1);` (https://gitlab.psi.ch/OPAL/src/-/blob/master/src/Classic/AbsBeamline/Monitor.cpp#L132), which was added in !557
I don't exactly know why this line was added or why it gives an error here. Maybe @kraus can comment.2022.1https://gitlab.psi.ch/OPAL/src/-/issues/703Fix particle definition2022-01-17T08:57:41+01:00ext-calvo_ppedro.calvo@ciemat.esFix particle definition- The `BEAM` command must verify that the particle definition (`PARTICLE` or `MASS` and `CHARGE`) has been explicitly set.
- Likewise, the proper assignment of `NPART` attribute must be checked (it must be positive).
- The `CARBON` charg...- The `BEAM` command must verify that the particle definition (`PARTICLE` or `MASS` and `CHARGE`) has been explicitly set.
- Likewise, the proper assignment of `NPART` attribute must be checked (it must be positive).
- The `CARBON` charge value is erroneous2022.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.es