aboutsummaryrefslogtreecommitdiff
path: root/src/im-sandbox.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-06 15:15:21 +0200
committerThomas White <taw@physics.org>2022-06-02 12:15:38 +0200
commit45d3a8670da1d40145202ed42129c7cddba18df5 (patch)
tree48297ece6772830025a9063105fec34eb3542725 /src/im-sandbox.c
parentb28228b5826235ca917d9f42af7d22f75b38bb13 (diff)
ASAP::O: Group ID stuff
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r--src/im-sandbox.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index ed58a3be..654f07d1 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -62,6 +62,7 @@
#include "process_image.h"
#include "im-zmq.h"
#include "profile.h"
+#include "im-asapo.h"
struct sandbox
@@ -110,6 +111,7 @@ struct sandbox
const char *asapo_token;
const char *asapo_beamtime;
const char *asapo_path;
+ AsapoStringHandle asapo_group_id;
/* Final output */
Stream *stream;
@@ -356,12 +358,13 @@ static int run_work(const struct index_args *iargs, Stream *st,
}
if ( sb->asapo ) {
- zmqstuff = im_zmq_connect(sb->zmq_address,
- sb->zmq_subscriptions,
- sb->n_zmq_subscriptions,
- sb->zmq_request);
- if ( zmqstuff == NULL ) {
- ERROR("ZMQ setup failed.\n");
+ asapostuff = im_asapo_connect(sb->asapo_endpoint,
+ sb->asapo_token,
+ sb->asapo_beamtime,
+ sb->asapo_path,
+ sb->asapo_group_id);
+ if ( asapostuff == NULL ) {
+ ERROR("ASAP::O setup failed.\n");
return 1;
}
}
@@ -1077,6 +1080,7 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
int n_zmq_subscriptions, const char *zmq_request,
const char *asapo_endpoint, const char *asapo_token,
const char *asapo_beamtime, const char *asapo_path,
+ const char *asapo_group_id,
int timeout, int profile)
{
int i;
@@ -1132,6 +1136,15 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
return 0;
}
+ if ( asapo_group_id != NULL ) {
+ sb->asapo_group_id = im_asapo_group_id_from_string(asapo_group_id);
+ } else {
+ sb->asapo_group_id = im_asapo_make_unique_group_id(asapo_endpoint,
+ asapo_token,
+ asapo_beamtime,
+ asapo_path);
+ }
+
sb->fds = NULL;
sb->fhs = NULL;
sb->stream = stream;