Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scord
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
eu
ADMIRE
scord
Commits
f9bc8ceb
Verified
Commit
f9bc8ceb
authored
2 years ago
by
Alberto Miranda
Browse files
Options
Downloads
Patches
Plain Diff
Redefine RPC types for ADM_transfer_dataset
parent
ce832455
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!30
Resolve "Refactor library RPC implementation of `admire::transfer_dataset`"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/net/proto/rpc_types.h
+34
-9
34 additions, 9 deletions
src/common/net/proto/rpc_types.h
src/scord/rpc_handlers.cpp
+2
-21
2 additions, 21 deletions
src/scord/rpc_handlers.cpp
with
36 additions
and
30 deletions
src/common/net/proto/rpc_types.h
+
34
−
9
View file @
f9bc8ceb
...
...
@@ -76,7 +76,7 @@ MERCURY_GEN_STRUCT_PROC(
hg_return_t
hg_proc_ADM_job_t
(
hg_proc_t
proc
,
void
*
data
);
struct
adm_qos_entity
{
typedef
struct
adm_qos_entity
{
ADM_qos_scope_t
e_scope
;
union
{
ADM_node_t
e_node
;
...
...
@@ -84,17 +84,27 @@ struct adm_qos_entity {
ADM_dataset_t
e_dataset
;
ADM_transfer_t
e_transfer
;
};
};
}
adm_qos_entity
;
// TODO: encoder/decoder
hg_return_t
hg_proc_ADM_qos_entity_t
(
hg_proc_t
proc
,
void
*
data
);
typedef
struct
adm_qos_limit
{
ADM_qos_entity_t
l_entity
;
ADM_qos_class_t
l_class
;
uint64_t
l_value
;
hg_
uint64_t
l_value
;
}
adm_qos_limit
;
// TODO: encoder/decoder
// clang-format off
MERCURY_GEN_STRUCT_PROC
(
adm_qos_limit
,
// NOLINT
((
ADM_qos_entity_t
)
(
l_entity
))
((
ADM_qos_class_t
)
(
l_class
))
((
hg_uint64_t
)
(
l_value
))
)
// clang-format on
typedef
struct
adm_transfer
{
uint64_t
t_id
;
...
...
@@ -377,17 +387,32 @@ MERCURY_GEN_PROC(ADM_in_transit_ops_in_t, ((hg_const_string_t) (in_transit)))
MERCURY_GEN_PROC
(
ADM_in_transit_ops_out_t
,
((
int32_t
)
(
ret
)))
struct
adm_qos_limit_list
{
/** An array of QoS limits */
adm_qos_limit
*
l_limits
;
/** The length of the array */
size_t
l_length
;
};
hg_return_t
hg_proc_ADM_qos_limit_list_t
(
hg_proc_t
proc
,
void
*
data
);
/// ADM_transfer_dataset
MERCURY_GEN_PROC
(
ADM_transfer_dataset_in_t
,
((
hg_const_string_t
)
(
source
))((
hg_const_string_t
)
(
destination
))(
(
hg_const_string_t
)
(
qos_constraints
))(
(
hg_const_string_t
)
(
distribution
))((
int32_t
)
(
job_id
)))
ADM_transfer_dataset_in_t
,
((
ADM_job_t
)
(
job_id
))
((
ADM_dataset_list_t
)
(
sources
))
((
ADM_dataset_list_t
)
(
targets
))
((
ADM_qos_limit_list_t
)
(
qos_limits
))
((
hg_int32_t
)
(
distribution
))
)
MERCURY_GEN_PROC
(
ADM_transfer_dataset_out_t
,
((
int32_t
)
(
ret
))
((
hg_const_string_t
)
(
transfer_handle
)))
MERCURY_GEN_PROC
(
ADM_transfer_dataset_out_t
,
((
int32_t
)
(
ret
))((
hg_const_string_t
)
(
transfer_handle
)))
/// ADM_set_dataset_information
...
...
This diff is collapsed.
Click to expand it.
src/scord/rpc_handlers.cpp
+
2
−
21
View file @
f9bc8ceb
...
...
@@ -980,28 +980,9 @@ ADM_transfer_dataset(hg_handle_t h) {
ret
=
margo_get_input
(
h
,
&
in
);
assert
(
ret
==
HG_SUCCESS
);
out
.
ret
=
-
1
;
out
.
transfer_handle
=
"fail"
;
if
(
in
.
source
==
nullptr
)
{
LOGGER_ERROR
(
"ADM_transfer_dataset(): invalid source (nullptr)"
);
}
else
if
(
in
.
destination
==
nullptr
)
{
LOGGER_ERROR
(
"ADM_transfer_dataset(): invalid destination (nullptr)"
);
}
else
if
(
in
.
qos_constraints
==
nullptr
)
{
LOGGER_ERROR
(
"ADM_transfer_dataset(): invalid qos_constraints (nullptr)"
);
}
else
if
(
in
.
distribution
==
nullptr
)
{
LOGGER_ERROR
(
"ADM_transfer_dataset(): invalid distribution (nullptr)"
);
}
else
if
(
in
.
job_id
<
0
)
{
LOGGER_ERROR
(
"ADM_transfer_dataset(): invalid job_id (< 0)"
);
}
else
{
LOGGER_INFO
(
"ADM_transfer_dataset({},{},{},{},{})"
,
in
.
source
,
in
.
destination
,
in
.
qos_constraints
,
in
.
distribution
,
in
.
job_id
);
out
.
ret
=
0
;
out
.
transfer_handle
=
"ok"
;
}
// TODO
out
.
ret
=
0
;
ret
=
margo_respond
(
h
,
&
out
);
assert
(
ret
==
HG_SUCCESS
);
...
...
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