@@ -604,7 +604,9 @@ struct hkl_data
604604 /* when lengths a,b,c + angles are given (instead of vectors a,b,c) */
605605 if (info->m_aa && info->m_bb && info->m_cc)
606606 {
607- printf("Mode: lengths and angles\n");
607+ MPI_MASTER(
608+ printf("Mode: lengths and angles\n");
609+ );
608610 double as,bs,cs;
609611 if (info->m_a) as = info->m_a;
610612 else as = sqrt(info->m_ax*info->m_ax+info->m_ay*info->m_ay+info->m_az*info->m_az);
@@ -622,21 +624,27 @@ struct hkl_data
622624 /sin(info->m_cc*DEG2RAD);
623625 info->m_cx = sqrt(cs*cs - info->m_cz*info->m_cz - info->m_cy*info->m_cy);
624626
625- printf("Single_crystal: %s structure a=%g b=%g c=%g aa=%g bb=%g cc=%g ",
627+ MPI_MASTER(
628+ printf("Single_crystal: %s structure a=%g b=%g c=%g aa=%g bb=%g cc=%g ",
626629 (flag ? "INC" : SC_file), as, bs, cs, info->m_aa, info->m_bb, info->m_cc);
630+ );
627631 } else {
628632 if (!info->recip) {
629- printf("Mode: Direct mode lattice\n");
630- printf("Single_crystal: %s structure a=[%g,%g,%g] b=[%g,%g,%g] c=[%g,%g,%g] ",
631- (flag ? "INC" : SC_file), info->m_ax ,info->m_ay ,info->m_az,
632- info->m_bx ,info->m_by ,info->m_bz,
633- info->m_cx ,info->m_cy ,info->m_cz);
633+ MPI_MASTER(
634+ printf("Mode: Direct mode lattice\n");
635+ printf("Single_crystal: %s structure a=[%g,%g,%g] b=[%g,%g,%g] c=[%g,%g,%g] ",
636+ (flag ? "INC" : SC_file), info->m_ax ,info->m_ay ,info->m_az,
637+ info->m_bx ,info->m_by ,info->m_bz,
638+ info->m_cx ,info->m_cy ,info->m_cz);
639+ );
634640 } else {
635- printf("Mode: Reciprocal mode lattice\n");
636- printf("Single_crystal: %s structure a*=[%g,%g,%g] b*=[%g,%g,%g] c*=[%g,%g,%g] ",
637- (flag ? "INC" : SC_file), info->m_ax ,info->m_ay ,info->m_az,
638- info->m_bx ,info->m_by ,info->m_bz,
639- info->m_cx ,info->m_cy ,info->m_cz);
641+ MPI_MASTER(
642+ printf("Mode: Reciprocal mode lattice\n");
643+ printf("Single_crystal: %s structure a*=[%g,%g,%g] b*=[%g,%g,%g] c*=[%g,%g,%g] ",
644+ (flag ? "INC" : SC_file), info->m_ax ,info->m_ay ,info->m_az,
645+ info->m_bx ,info->m_by ,info->m_bz,
646+ info->m_cx ,info->m_cy ,info->m_cz);
647+ );
640648 }
641649 }
642650 /* Compute reciprocal or direct lattice vectors. */
@@ -645,7 +653,9 @@ struct hkl_data
645653 info->m_bx, info->m_by, info->m_bz,
646654 info->m_cx, info->m_cy, info->m_cz);
647655 info->V0 = fabs(scalar_prod(info->m_ax, info->m_ay, info->m_az, tmp_x, tmp_y, tmp_z));
648- printf("V0=%g\n", info->V0);
656+ MPI_MASTER(
657+ printf("V0=%g\n", info->V0);
658+ );
649659
650660 info->asx = 2*PI/info->V0*tmp_x;
651661 info->asy = 2*PI/info->V0*tmp_y;
@@ -673,7 +683,9 @@ struct hkl_data
673683 info->bsx/(2*PI), info->bsy/(2*PI), info->bsz/(2*PI),
674684 info->csx/(2*PI), info->csy/(2*PI), info->csz/(2*PI));
675685 info->V0 = 1/fabs(scalar_prod(info->asx/(2*PI), info->asy/(2*PI), info->asz/(2*PI), tmp_x, tmp_y, tmp_z));
676- printf("V0=%g\n", info->V0);
686+ MPI_MASTER(
687+ printf("V0=%g\n", info->V0);
688+ );
677689
678690 /*compute the direct cell parameters, ofr completeness*/
679691 info->m_ax = tmp_x*info->V0;
@@ -1168,12 +1180,17 @@ INITIALIZE
11681180 if (hkl_info.sigma_a<0) hkl_info.sigma_a=0;
11691181 if (hkl_info.sigma_i<0) hkl_info.sigma_i=0;
11701182
1171- if (hkl_info.count)
1172- printf("Single_crystal: %s: Read %d reflections from file '%s'\n",
1173- NAME_CURRENT_COMP, hkl_info.count, reflections);
1174- else printf("Single_crystal: %s: Using incoherent elastic scattering only sigma=%g.\n",
1183+ if (hkl_info.count) {
1184+ MPI_MASTER(
1185+ printf("Single_crystal: %s: Read %d reflections from file '%s'\n",
1186+ NAME_CURRENT_COMP, hkl_info.count, reflections);
1187+ );
1188+ } else {
1189+ MPI_MASTER(
1190+ printf("Single_crystal: %s: Using incoherent elastic scattering only sigma=%g.\n",
11751191 NAME_CURRENT_COMP, hkl_info.sigma_i);
1176-
1192+ );
1193+ }
11771194 /*this should not be in hkl_info*/
11781195 hkl_info.shape=-1; /* -1:no shape, 0:cyl, 1:box, 2:sphere, 3:any-shape */
11791196 if (geometry && strlen(geometry) && strcmp(geometry, "NULL") && strcmp(geometry, "0")) {
@@ -1195,10 +1212,11 @@ INITIALIZE
11951212 exit(fprintf(stderr,"Single_crystal: %s: sample has invalid dimensions.\n"
11961213 "ERROR Please check parameter values (xwidth, yheight, zdepth, radius).\n", NAME_CURRENT_COMP));
11971214
1198- printf("Single_crystal: %s: Vc=%g [Angs] sigma_abs=%g [barn] sigma_inc=%g [barn] reflections=%s\n",
1215+ MPI_MASTER(
1216+ printf("Single_crystal: %s: Vc=%g [Angs] sigma_abs=%g [barn] sigma_inc=%g [barn] reflections=%s\n",
11991217 NAME_CURRENT_COMP, hkl_info.V0, hkl_info.sigma_a, hkl_info.sigma_i,
12001218 reflections && strlen(reflections) ? reflections : "NULL");
1201-
1219+ );
12021220 if (powder && PG)
12031221 exit(fprintf(stderr,"Single_crystal: %s: powder and PG modes can not be used together!\n"
12041222 "ERROR Please use EITHER powder or PG mode.\n", NAME_CURRENT_COMP));
@@ -1218,16 +1236,16 @@ INITIALIZE
12181236 if (order==0 && extra_order) {
12191237 fprintf(stderr, "Single_crystal: %s: extra_order used while order=0, then this option has no effect\n", NAME_CURRENT_COMP);
12201238 }
1221-
1222- printf("Direct space lattice orientation:\n");
1223- printf(" a = [%g %g %g]\n", hkl_info.m_ax, hkl_info.m_ay, hkl_info.m_az);
1224- printf(" b = [%g %g %g]\n", hkl_info.m_bx, hkl_info.m_by, hkl_info.m_bz);
1225- printf(" c = [%g %g %g]\n", hkl_info.m_cx, hkl_info.m_cy, hkl_info.m_cz);
1226- printf("Reciprocal space lattice orientation:\n");
1227- printf(" a* = [%g %g %g]\n", hkl_info.asx, hkl_info.asy, hkl_info.asz);
1228- printf(" b* = [%g %g %g]\n", hkl_info.bsx, hkl_info.bsy, hkl_info.bsz);
1229- printf(" c* = [%g %g %g]\n", hkl_info.csx, hkl_info.csy, hkl_info.csz);
1230-
1239+ MPI_MASTER(
1240+ printf("Direct space lattice orientation:\n");
1241+ printf(" a = [%g %g %g]\n", hkl_info.m_ax, hkl_info.m_ay, hkl_info.m_az);
1242+ printf(" b = [%g %g %g]\n", hkl_info.m_bx, hkl_info.m_by, hkl_info.m_bz);
1243+ printf(" c = [%g %g %g]\n", hkl_info.m_cx, hkl_info.m_cy, hkl_info.m_cz);
1244+ printf("Reciprocal space lattice orientation:\n");
1245+ printf(" a* = [%g %g %g]\n", hkl_info.asx, hkl_info.asy, hkl_info.asz);
1246+ printf(" b* = [%g %g %g]\n", hkl_info.bsx, hkl_info.bsy, hkl_info.bsz);
1247+ printf(" c* = [%g %g %g]\n", hkl_info.csx, hkl_info.csy, hkl_info.csz);
1248+ );
12311249%}
12321250
12331251TRACE
@@ -1459,7 +1477,9 @@ TRACE
14591477 &coh_refl, &coh_xsect, oclContext_SX,
14601478 d_L, d_T, d_tau_count, d_coh_refl, d_coh_xsect);
14611479 if (tau_count != 0)
1480+ MPI_MASTER(
14621481 printf("\nGPU tau_count:%i\n",tau_count);
1482+ );
14631483 }
14641484 else
14651485 #endif
0 commit comments