Skip to content
Snippets Groups Projects
Commit 9a6d9757 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Remove debugging output, tidy up output and make sure we return restart files...

Remove debugging output, tidy up output and make sure we return restart files in order, at least up to 1M files.
parent 271c51d3
Branches
Tags
1 merge request!491Add restart facility
...@@ -496,11 +496,11 @@ int main(int argc, char *argv[]) { ...@@ -496,11 +496,11 @@ int main(int argc, char *argv[]) {
if (restart) { if (restart) {
/* Attempting a restart. */ /* Attempting a restart. */
message("Restarting SWIFT");
char **restartfiles = NULL; char **restartfiles = NULL;
int nrestartfiles = 0; int nrestartfiles = 0;
if (myrank == 0) { if (myrank == 0) {
message("Restarting SWIFT");
/* Locate the restart files. */ /* Locate the restart files. */
restartfiles = restart_locate(restartdir, restartname, &nrestartfiles); restartfiles = restart_locate(restartdir, restartname, &nrestartfiles);
......
...@@ -50,8 +50,7 @@ ...@@ -50,8 +50,7 @@
*/ */
int restart_genname(const char *dir, const char *basename, int nodeID, int restart_genname(const char *dir, const char *basename, int nodeID,
char *name, int size) { char *name, int size) {
int n = snprintf(name, size, "%s/%s_%04d.rst", dir, basename, nodeID); int n = snprintf(name, size, "%s/%s_%06d.rst", dir, basename, nodeID);
message("name = %s", name);
return (n >= size); return (n >= size);
} }
...@@ -63,7 +62,9 @@ int restart_genname(const char *dir, const char *basename, int nodeID, ...@@ -63,7 +62,9 @@ int restart_genname(const char *dir, const char *basename, int nodeID,
* @param nfiles the number of restart files located. * @param nfiles the number of restart files located.
* *
* @result pointer to an array of strings with all the filenames found, * @result pointer to an array of strings with all the filenames found,
* release by calling restart_locate_free(). * these should be collated using the current locale, i.e. sorted
* alphabetically (so make sure the filenames are zero padded to get
* numeric ordering). Release by calling restart_locate_free().
*/ */
char **restart_locate(const char *dir, const char *basename, int *nfiles) { char **restart_locate(const char *dir, const char *basename, int *nfiles) {
*nfiles = 0; *nfiles = 0;
...@@ -123,7 +124,7 @@ void restart_write(struct engine *e, const char *filename) { ...@@ -123,7 +124,7 @@ void restart_write(struct engine *e, const char *filename) {
} }
/** /**
* @brief Read a restart file to construct an saved engine. * @brief Read a restart file to construct a saved engine.
*/ */
void restart_read(struct engine *e, const char *filename) { void restart_read(struct engine *e, const char *filename) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment