You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//printf("cosines are %g %g internal angle %g\n",cos_thermal,cos_cold,fabs(internal_angle));
320
+
321
321
ColdWidths = ColdWidthSW;
322
322
ThermalWidths = ThermalWidthSW;
323
323
int j;
@@ -373,26 +373,36 @@ INITIALIZE
373
373
C3_z=0;
374
374
isleft=1;
375
375
} else {
376
-
fprintf(stderr,"%s: Sector %s is undefined, please use N, W, S or E!\n", NAME_CURRENT_COMP,sector);
376
+
MPI_MASTER(
377
+
fprintf(stderr,"%s: Sector %s is undefined, please use N, W, S or E!\n", NAME_CURRENT_COMP,sector);
378
+
);
377
379
exit(-1);
378
380
}
379
381
if (beamline > jmax || beamline <= 0 ) {
380
-
fprintf(stderr,"%s: beamline no %i is undefined in sector %s, please use 1 <= beamline <= %i\n", NAME_CURRENT_COMP, beamline, sector, jmax);
382
+
MPI_MASTER(
383
+
fprintf(stderr,"%s: beamline no %i is undefined in sector %s, please use 1 <= beamline <= %i\n", NAME_CURRENT_COMP, beamline, sector, jmax);
384
+
);
381
385
exit(-1);
382
386
}
383
-
384
-
printf("%s: Setting up for sector %s, beamline %i, global orientation angle is %g, internal angle %g\n", NAME_CURRENT_COMP, sector,beamline,orientation_angle,beamportangle);
387
+
388
+
MPI_MASTER(
389
+
printf("%s: Setting up for sector %s, beamline %i, global orientation angle is %g, internal angle %g\n", NAME_CURRENT_COMP, sector,beamline,orientation_angle,beamportangle);
390
+
);
385
391
if (c_performance <= 0) {
386
392
fprintf(stderr,"%s: Cold performance scalar of %g is not allowed. Please select 0 < c_performance\n", NAME_CURRENT_COMP, c_performance);
387
393
exit(-1);
388
394
}
389
395
if (t_performance <= 0) {
390
-
fprintf(stderr,"%s: Thermal performance scalar of %g is not allowed. Please select 0 < t_performance\n", NAME_CURRENT_COMP, t_performance);
396
+
MPI_MASTER(
397
+
fprintf(stderr,"%s: Thermal performance scalar of %g is not allowed. Please select 0 < t_performance\n", NAME_CURRENT_COMP, t_performance);
398
+
);
391
399
exit(-1);
392
400
}
393
401
if (Lmin>=Lmax || Lmin <= 0 || Lmax < 0) {
394
-
fprintf(stderr,"%s: Unmeaningful definition of wavelength range!\nPlease select Lmin, Lmax > 0 and Lmax > Lmin.\n ERROR - Exiting\n",
402
+
MPI_MASTER(
403
+
fprintf(stderr,"%s: Unmeaningful definition of wavelength range!\nPlease select Lmin, Lmax > 0 and Lmax > Lmin.\n ERROR - Exiting\n",
395
404
NAME_CURRENT_COMP);
405
+
);
396
406
exit(-1);
397
407
}
398
408
/* Figure out where to aim */
@@ -404,19 +414,28 @@ INITIALIZE
404
414
coords_get(ToTarget, &tx, &ty, &tz);
405
415
dist=sqrt(tx*tx+ty*ty+tz*tz);
406
416
} else if (!target_index && !dist) {
407
-
fprintf(stderr,"%s: Please choose to set either the dist parameter or specify a target_index.\nExit\n", NAME_CURRENT_COMP);
417
+
MPI_MASTER(
418
+
fprintf(stderr,"%s: Please choose to set either the dist parameter or specify a target_index.\nExit\n", NAME_CURRENT_COMP);
419
+
);
408
420
exit(-1);
409
421
} else {
410
422
tx=0; ty=0; tz=dist;
411
423
}
412
-
printf("%s: Focusing at rectagle sized %g x %g \n - positioned at location (x,y,z)=(%g m, %g m, %g m) \n", NAME_CURRENT_COMP, focus_xw, focus_yh, tx, ty, tz);
424
+
MPI_MASTER(
425
+
printf("%s: Focusing at rectagle sized %g x %g \n - positioned at location (x,y,z)=(%g m, %g m, %g m) \n", NAME_CURRENT_COMP, focus_xw, focus_yh, tx, ty, tz);
printf(" ( from dist parameter -> distance %g )\n", dist);
432
+
MPI_MASTER(
433
+
printf(" ( from dist parameter -> distance %g )\n", dist);
434
+
);
417
435
}
418
-
printf("%s: Cold and Thermal brilliance performance multiplicators are c_performance=%g and t_performance=%g\n", NAME_CURRENT_COMP, c_performance, t_performance);
419
-
436
+
MPI_MASTER(
437
+
printf("%s: Cold and Thermal brilliance performance multiplicators are c_performance=%g and t_performance=%g\n", NAME_CURRENT_COMP, c_performance, t_performance);
438
+
);
420
439
/* Calculate orientation matrix for the display and calculations */
printf("%s: Using time focusing: Directing neutrons to this time-window:\n tfocus_width (%g s) wide at tfocus_time (%g s), tfocus_dist (%g m) downstream\n",NAME_CURRENT_COMP, tfocus_width, tfocus_time, tfocus_dist);
466
+
MPI_MASTER(
467
+
printf("%s: Using time focusing: Directing neutrons to this time-window:\n tfocus_width (%g s) wide at tfocus_time (%g s), tfocus_dist (%g m) downstream\n",NAME_CURRENT_COMP, tfocus_width, tfocus_time, tfocus_dist);
468
+
);
448
469
} else if (!tfocus_width && !tfocus_time && !tfocus_dist) {
449
-
printf("%s: NOT using time focusing\n",NAME_CURRENT_COMP);
470
+
MPI_MASTER(
471
+
printf("%s: NOT using time focusing\n",NAME_CURRENT_COMP);
472
+
);
450
473
} else {
451
-
fprintf(stderr,"%s: Unmeaningful combination tfocus_width (%g s), tfocus_time (%g s) and tfocus_dist (%g m): \n All must be either==0 (no time focusing) or !=0 (time focusing)\n ERROR - Exiting\n",
474
+
MPI_MASTER(
475
+
fprintf(stderr,"%s: Unmeaningful combination tfocus_width (%g s), tfocus_time (%g s) and tfocus_dist (%g m): \n All must be either==0 (no time focusing) or !=0 (time focusing)\n ERROR - Exiting\n",
0 commit comments