Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-lab-base
Commits
a5a98719
Commit
a5a98719
authored
Sep 23, 2018
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
h5Tool rename fixes
parent
e2b18a41
Pipeline
#37010
failed with stages
in 45 minutes and 52 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
archive/h5-tool/src/main/docker/meta-values-replacements.txt
0 → 100644
View file @
a5a98719
# section_run/program_basis_set_type
MM -> none
Gaussians -> GTOs
gaussians -> GTOs
"Real-space grid" -> "real-space grid"
# section_calculation_info/calculation_uploader_name
"danilo brambila" -> "Danilo Brambila"
"-" -> none
"–" -> none
# section_run/section_method/section_XC_functionals/XC_functional_name
x_qe_VDW_DF1 -> vDW_DF
x_qe_VDW_DF2 -> vDW_DF2
x_qe_GGA_X_GAUP -> HYB_GGA_XC_GAU_PBE
archive/h5-tool/src/main/docker/renameWorker.sh
0 → 100644
View file @
a5a98719
#!/bin/bash
cmd
=
"java -Djava.library.path=/lib -jar /app/h5Tool.jar"
baseName
=
${
baseName
:-
toRename
-
}
targetDir
=
${
targetDir
:-
--target-dir=/normalized/productionH5-patched
}
globPattern
=
${
globPattern
:-
??
}
renames
=
${
renames
:-
--renames=/app/meta-values-replacements.txt
}
cmdArgs
=
${
cmdArgs
:-
rename
$renames
$targetDir
--source-paths-file=\
$f
}
if
[
-e
/config.sh
]
;
then
source
/config.sh
fi
cd
/work
for
f
in
/work/
$baseName$globPattern
;
do
(
if
[[
-e
"
$f
"
]]
;
then
echo
$cmd
$cmdArgs
"out-
$(
basename
$f
)
.txt"
eval
$cmd
$cmdArgs
>
&
"out-
$(
basename
$f
)
.txt"
fi
)
&
done
wait
core/src/main/scala/eu/nomad_lab/h5/H5Renamer.scala
View file @
a5a98719
...
@@ -22,18 +22,18 @@ object H5Rename {
...
@@ -22,18 +22,18 @@ object H5Rename {
/**
/**
* Renames the values of the value table at repl.metaPath of all calculations in the archive according to the repl.replacements mapping
* Renames the values of the value table at repl.metaPath of all calculations in the archive according to the repl.replacements mapping
*/
*/
def
renameStr
(
file
:
FileH5
,
repl
:
Replacements
)
:
Unit
=
{
def
renameStr
(
file
:
FileH5
,
repl
s
:
Seq
[
Replacements
]
)
:
Unit
=
{
for
(
arch
<-
file
.
archives
())
{
for
(
arch
<-
file
.
archives
())
{
renameStr
(
arch
,
repl
)
renameStr
(
arch
,
repl
s
)
}
}
}
}
/**
/**
* Renames the values of the value table at repl.metaPath of all calculations in the archive according to the repl.replacements mapping
* Renames the values of the value table at repl.metaPath of all calculations in the archive according to the repl.replacements mapping
*/
*/
def
renameStr
(
archive
:
ArchiveH5
,
repl
:
Replacements
)
:
Unit
=
{
def
renameStr
(
archive
:
ArchiveH5
,
repl
s
:
Seq
[
Replacements
]
)
:
Unit
=
{
for
(
calculation
<-
archive
.
calculations
())
{
for
(
calculation
<-
archive
.
calculations
())
{
renameStr
(
calculation
,
repl
)
renameStr
(
calculation
,
repl
s
)
}
}
}
}
...
@@ -41,10 +41,12 @@ object H5Rename {
...
@@ -41,10 +41,12 @@ object H5Rename {
* Renames the values of the value table at repl.metaPath of the given calculation
* Renames the values of the value table at repl.metaPath of the given calculation
* according to the repl.replacements mapping
* according to the repl.replacements mapping
*/
*/
def
renameStr
(
calculation
:
CalculationH5
,
repl
:
Replacements
)
:
Unit
=
{
def
renameStr
(
calculation
:
CalculationH5
,
repls
:
Seq
[
Replacements
])
:
Unit
=
{
val
valueTablePath
=
repl
.
metaPath
for
(
repl
<-
repls
)
{
val
valueTable
=
calculation
.
sectionTable
(
valueTablePath
.
dropRight
(
1
)).
subValueTable
(
valueTablePath
.
last
)
val
valueTablePath
=
repl
.
metaPath
renameStr
(
valueTable
,
repl
.
replacements
)
val
valueTable
=
calculation
.
sectionTable
(
valueTablePath
.
dropRight
(
1
)).
subValueTable
(
valueTablePath
.
last
)
renameStr
(
valueTable
,
repl
.
replacements
)
}
}
}
/**
/**
...
@@ -79,8 +81,10 @@ object H5Rename {
...
@@ -79,8 +81,10 @@ object H5Rename {
}
}
}
}
}
}
if
(
hasRenames
)
if
(
hasRenames
)
{
//logger.debug(s"$valueTable has replacements")
H5Lib
.
datasetWrite
(
valueDatasetId
,
value
=
vals
,
dtypeStr
=
"C"
)
H5Lib
.
datasetWrite
(
valueDatasetId
,
value
=
vals
,
dtypeStr
=
"C"
)
}
}
finally
{
}
finally
{
H5Lib
.
datasetClose
(
valueDatasetId
)
H5Lib
.
datasetClose
(
valueDatasetId
)
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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