Hi Justin,
On Mon, Oct 29, 2007 at 01:11:54PM +0100, Justin Schmitz wrote:
> Hello All!
>
> I have a problem with the output there from CCP4 into the log files on a
> dual-Core Intel Mac with Os X Server 10.4 and CCP4 6.0.1.
>
>
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM13 Ano 0.147 -0.001 0.723 2.055 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM14 Ano 0.347 0.519 0.895 0.939 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM15 Ano 0.232 0.498 0.965 0.546 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM16 Ano 0.031 0.124 0.022 -2.575 MLPHARE: Normal termination
> Times: User: 84.9s System: 0.3s Elapsed: 1:27
> </pre>
> </html>
> <!--SUMMARY_END--></FONT></B>
> BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM17 Ano 0.027 -0.001 0.859 2.450 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM18 Ano 0.102 -0.002 0.870 3.247 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM19 Ano 0.025 0.107 0.024 5.815 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
> ATOM20 Ano 0.024 0.072 0.069 5.565 BFAC 20.000
> ATREF X ALL Y ALL Z ALL OCC ALL AOCC ALL B ALL
>
>
>
> Many Programs do this e.g. refmac. The Termination message is passed to
> the log file before all other data is in it. This breaks of ploting or
> in case of mlphare of the whole process.
>
> Does anybody know how to handle this? Is it related to the OS or to CCP4?
I have seen a similar problem with scaleit using a gfortran compiler
on a recent snapshot of the ccp4 tarball.
This was on an Intel T7500 equipped box running Fedora 8 (rawhide)
with these versions: gfortran-4.1.2 and glibc-2.7-2.
If you are compiling with gfortran you can give the attached patch a try:
cd $CCP4
patch -p0 < yt-fixup-ccperr-flushing-buglet.patch
make
With best wishes,
ClAuS
diff -ru lib/src/ccp4_general_f.c~ lib/src/ccp4_general_f.c
--- lib/src/ccp4_general_f.c~ 2005-09-08 17:27:26.000000000 +0100
+++ lib/src/ccp4_general_f.c 2007-10-29 13:06:50.000000000 +0000
@@ -198,6 +198,12 @@
strncpy(tmp_errstr,errstr,length);
tmp_errstr[length]='\0';
+ /* work around a buglet: gfortran-4.1.2 glibc-2.7-2 (2.6.23.1-37.fc8 x86_64
SMP)
+ Flush stdout using a Fortran call before printing further. C. Flensburg
20071029. */
+#ifdef GFORTRAN
+ FORTRAN_CALL (CCP4_FFLUSH_STDOUT, ccp4_fflush_stdout, (), (), ());
+#endif
+
if (abs(*istat) <= 2)
FORTRAN_CALL (CCP4H_SUMMARY_BEG, ccp4h_summary_beg, (), (), ());
diff -ru lib/src/unix.m4~ lib/src/unix.m4
--- lib/src/unix.m4~ 2007-05-30 16:53:19.000000000 +0100
+++ lib/src/unix.m4 2007-10-29 13:08:34.000000000 +0000
@@ -123,6 +123,7 @@
C options
C UGTARG - Get command-line argument
C hciftime - Time in cif format
+C ccp4_fflush_stdout - Flush buffers to stdout
C
C Functions:
C
@@ -934,3 +935,12 @@
C
+ subroutine ccp4_fflush_stdout()
+dnl work around a buglet: : gfortran-4.1.2 glibc-2.7-2
+dnl (2.6.23.1-37.fc8 x86_64 SMP) C. Flensburg 20071029.
+ implicit none
+ifelse(_gfort,1,
+[ call flush(6)
+],dnl (else)
+[ continue])
+ end