Restart.dat file

14 views
Skip to first unread message

Michael Hansen

unread,
Mar 22, 2017, 5:03:44 AM3/22/17
to lens...@googlegroups.com
Hi,

I was wondering whether Lenstool isn't supposed to delete the
restart.dat file after a complete run?

Or is there a precise reason why the restart.dat file is retained even
after a succesfull run?

Cheers,
Michael


--
>
Michael F. Hansen


B.Ed / Professiosbachelor i undervisning

B.Sc in Physics / BSc i Fysik
M.Sc student in Physics / Stud.cand.scient i Fysik


Dark Cosmology Centre

Juliane Maries Vej 30
University of Copenhagen / Københavns Universitet
2100
Copenhagen East / København Ø

Denmark / Danmark



Mathilde Jauzac

unread,
Mar 22, 2017, 5:08:14 AM3/22/17
to lens...@googlegroups.com
Hi Michael

It is just not implemented I guess.
But you can delete it once you run is over.

Cheers
Mathilde
> --
> --
> _____________________________________________________________________
> LENSTOOL: http://projets.lam.fr/projects/lenstool/wiki
> To post to this group, send email to lens...@googlegroups.com
> To unsubscribe from this group, send email to lenstool-u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/lenstool?
> ---
> You received this message because you are subscribed to the Google Groups "lenstool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lenstool+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Michael Hansen

unread,
Mar 22, 2017, 6:25:56 AM3/22/17
to lens...@googlegroups.com
Hi Mathilde,

I think you are right. I found the simple solution to add the following
code in the bottom of the main.c file.

Maybe Jean-Paul or Eric can check whether this is a useful method and
possibly add it. So far, in my tests, it seems to be working fine.

if (remove("restart.dat") != 0)
perror("Error deleting restart.dat");
else
puts("restart.dat succesfully deleted ...");

I have also added the main.c file.
> --

main.c

Michael Hansen

unread,
Mar 22, 2017, 6:38:00 AM3/22/17
to lens...@googlegroups.com
Hi,

A small update. This seems like a more appropriate solution:

if ( M.icorshear != 0 )
cor_shear();

/* Check whether the restart flag is set, then delete restart.dat
after a successful optimization */
if (M.restart == 1) {
if (remove("restart.dat") != 0)
perror("Error deleting restart.dat");
else
puts("restart.dat successfully deleted ...");
}

In this way the error will not come up if the restart flag hasn't been
set. The M.icorshear is not part of my addition, but only to show where
I have added the code.

Cheers,
Michael

On Wed, 2017-03-22 at 09:08 +0000, Mathilde Jauzac wrote:
> --

main.c
Reply all
Reply to author
Forward
0 new messages