Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Erm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
OpenXG
OpenXG-Erm
Commits
ba513cf7
Commit
ba513cf7
authored
Apr 12, 2021
by
Suzhi Bi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update auto_2.py
parent
cd803213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
code/auto_2.py
code/auto_2.py
+1
-8
No files found.
code/auto_2.py
View file @
ba513cf7
...
@@ -5,7 +5,6 @@ import os
...
@@ -5,7 +5,6 @@ import os
import
struct
import
struct
import
numpy
as
np
import
numpy
as
np
import
time
import
time
#import json
def
allocation
(
workload
,
cpu_per_core
,
core_num
,
arrival
):
def
allocation
(
workload
,
cpu_per_core
,
core_num
,
arrival
):
fixed_cpu
=
7.5
*
10
**
8
fixed_cpu
=
7.5
*
10
**
8
...
@@ -39,11 +38,8 @@ def deal_data(conn, addr):
...
@@ -39,11 +38,8 @@ def deal_data(conn, addr):
if
buf
:
if
buf
:
if
buf
.
decode
(
'utf-8'
,
'ignore'
).
isdigit
()
and
len
(
buf
.
decode
(
'utf-8'
,
'ignore'
))
<
5
:
if
buf
.
decode
(
'utf-8'
,
'ignore'
).
isdigit
()
and
len
(
buf
.
decode
(
'utf-8'
,
'ignore'
))
<
5
:
global
time_max
global
time_max
# auxiliary_list = json.loads(buf.decode('utf-8'))
time_max
=
int
(
buf
.
decode
(
'utf-8'
))
time_max
=
int
(
buf
.
decode
(
'utf-8'
))
print
(
'The maximum time (seconds) allowed for picture(s) is %d.'
%
time_max
)
print
(
'The maximum time (seconds) allowed for picture(s) is %d.'
%
time_max
)
# img_num = auxiliary_list[1]
# print(img_num)
flag
=
1
flag
=
1
else
:
else
:
global
filesize
global
filesize
...
@@ -131,7 +127,6 @@ while 1:
...
@@ -131,7 +127,6 @@ while 1:
os
.
system
(
cmd2
)
os
.
system
(
cmd2
)
cmd3
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
cmd3
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
os
.
system
(
cmd3
)
os
.
system
(
cmd3
)
# os.system("rm -f " + str(new_image[k]))
os
.
system
(
"echo No free computing resources. >> time.txt"
)
os
.
system
(
"echo No free computing resources. >> time.txt"
)
continue
continue
...
@@ -144,7 +139,6 @@ while 1:
...
@@ -144,7 +139,6 @@ while 1:
os
.
system
(
cmd2
)
os
.
system
(
cmd2
)
cmd3
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
cmd3
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
os
.
system
(
cmd3
)
os
.
system
(
cmd3
)
# os.system("rm -f " + str(new_image[k]))
os
.
system
(
"echo Error receiving. >> time.txt"
)
os
.
system
(
"echo Error receiving. >> time.txt"
)
continue
continue
...
@@ -159,6 +153,5 @@ while 1:
...
@@ -159,6 +153,5 @@ while 1:
cmd5
=
"docker rm "
+
str
(
name
[
k
])
cmd5
=
"docker rm "
+
str
(
name
[
k
])
cmd6
=
"python3 result_return.py "
+
str
(
addr
[
0
])
+
" "
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
cmd6
=
"python3 result_return.py "
+
str
(
addr
[
0
])
+
" "
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
cmd7
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
cmd7
=
"rm -f result_"
+
str
(
addr
[
0
])
+
"_"
+
str
(
os
.
path
.
split
(
new_image
[
k
])[
-
1
]).
split
(
'.'
)[
0
]
+
".txt"
# cmd8 = "rm -f " + str(new_image[k])
cmd
=
cmd1
+
" && "
+
cmd2
+
" && "
+
cmd3
+
" && "
+
cmd4
+
" && "
+
cmd4_1
+
" && "
+
cmd5
+
" && "
+
cmd6
+
" && "
+
cmd7
# + " && " + cmd8
cmd
=
cmd1
+
" && "
+
cmd2
+
" && "
+
cmd3
+
" && "
+
cmd4
+
" && "
+
cmd4_1
+
" && "
+
cmd5
+
" && "
+
cmd6
+
" && "
+
cmd7
# + " && " + cmd8
p
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
stdin
=
subprocess
.
PIPE
)
p
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
stdin
=
subprocess
.
PIPE
)
\ No newline at end of file
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