aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-04-02 12:04:37 +0200
committerThomas White <taw@bitwiz.org.uk>2010-04-02 12:04:37 +0200
commit0f58e0fc3418fdd5a97de533e2e2818b8d81c941 (patch)
tree4bda5815d4200e991acf5907571c9ccac3fe1c55 /src
parent00de16a88792c66f04b0aeba7bee800f65beab88 (diff)
Use per-thread xfel.drx files
Diffstat (limited to 'src')
-rw-r--r--src/dirax.c3
-rw-r--r--src/image.h2
-rw-r--r--src/index.c5
-rw-r--r--src/indexamajig.c3
4 files changed, 11 insertions, 2 deletions
diff --git a/src/dirax.c b/src/dirax.c
index 1f1f769f..0930f8f9 100644
--- a/src/dirax.c
+++ b/src/dirax.c
@@ -190,7 +190,8 @@ static void dirax_send_next(struct image *image)
break;
case 2 :
- dirax_sendline("read xfel.drx\n", image);
+ snprintf(tmp, 31, "read xfel-%i.drx\n", image->id);
+ dirax_sendline(tmp, image);
break;
case 3 :
diff --git a/src/image.h b/src/image.h
index e8234996..39719acf 100644
--- a/src/image.h
+++ b/src/image.h
@@ -77,6 +77,8 @@ struct image {
int ncells;
struct detector det;
+ int id;
+
struct quaternion orientation;
/* Wavelength must always be given */
diff --git a/src/index.c b/src/index.c
index f2b8ffb9..fdaa227c 100644
--- a/src/index.c
+++ b/src/index.c
@@ -34,8 +34,11 @@ static void write_drx(struct image *image)
{
FILE *fh;
int i;
+ char filename[1024];
- fh = fopen("xfel.drx", "w");
+ snprintf(filename, 1023, "xfel-%i.drx", image->id);
+
+ fh = fopen(filename, "w");
if ( !fh ) {
ERROR("Couldn't open temporary file xfel.drx\n");
return;
diff --git a/src/indexamajig.c b/src/indexamajig.c
index e27c8c30..db09928f 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -43,6 +43,7 @@
struct process_args
{
char *filename;
+ int id;
pthread_mutex_t *output_mutex; /* Protects stdout */
pthread_mutex_t *gpu_mutex; /* Protects "gctx" */
UnitCell *cell;
@@ -240,6 +241,7 @@ static void *process_image(void *pargsv)
image.features = NULL;
image.data = NULL;
image.indexed_cell = NULL;
+ image.id = pargs->id;
STATUS("Processing '%s'\n", filename);
@@ -562,6 +564,7 @@ int main(int argc, char *argv[])
pargs->intensities = intensities;
pargs->counts = counts;
pargs->gctx = gctx;
+ pargs->id = i;
worker_args[i] = pargs;
worker_active[i] = 1;