Menu

#2 Make matsolve write save files

open
nobody
None
5
2006-03-10
2006-03-10
No

This patch implements a simple save file facility for
matsolve.

When invoked with the command line parameter '-save
N', matsolve will write a save file every N minutes.
A save file is also written whenever matsolve is
interrupted with ctrl-c or terminated.

A matrix with n columns will result in a save file
of 64n+4624 bytes. A backup of the current save file
is made before writing a new one. If a save file
exists in the current directory then matsolve will
resume from it when started.

The save file format is architecture independent (all
data is stored littlendian), however the files
written by matbuild are not and this would need to be
fixed before it would be possible to resume a
matsolve job started on a different architecture.

The patch is against the CVS version as at 9 March
2006. Most of the code is contained in a new file
src/matsave.c, but maybe that file would be better
merged into matsolve.c. The patch also modifies
src/Makefile, include/ggnfs.h, src/matsolve.c,
src/blanczos64.c and src/blanczos64-no-mmx.c.

I have done some testing on x86 Linux, but have no
way to test or compile for any other platform. Let me
know if there is anything else I can do to help.

Discussion

  • Geoffrey Reynolds

    Patch to make matsolve write save files

     
  • Geoffrey Reynolds

    Logged In: YES
    user_id=1302824

    I have attached an alternative patch, matsave2-patch.txt,
    which does everything the first patch does and in addition:

    1. Use of alarm() is avoided.
    2. Automatically resumes from the backup save file if
    there is a problem with the main save file.
    3. Pointer parameters to matsave() are declared const so
    as not to reduce the compiler's options when
    optimising blockLanczos64(). This might cause some
    harmless compiler warnings when GGNFS_BIGENDIAN is
    defined.
    4. Error messages include the name of the file that
    caused the problem.

    It still needs whatever changes the first patch needed to
    use binary files on mingw.

    If it is too late to use this patch instead of the first I
    will submit a diff against the first at a later date.

     
  • Geoffrey Reynolds

    Alternative patch to make matsave write save files, with improvements.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.