Re: LCDM_gas simulation aborts in initialization

From: Volker Springel <volker_at_MPA-Garching.MPG.DE>
Date: Sat, 20 May 2006 11:04:53 +0200

ROBERT.J.MORGAN_at_asu.edu wrote:
> Am trying to run the lcdm_gas simualtion. Runs aborts in initialization with
> messages:
> "reading file '../ICs/lcdm_gas_littleendian.dat on task=0 (contains 65536
> particles.)
> distributing this file to tasks 0-0
> ... (then follows listing of types 0-5 particles) ...
>
> I/O error (fread) on task=0 has occured: no such file or directory
> task 0: endrun called with an error level of 778
>
> [0] MPI Abort by user Aborting program !
> [0] Aborting program!
> p0_11987: p4_error: :778 "
>
>
> Using gdb, problem seems to occur when read_file() in read_ic.c issues
> my_fread(CommBuffer, ...) at line 485 and my_fread() in io.c issues and fread()
> and gets nread=1 instead of nmemb=32768 and treats this as I/O error and calls
> endrun.

fread doen't distinguish between EOF and other errors when reading. From the
viewpoint of gadget, both are equally bad and the run needs to be
terminated. To see whether you are dealing with an end-of-file or another
error you can replace the line

       printf("I/O error (fread) on task=%d has occured: end of file\n",
ThisTask);

with
       if(feof(stream))
         printf("I/O error (fread) on task=%d has occured: end of file\n",
ThisTask);
       else
         printf("I/O error (fread) on task=%d has occured: %s\n", ThisTask,
strerror(errno));

I think you will likely see an end-of-file error now, i.e. your IC file is
corrupt somehow. (It should have a length of 1966376.)

> This seems questionable since an EOF can result in a short read (unless nmemb
> data had previously been written to file.)
>
> Am running on a single processor (for this run) on an AMD Athlon and Centos 4.1
> (Linux) OS. Not using mpirun though mpich is configured and loaded. Using
> lcdm_gas_littleendian.dat and lcdm_gas.param files (supplied w/download.)
>
> Have previously run the collisionless galaxy simulations on both single and
> multiple processors. But that doesn't use SPH which uses the CommBuffer.
>
> Should I just skip my_fread() and use fread() in initialization code for
> CommBuffer? Info fread doesn't seem to distinguish between IO error and EOF
> conditions, so is there some way to tell if actual I/O error?

Yes, see above.

Replacing my_fread with read will make the code ignore the I/O error. I
wouldn't recommend that since then some of the initial data is undefined
with unpredictable outcome.

Volker



> Thanks,
>
> Bob Morgan
>
> Arizona State University
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------
>
> If you wish to unsubscribe from this mailing, send mail to
> minimalist_at_MPA-Garching.MPG.de with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
> http://www.mpa-garching.mpg.de/gadget/gadget-list
Received on 2006-05-20 11:04:17

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:41 CEST