Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
src
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OPAL
src
Commits
fd28d632
Commit
fd28d632
authored
Apr 29, 2018
by
kraus
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace SHA1 hash with UUID; small optimization run ran without problems.
parent
dbd4b470
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
18 deletions
+36
-18
src/BasicActions/Option.cpp
src/BasicActions/Option.cpp
+15
-8
src/Classic/Utilities/Options.cpp
src/Classic/Utilities/Options.cpp
+6
-4
src/Classic/Utilities/Options.h
src/Classic/Utilities/Options.h
+5
-3
src/Optimize/OpalSimulation.cpp
src/Optimize/OpalSimulation.cpp
+10
-3
No files found.
src/BasicActions/Option.cpp
View file @
fd28d632
...
...
@@ -86,6 +86,7 @@ namespace {
AMR_YT_DUMP_FREQ
,
#endif
MEMORYDUMP
,
USEUUID
,
SIZE
};
}
...
...
@@ -237,11 +238,11 @@ Option::Option():
itsAttr
[
VERSION
]
=
Attributes
::
makeReal
(
"VERSION"
,
"Version of OPAL for which input file was written"
,
10000
);
#ifdef ENABLE_AMR
itsAttr
[
AMR
]
=
Attributes
::
makeBool
(
"AMR"
,
"Use adaptive mesh refinement."
,
amr
);
itsAttr
[
AMR_YT_DUMP_FREQ
]
=
Attributes
::
makeReal
(
"AMR_YT_DUMP_FREQ"
,
"The frequency to dump grid "
"and particle data "
...
...
@@ -249,7 +250,10 @@ Option::Option():
#endif
itsAttr
[
MEMORYDUMP
]
=
Attributes
::
makeBool
(
"MEMORYDUMP"
,
"If true, write memory to SDDS file"
,
memoryDump
);
itsAttr
[
USEUUID
]
=
Attributes
::
makeBool
(
"USEUUID"
,
"If true, uses UUID to create unique directory names"
,
useUUID
);
registerOwnership
(
AttributeHandler
::
STATEMENT
);
FileStream
::
setEcho
(
echo
);
...
...
@@ -297,6 +301,7 @@ Option::Option(const std::string &name, Option *parent):
Attributes
::
setReal
(
itsAttr
[
AMR_YT_DUMP_FREQ
],
amrYtDumpFreq
);
#endif
Attributes
::
setBool
(
itsAttr
[
MEMORYDUMP
],
memoryDump
);
Attributes
::
setBool
(
itsAttr
[
USEUUID
],
useUUID
);
}
...
...
@@ -327,13 +332,13 @@ void Option::execute() {
amrYtDumpFreq
=
Attributes
::
getReal
(
itsAttr
[
AMR_YT_DUMP_FREQ
]);
#endif
memoryDump
=
Attributes
::
getBool
(
itsAttr
[
MEMORYDUMP
]);
if
(
memoryDump
)
{
IpplMemoryUsage
::
IpplMemory_p
memory
=
IpplMemoryUsage
::
getInstance
(
IpplMemoryUsage
::
Unit
::
GB
,
false
);
memory
->
sample
();
}
seed
=
Attributes
::
getReal
(
itsAttr
[
SEED
]);
/// note: rangen is used only for the random number generator in the OPAL language
...
...
@@ -343,7 +348,7 @@ void Option::execute() {
rangen
.
init55
(
time
(
0
));
else
rangen
.
init55
(
seed
);
IpplInfo
::
Info
->
on
(
info
);
IpplInfo
::
Warn
->
on
(
warn
);
...
...
@@ -447,13 +452,15 @@ void Option::execute() {
}
else
{
cloTuneOnly
=
false
;
}
// Set message flags.
FileStream
::
setEcho
(
echo
);
if
(
Attributes
::
getBool
(
itsAttr
[
TELL
]))
{
*
gmsg
<<
"
\n
Current settings of options:
\n
"
<<
*
this
<<
endl
;
}
useUUID
=
Attributes
::
getBool
(
itsAttr
[
USEUUID
]);
}
void
Option
::
handlePsDumpFrame
(
const
std
::
string
&
dumpFrame
)
{
...
...
@@ -481,4 +488,4 @@ std::string DumpFrameToString(DumpFrame df) {
default:
return
std
::
string
(
"GLOBAL"
);
}
}
}
\ No newline at end of file
src/Classic/Utilities/Options.cpp
View file @
fd28d632
...
...
@@ -90,13 +90,15 @@ namespace Options {
// opal version of input file
int
version
=
10000
;
#ifdef ENABLE_AMR
bool
amr
=
false
;
/// The frequency to dump AMR grid data and particles into file
int
amrYtDumpFreq
=
10
;
#endif
bool
memoryDump
=
false
;
}
bool
useUUID
=
false
;
}
\ No newline at end of file
src/Classic/Utilities/Options.h
View file @
fd28d632
...
...
@@ -139,15 +139,17 @@ namespace Options {
/// opal version of input file
extern
int
version
;
#ifdef ENABLE_AMR
extern
bool
amr
;
/// The frequency to dump AMR grid data and particles into file
extern
int
amrYtDumpFreq
;
#endif
extern
bool
memoryDump
;
extern
bool
useUUID
;
}
#endif // OPAL_Options_HH
\ No newline at end of file
src/Optimize/OpalSimulation.cpp
View file @
fd28d632
...
...
@@ -15,7 +15,8 @@
#include "Util/SDDSReader.h"
#include "Util/SDDSParser/SDDSParserException.h"
#include "Util/OptPilotException.h"
#include "Util/HashNameGenerator.h"
// #include "Util/HashNameGenerator.h"
#include "Util/UUIDNameGenerator.h"
#include "Expression/SumErrSq.h"
#include "Expression/FromFile.h"
...
...
@@ -93,7 +94,13 @@ OpalSimulation::OpalSimulation(Expressions::Named_t objectives,
// hash the dictionary to get a short unique directory name for temporary
// simulation data
std
::
string
hash
=
HashNameGenerator
::
generate
(
dict
);
std
::
string
hash
=
UUIDNameGenerator
::
generate
(
dict
);
// if (Options::useUUID) {
// hash = UUIDNameGenerator::generate(dict);
// } else {
// hash = HashNameGenerator::generate(dict);
// }
std
::
ostringstream
tmp
;
tmp
.
precision
(
15
);
...
...
@@ -488,4 +495,4 @@ void OpalSimulation::cleanUp() {
}
catch
(...)
{
std
::
cout
<<
"Can't remove directory '"
<<
simulationDirName_
<<
"'"
<<
std
::
endl
;
}
}
}
\ No newline at end of file
kraus
@kraus
mentioned in issue
#222 (closed)
·
Apr 29, 2018
mentioned in issue
#222 (closed)
mentioned in issue #222
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment