Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GstLAL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
lscsoft
GstLAL
Commits
d4686337
Commit
d4686337
authored
8 years ago
by
Chad Hanna
Browse files
Options
Downloads
Patches
Plain Diff
gstlal_ll_inspiral_aggregator: start to add service discovery calls
parent
68072bab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-ugly/bin/gstlal_ll_inspiral_aggregator
+22
-2
22 additions, 2 deletions
gstlal-ugly/bin/gstlal_ll_inspiral_aggregator
with
22 additions
and
2 deletions
gstlal-ugly/bin/gstlal_ll_inspiral_aggregator
+
22
−
2
View file @
d4686337
...
...
@@ -7,6 +7,9 @@ import argparse
import
lal
from
lal
import
LIGOTimeGPS
import
time
from
gstlal
import
servicediscovery
from
gi.repository
import
GLib
def
now
():
return
LIGOTimeGPS
(
lal
.
UTCToGPS
(
time
.
gmtime
()),
0
)
...
...
@@ -22,7 +25,6 @@ def parse_command_line():
# num-jobs
parser
.
add_argument
(
"
--num-jobs
"
,
action
=
"
store
"
,
type
=
int
,
default
=
112
,
help
=
"
number of running jobs
"
)
args
=
parser
.
parse_args
()
return
args
...
...
@@ -72,6 +74,20 @@ def setup_dirs(gpstime, types, bins, data, base_dir, verbose = True):
for
d
in
data
:
create_new_dataset
(
type_dir
,
d
)
class
MyListener
(
servicediscovery
.
Listener
):
def
print_msg
(
self
,
action
,
sname
,
stype
,
sdomain
,
host
,
port
,
properties
):
print
>>
sys
.
stderr
,
"
Service
\"
%s
\"
%s
"
%
(
sname
,
action
)
print
>>
sys
.
stderr
,
"
\t
Type is
\"
%s
\"
"
%
stype
print
>>
sys
.
stderr
,
"
\t
Domain is
\"
%s
\"
"
%
sdomain
print
>>
sys
.
stderr
,
"
\t
Host is
\"
%s
\"
"
%
host
print
>>
sys
.
stderr
,
"
\t
Port is %s
"
%
port
print
>>
sys
.
stderr
,
"
\t
Properties are %s
\n
"
%
properties
def
add_service
(
self
,
sname
,
stype
,
sdomain
,
host
,
port
,
properties
):
self
.
print_msg
(
"
added
"
,
sname
,
stype
,
sdomain
,
host
,
port
,
properties
)
def
remove_service
(
self
,
sname
,
stype
,
sdomain
):
self
.
print_msg
(
"
removed
"
,
sname
,
stype
,
sdomain
,
None
,
None
,
None
)
def
failure
(
self
,
*
args
):
print
>>
sys
.
stderr
,
"
failure
"
,
args
# parse command line
args
=
parse_command_line
()
...
...
@@ -81,8 +97,12 @@ types = ["min", "max", "mean", "all"]
bins
=
[
"
%04d
"
%
b
for
b
in
numpy
.
arange
(
0
,
args
.
num_jobs
)]
data
=
[
"
latency
"
,
"
snr
"
]
mainloop
=
GLib
.
MainLoop
()
browser
=
servicediscovery
.
ServiceBrowser
(
MyListener
())
print
"
Browsing for services. Press CTRL-C to quit.
\n
"
mainloop
.
run
()
while
True
:
setup_dirs
(
now
(),
types
,
bins
,
data
,
args
.
base_dir
)
time
.
sleep
(
1
)
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