src issueshttps://gitlab.psi.ch/OPAL/src/-/issues2021-08-27T14:01:20+02:00https://gitlab.psi.ch/OPAL/src/-/issues/679OPAL header is not printed in interactive mode2021-08-27T14:01:20+02:00gsellOPAL header is not printed in interactive mode### Summary
OPAL header is not printed in interactive mode
### Steps to reproduce
Run opal without argumante
### What is the current *bug* behavior?
No header printed
### What is the expected *correct* behavior?
Print header### Summary
OPAL header is not printed in interactive mode
### Steps to reproduce
Run opal without argumante
### What is the current *bug* behavior?
No header printed
### What is the expected *correct* behavior?
Print headerOPAL 2021.1gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/678Clang does not support option -fno-aggressive-loop-optimizations2021-08-26T15:08:52+02:00gsellClang does not support option -fno-aggressive-loop-optimizationsClang does not support the option `-fno-aggressive-loop-optimizations`.Clang does not support the option `-fno-aggressive-loop-optimizations`.OPAL 2021.1gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/676Clang 12 compiler warnings on macOS2021-08-27T14:00:12+02:00gsellClang 12 compiler warnings on macOSOPAL doesn't compile on macOS with current Clang/Xcode 12:
- if compiled for production PAssert() is defined empty and Clang complains about unused variables
- declarations of virtual methods are missing in same base classesOPAL doesn't compile on macOS with current Clang/Xcode 12:
- if compiled for production PAssert() is defined empty and Clang complains about unused variables
- declarations of virtual methods are missing in same base classesOPAL 2021.1gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/674CMake configuration file fixes2021-08-18T11:51:33+02:00gsellCMake configuration file fixes### Summary
Linking with static libraries fails
### Steps to reproduce
* Build all required software with the build recipes
* run cmake (static libs enabled by default)
* compile
### What is the current *bug* behavior?
Linking faile...### Summary
Linking with static libraries fails
### Steps to reproduce
* Build all required software with the build recipes
* run cmake (static libs enabled by default)
* compile
### What is the current *bug* behavior?
Linking failed.
The boost libraries must not be specified lexicographical (`chrono timer` doesn't work).
CMake does not always detect all libraries required to link with a static `libhdf5.a`.
Old CMake version have issues to detect current boost libraries.OPAL 2021.1gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/671Energy range for gas stripping2021-07-16T12:59:43+02:00ext-calvo_ppedro.calvo@ciemat.esEnergy range for gas strippingThe energy range check for gas stripping in `computeCrossSectionBohr` must be performed in energy units of keV/umaThe energy range check for gas stripping in `computeCrossSectionBohr` must be performed in energy units of keV/umaOPAL 2021.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/670Simulations broken2021-07-08T13:43:09+02:00ext-calvo_ppedro.calvo@ciemat.esSimulations brokenAfter implementing !497 the energy assignment in the `BEAM` command is never true, so all simulations and [regression tests](http://amas.web.psi.ch/opal/regressionTests/master/results_2021-07-07_22-30.xml) fail.
cc: @krausAfter implementing !497 the energy assignment in the `BEAM` command is never true, so all simulations and [regression tests](http://amas.web.psi.ch/opal/regressionTests/master/results_2021-07-07_22-30.xml) fail.
cc: @krausOPAL 2021.1snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/663Clang compiler errors with c++172021-06-28T09:48:49+02:00snuverink_jjochem.snuverink@psi.chClang compiler errors with c++17In c++17 `std::bind2nd` has been deprecated resulting in compiler errors with clang version 12:
```
OPAL/src/src/Classic/Algebra/Matrix.h:194:25: error: no member
named 'bind2nd' in namespace 'std'
std::bind2nd(...In c++17 `std::bind2nd` has been deprecated resulting in compiler errors with clang version 12:
```
OPAL/src/src/Classic/Algebra/Matrix.h:194:25: error: no member
named 'bind2nd' in namespace 'std'
std::bind2nd(std::multiplies<T>(), val));
~~~~~^
```OPAL 2021.1snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/659Some regression tests broken2021-06-16T14:05:43+02:00ext-calvo_ppedro.calvo@ciemat.esSome regression tests brokenAfter implementing #657, EGunCTF3-1, EGunCTF3-2, GasStripping, PROSCAN-1 and PSI-Gun-1 tests are broken (see [link](http://amas.web.psi.ch/opal/regressionTests/master/results_2021-06-14_22-30.xml)).
In case of GasStripping test, there i...After implementing #657, EGunCTF3-1, EGunCTF3-2, GasStripping, PROSCAN-1 and PSI-Gun-1 tests are broken (see [link](http://amas.web.psi.ch/opal/regressionTests/master/results_2021-06-14_22-30.xml)).
In case of GasStripping test, there is an error in `OPTION` statements (OPAL/regression-tests#105).
In other cases, the errors are duplicate file names for output. The element names or `OUTFN` are not repeated, so it seems to be because the element is called twice during the tracking.OPAL 2021.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/657Element output files must not be overwritten2021-06-15T09:57:28+02:00ext-calvo_ppedro.calvo@ciemat.esElement output files must not be overwrittenOutput file names defined by `OUTFN` must not be repeated to avoid data loss. In that case, an exception must be thrown.
In addition, to ensure correct writing of output files by LossDataSink, we should check if `ASCIIDUMP` or `ENABLEHD...Output file names defined by `OUTFN` must not be repeated to avoid data loss. In that case, an exception must be thrown.
In addition, to ensure correct writing of output files by LossDataSink, we should check if `ASCIIDUMP` or `ENABLEHDF5` are `TRUE`OPAL 2021.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/656Logical error in Boundarygeometry2021-06-10T18:33:19+02:00snuverink_jjochem.snuverink@psi.chLogical error in Boundarygeometryclang 12.0.0 reports compiler warnings that sound like a serious bug:
```
src/Structure/BoundaryGeometry.cpp:600:50: warning:
operator '?:' has lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-p...clang 12.0.0 reports compiler warnings that sound like a serious bug:
```
src/Structure/BoundaryGeometry.cpp:600:50: warning:
operator '?:' has lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]
(A[2] < EPS) ? 1 : 0 | (A[2] > -EPS) ? 8 : 0);
~~~~~~~~~~~~~~~~~ ^
```OPAL 2021.1snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/653Octupole magnet strengths are set using the formula for Decapoles2021-06-10T10:07:15+02:00adelmannOctupole magnet strengths are set using the formula for Decapoles### Summary
In the course of trying to get Opal to agree with another code, Finn O'Shea discovered that the normal component of the octupole strength
is set using the formula for decapoles. Line 114 of Multipole.cpp shows that the OCT...### Summary
In the course of trying to get Opal to agree with another code, Finn O'Shea discovered that the normal component of the octupole strength
is set using the formula for decapoles. Line 114 of Multipole.cpp shows that the OCTUPOLE case is combined with the DECAPOLE case:
### Steps to reproduce
will ask for input file(s)
### What is the current *bug* behavior?
OCTUPOLE behaves like a DECAPOLE, see also the attached file with the trace win "reference" solution, provided by Finn O'Shea.
### What is the expected *correct* behavior?
see below
### Relevant logs and/or screenshots
```
case OCTUPOLE:
case DECAPOLE:
NormalComponents[n - 1] = (v + vError) / 24;
NormalComponentErrors[n - 1] = vError / 24;
break;
```
### Possible fixes
```
case OCTUPOLE:
NormalComponents[n - 1] = (v + vError) / 6;
NormalComponentErrors[n - 1] = vError / 6;
break;
case DECAPOLE:
NormalComponents[n - 1] = (v + vError) / 24;
NormalComponentErrors[n - 1] = vError / 24;
break;
```
[octupoles.tar.gz](/uploads/6cb3061fbe6619e5563a275bf3eb1fca/octupoles.tar.gz)OPAL 2021.1snuverink_jjochem.snuverink@psi.chsnuverink_jjochem.snuverink@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/652DumpFieldsTest and DumpEMFieldsTest failed2021-06-11T08:06:22+02:00ext-calvo_ppedro.calvo@ciemat.esDumpFieldsTest and DumpEMFieldsTest failedAfter implementing OPAL/src#651 the DumpFieldsTest and DumpEMFieldsTest failed (see [output](http://amas.web.psi.ch/opal/master/output/2021-05-10_22-30.txt)).
- The dumped fields tests must be modified to write the files into OPAL auxil...After implementing OPAL/src#651 the DumpFieldsTest and DumpEMFieldsTest failed (see [output](http://amas.web.psi.ch/opal/master/output/2021-05-10_22-30.txt)).
- The dumped fields tests must be modified to write the files into OPAL auxiliary output directory
- `COORDINATE_SYSTEM` is defined now as UpperCaseStringOPAL 2021.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/649INPUTMOUNITS is now eV/c instead of eV2021-10-13T17:11:54+02:00albajacas_aarnau.albajacas@psi.chINPUTMOUNITS is now eV/c instead of eVAs pointed out by Hui Zhang, when we updated the momentum conversion formula in #475, the input units for momentum became [eV/c] instead of [eV].
Accordingly, the command for changing units
```
INPUTMOUNITS=EV
```
should be changed to s...As pointed out by Hui Zhang, when we updated the momentum conversion formula in #475, the input units for momentum became [eV/c] instead of [eV].
Accordingly, the command for changing units
```
INPUTMOUNITS=EV
```
should be changed to something like
```
INPUTMOUNITS=EV/c
```
And it should also be corrected in the manual in section 15.1
- [x] Update code OPAL/src!490
- [x] Update documentation OPAL/documentation/manual!126
- [x] Update regression tests OPAL/regression-tests!29OPAL 2021.1albajacas_aarnau.albajacas@psi.chalbajacas_aarnau.albajacas@psi.chhttps://gitlab.psi.ch/OPAL/src/-/issues/644Sampler cleanup with KEEP option not working when directory is present2021-06-11T10:53:01+02:00snuverink_jjochem.snuverink@psi.chSampler cleanup with KEEP option not working when directory is present### Summary
Reported by @ext-piot_p on the OPAL mailing list. With the option `SAMPLE, KEEP` non-empty, non-wanted files should be deleted, but an error message is shown instead when a non-empty subdirectory is present in the simulation...### Summary
Reported by @ext-piot_p on the OPAL mailing list. With the option `SAMPLE, KEEP` non-empty, non-wanted files should be deleted, but an error message is shown instead when a non-empty subdirectory is present in the simulation directory.
### Steps to reproduce
An OPAL Sampler simulation whereby also files in the auxiliary directory (`/data`) are produced together with the `KEEP` option of the `SAMPLER`.
### What is the current *bug* behavior?
An error message is shown and the unwanted files are not (all) deleted.
### What is the expected *correct* behavior?
No error message and all but the files with extensions in the `KEEP` option should be deleted.
### Relevant logs and/or screenshots
```
OPAL{0}> opal varyTDCphase.in --inputfile=varyTDCphase.tmpl --outfile=phiscan --outdir=phiscan --num-masters=1 --num-coworkers=2 --restartstep=-2147483648 --jsonDumpFreq=1 --nsamples=11 --simtmpdir=/home/piot/OpalSandBox/scan_example/phiscan --templates=/home/piot/OpalSandBox/scan_example/template
7 (PID: 214335) ▶ Worker
1 (PID: 214329) ▶ Sampler
2 (PID: 214330) ▶ Worker
3 (PID: 214331) ▶ Worker
4 (PID: 214332) ▶ Worker
5 (PID: 214333) ▶ Worker
6 (PID: 214334) ▶ Worker
✔ 40 objectives
✔ 1 dvars
0 (PID: 214328) ▶ Pilot
Warning: argument "one-pilot-converge" not found! Using default value (0).
Warning: argument "restartfile" not found! Using default value ().
Warning: argument "restartfile" not found! Using default value ().
Ippl> CommMPI: Started job 1 on host `localhost.localdomain'.
Ippl> CommMPI: Parent process waiting for children ...
Ippl> CommMPI: Child 1 ready.
Ippl> CommMPI: Initialization complete.
Warning: argument "restartfile" not found! Using default value ().
Warning: argument "restartfile" not found! Using default value ().
Ippl> CommMPI: Started job 1 on host `localhost.localdomain'.
Ippl> CommMPI: Parent process waiting for children ...
Ippl> CommMPI: Child 1 ready.
Ippl> CommMPI: Initialization complete.
Warning: argument "restartfile" not found! Using default value ().
Warning: argument "restartfile" not found! Using default value ().
Ippl> CommMPI: Started job 1 on host `localhost.localdomain'.
Ippl> CommMPI: Parent process waiting for children ...
Ippl> CommMPI: Child 1 ready.
Ippl> CommMPI: Initialization complete.
Can't remove file in directory '/home/piot/OpalSandBox/scan_example/phiscan/1', (boost::filesystem::remove: Directory not empty: "/home/piot/OpalSandBox/scan_example/phiscan/1/data")
```
### Possible fixes
The function [`OpalSimulation::Cleanup(const std::vector<std::string>& keep)`](https://gitlab.psi.ch/OPAL/src/-/blob/f3d1060a910e9f46f67bfb6807db1ea9e992c57a/src/Optimize/OpalSimulation.cpp#L632)
does not take into account the possibility that a subdirectory might be present. It could check if the path is a directory and if so use `boost::filesystem::remove_all` (or [the c++17 equivalent](https://en.cppreference.com/w/cpp/filesystem/remove)) instead of `boost::filesystem::remove` to remove these non-empty subdirectories. Possibly even better would be if the subdirectories are traversed and files with proper extensions are kept.OPAL 2021.1krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/641UndulatorAWA-Test yielding different results2021-10-13T09:30:38+02:00krausUndulatorAWA-Test yielding different resultsAfter implementing OPAL/src#503 the UndulatorAWA-Test yields slightly different results.After implementing OPAL/src#503 the UndulatorAWA-Test yields slightly different results.OPAL 2021.1krausalbajacas_aarnau.albajacas@psi.chkraushttps://gitlab.psi.ch/OPAL/src/-/issues/639unused variable in ippl/test/particle/p3m3dMicrobunching.cpp2021-03-23T09:39:02+01:00gsellunused variable in ippl/test/particle/p3m3dMicrobunching.cppCompilation fails with an `unused variable` warning in `ippl/test/particle/p3m3dMicrobunching.cpp` if compile type is set to `Release`.Compilation fails with an `unused variable` warning in `ippl/test/particle/p3m3dMicrobunching.cpp` if compile type is set to `Release`.OPAL 2021.1gsellgsellhttps://gitlab.psi.ch/OPAL/src/-/issues/638Fix algorithm for computation of standard deviation2021-10-13T09:30:21+02:00krausFix algorithm for computation of standard deviationFrom a discussion on MR 477 (https://gitlab.psi.ch/OPAL/src/-/merge_requests/477#note_30754):
> I think the equation for stdTime_m is not correct. It should be std::sqrt((localMoments[l++] - totalNumParticles_m *
> std::pow(meanTime_m, ...From a discussion on MR 477 (https://gitlab.psi.ch/OPAL/src/-/merge_requests/477#note_30754):
> I think the equation for stdTime_m is not correct. It should be std::sqrt((localMoments[l++] - totalNumParticles_m *
> std::pow(meanTime_m, 2)) * perParticle). However, this way of calculating can be numerically unstable (see also
> https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance).
>
> I usually do a double loop, but that might be not so easy here. Perhaps with "Computing shifted data" with the first value
> taken as preliminary mean (this seems valid since the particle times are not expected to lie very far away from each other,
> or Welford's algorithm can be tried?OPAL 2021.1krauskraushttps://gitlab.psi.ch/OPAL/src/-/issues/637Segmantation fault with BoundaryGeometry2021-02-17T11:21:51+01:00ext-calvo_ppedro.calvo@ciemat.esSegmantation fault with BoundaryGeometrySince MR OPAL/src!464, I got a segmentation fault running opal-cycl with geometry
```
*** Process received signal ***
Signal: Aborted (6)
Signal code: (-6)
[ 0] /lib64/libpthread.so.0[0x30b520f130]
[ 1] /lib64/libc.so.6(gsignal+0x39)[0...Since MR OPAL/src!464, I got a segmentation fault running opal-cycl with geometry
```
*** Process received signal ***
Signal: Aborted (6)
Signal code: (-6)
[ 0] /lib64/libpthread.so.0[0x30b520f130]
[ 1] /lib64/libc.so.6(gsignal+0x39)[0x30b4a359d9]
[ 2] /lib64/libc.so.6(abort+0x148)[0x30b4a370e8]
[ 3] opal(_ZNSt6vectorIN7Message7MsgItemESaIS1_EE7reserveEm+0x0)[0x64af30]
[ 4] opal[0x80121b]
[ 5] opal(_ZN16BoundaryGeometry10initializeEv+0x2e62)[0x8044e2]
[ 6] opal(_ZN16BoundaryGeometryC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS_+0x348)[0x805468]
[ 7] opal(_ZN16BoundaryGeometry5cloneERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x25)[0x8055e5]
[ 8] opal(_ZN8TrackRun21setupCyclotronTrackerEv+0xeb0)[0x81ea60]
[ 9] opal(_ZN8TrackRun7executeEv+0xc8)[0x8211d8]
[10] opal(_ZNK10OpalParser7executeEP6ObjectRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x3a)[0x6f197a]
[11] opal(_ZNK10OpalParser11parseActionER9Statement+0xfd)[0x6f5ced]
[12] opal(_ZNK10OpalParser5parseER9Statement+0x173)[0x6f4933]
[13] opal(_ZNK10OpalParser3runEv+0x4e)[0x6f214e]
[14] opal(_ZN8TrackCmd7executeEv+0x97c)[0x81b50c]
[15] opal(_ZNK10OpalParser7executeEP6ObjectRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x3a)[0x6f197a]
[16] opal(_ZNK10OpalParser11parseActionER9Statement+0xfd)[0x6f5ced]
[17] opal(_ZNK10OpalParser5parseER9Statement+0x173)[0x6f4933]
[18] opal(_ZNK10OpalParser3runEv+0x4e)[0x6f214e]
[19] opal(_ZNK10OpalParser3runEP11TokenStream+0x70)[0x6f6260]
[20] opal(main+0x1f5d)[0x6443cd]
[21] /lib64/libc.so.6(__libc_start_main+0xf5)[0x30b4a21b45]
[22] opal[0x6356a9]
```
cc: @kraus, @gsellOPAL 2021.1https://gitlab.psi.ch/OPAL/src/-/issues/636Loss files overwritten for collimators2021-02-08T13:30:30+01:00ext-calvo_ppedro.calvo@ciemat.esLoss files overwritten for collimatorsThe particles hitting the collimator and lost particles by energy loss in the material are saved in the same file because the file name are equal.
Renaming the file for lost particles by particle-matter interactions according to the lab...The particles hitting the collimator and lost particles by energy loss in the material are saved in the same file because the file name are equal.
Renaming the file for lost particles by particle-matter interactions according to the label of `PARTICLEMATTERINTERACTION` command, we'll be able to distinguish both casesOPAL 2021.1ext-calvo_ppedro.calvo@ciemat.esext-calvo_ppedro.calvo@ciemat.eshttps://gitlab.psi.ch/OPAL/src/-/issues/635Get correct output of VALUE, OPTION->AUTOPHASE2021-10-13T09:30:59+02:00krausGet correct output of VALUE, OPTION->AUTOPHASEWhen querying the value of Options the user gets the default value but not the actual value. E.g. after
```
OPTION, AUTOPHASE=4;
VALUE, OPTION->AUTOPHASE;
```
one would expect to get
```
value: {OPTION->AUTOPHASE} = {4}
```
as output. B...When querying the value of Options the user gets the default value but not the actual value. E.g. after
```
OPTION, AUTOPHASE=4;
VALUE, OPTION->AUTOPHASE;
```
one would expect to get
```
value: {OPTION->AUTOPHASE} = {4}
```
as output. But this isn't the case.OPAL 2021.1krauskraus