Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EWMSCP
DetectorWriteSim
Commits
45603199
Commit
45603199
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
output zip bevor pull and extract in output folder
parent
94aeac42
Branches
Branches containing commit
No related tags found
1 merge request
!4
Python driver and data analysis part
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
simrunner/config_processing.py
+2
-1
2 additions, 1 deletion
simrunner/config_processing.py
simrunner/output_processing.py
+33
-1
33 additions, 1 deletion
simrunner/output_processing.py
with
35 additions
and
2 deletions
simrunner/config_processing.py
+
2
−
1
View file @
45603199
...
...
@@ -5,7 +5,8 @@ import os
#BYTE_SIZES = ['16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192',
#'16384', '32768', '65536', '131072', '262144', '524288', '1048576', '2097152',
#'4194304', '8388608', '16777216', '33554432', '67108864']
BYTE_SIZES
=
[
'
16
'
,
'
32
'
]
BYTE_SIZES
=
[
'
16
'
,
'
32
'
,
'
64
'
,
'
128
'
,
'
256
'
,
'
512
'
,
'
1024
'
,
'
2048
'
,
'
4096
'
,
'
8192
'
,
'
16384
'
,
'
32768
'
,
'
65536
'
]
# Function to read the configuration from a JSON file
...
...
This diff is collapsed.
Click to expand it.
simrunner/output_processing.py
+
33
−
1
View file @
45603199
...
...
@@ -2,6 +2,8 @@ import os
import
subprocess
from
main
import
args
from
main
import
logger
import
gzip
import
tarfile
# Function to create local folders for test data and output
...
...
@@ -31,6 +33,27 @@ def write_statistics(main_path, stat_file_name, output):
stat_file
.
write
(
output
)
def
extract_gzip_files
(
folder_path
):
# Iterate through the files in the specified folder
for
file_name
in
os
.
listdir
(
folder_path
):
# Check if the file has the '.tar.gz' extension
if
file_name
.
endswith
(
'
.tar.gz
'
):
tar_gz_file_path
=
os
.
path
.
join
(
folder_path
,
file_name
)
output_sub_folder
=
os
.
path
.
join
(
folder_path
)
# Remove '.tar.gz' extension
# Create the output sub_folder if it doesn't exist
os
.
makedirs
(
output_sub_folder
,
exist_ok
=
True
)
# Extract the gzip tar file
with
tarfile
.
open
(
tar_gz_file_path
,
'
r:gz
'
)
as
tar
:
tar
.
extractall
(
output_sub_folder
)
# Delete the gz file
os
.
remove
(
tar_gz_file_path
)
logger
.
info
(
'
Extraction completed
'
)
# Function to pull data from remote machines to the local machine
def
pull_data
(
desti_path
):
source_path
=
os
.
path
.
join
(
args
.
data
,
'
output
'
)
...
...
@@ -39,9 +62,18 @@ def pull_data(desti_path):
if
args
.
hosts
:
for
host
in
args
.
hosts
:
ssh_target
=
f
'
{
args
.
user
}
@
{
host
}
'
scp_cmd
=
f
'
scp -r
{
ssh_target
}
:
{
source_path
}
/*
{
host
}
*
{
desti
}
'
# Komprimiere die Dateien auf dem Server mit gzip
gzip_cmd
=
f
'
ssh
{
ssh_target
}
"
cd
{
source_path
}
&& tar -czf
{
host
}
_files.tar.gz *
{
host
}
*
"'
subprocess
.
run
(
gzip_cmd
,
shell
=
True
,
check
=
True
)
scp_cmd
=
f
'
scp
{
ssh_target
}
:
{
source_path
}
/
{
host
}
_files.tar.gz
{
desti
}
'
subprocess
.
run
(
scp_cmd
,
shell
=
True
,
check
=
True
)
rm_cmd
=
f
'
ssh
{
ssh_target
}
"
cd
{
source_path
}
&& rm -r *_files.tar.gz
"'
subprocess
.
run
(
rm_cmd
,
shell
=
True
,
check
=
True
)
extract_gzip_files
(
desti
)
def
rm_data
(
t_data_path
):
if
args
.
hosts
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment