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
5ecf00ac
Verified
Commit
5ecf00ac
authored
2 years ago
by
ANA MANZANO RODRIGUEZ
Committed by
Alberto Miranda
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ADM_transfer_dataset.c modified with job inicialization
parent
56a8893d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Resolve "Execute RPCs tests in CI"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/c/ADM_transfer_dataset.c
+44
-0
44 additions, 0 deletions
examples/c/ADM_transfer_dataset.c
with
44 additions
and
0 deletions
examples/c/ADM_transfer_dataset.c
+
44
−
0
View file @
5ecf00ac
...
...
@@ -25,6 +25,10 @@
#include
<stdlib.h>
#include
<stdio.h>
#include
<admire.h>
#include
<assert.h>
#define NINPUTS 10
#define NOUTPUTS 5
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -39,6 +43,46 @@ main(int argc, char* argv[]) {
ADM_server_t
server
=
ADM_server_create
(
"tcp"
,
argv
[
1
]);
ADM_job_t
job
;
ADM_dataset_t
inputs
[
NINPUTS
];
for
(
int
i
=
0
;
i
<
NINPUTS
;
++
i
)
{
const
char
*
pattern
=
"input-dataset-%d"
;
size_t
n
=
snprintf
(
NULL
,
0
,
pattern
,
i
);
char
*
id
=
(
char
*
)
malloc
(
n
+
1
);
snprintf
(
id
,
n
+
1
,
pattern
,
i
);
inputs
[
i
]
=
ADM_dataset_create
(
id
);
}
ADM_dataset_t
outputs
[
NOUTPUTS
];
for
(
int
i
=
0
;
i
<
NOUTPUTS
;
++
i
)
{
const
char
*
pattern
=
"output-dataset-%d"
;
size_t
n
=
snprintf
(
NULL
,
0
,
pattern
,
i
);
char
*
id
=
(
char
*
)
malloc
(
n
+
1
);
snprintf
(
id
,
n
+
1
,
pattern
,
i
);
outputs
[
i
]
=
ADM_dataset_create
(
id
);
}
ADM_adhoc_context_t
ctx
=
ADM_adhoc_context_create
(
ADM_ADHOC_MODE_SEPARATE_NEW
,
ADM_ADHOC_ACCESS_RDWR
,
42
,
100
,
false
);
assert
(
ctx
);
ADM_storage_t
st
=
ADM_storage_create
(
"foobar"
,
ADM_STORAGE_GEKKOFS
,
ctx
);
assert
(
st
);
ADM_job_requirements_t
reqs
=
ADM_job_requirements_create
(
inputs
,
NINPUTS
,
outputs
,
NOUTPUTS
,
st
);
assert
(
reqs
);
ADM_return_t
ret_job
=
ADM_register_job
(
server
,
reqs
,
&
job
);
if
(
ret_job
!=
ADM_SUCCESS
)
{
fprintf
(
stdout
,
"ADM_register_job() remote procedure not completed "
"successfully
\n
"
);
exit_status
=
EXIT_FAILURE
;
}
ADM_dataset_t
**
sources
=
NULL
;
ADM_dataset_t
**
targets
=
NULL
;
ADM_qos_limit_t
**
limits
=
NULL
;
...
...
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