Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flexibility to VDC #41

Open
am1808 opened this issue Oct 1, 2019 · 6 comments
Open

Add flexibility to VDC #41

am1808 opened this issue Oct 1, 2019 · 6 comments

Comments

@am1808
Copy link
Collaborator

am1808 commented Oct 1, 2019

Hi Richard, I was thinking to tweak VDC to allow the possibility for the user to specify which snapshots to process. Is it OK?

@richard-evans
Copy link
Owner

Hi Andrea, yes indeed - but please base off the VDC branch. There are a few changes in there that will be moved into develop shortly (but default colour space is currently broken and waiting for Daniel to fix it). maybe add a --snapshot command line option, taking individual numbers or ranges, comma separated?

@am1808
Copy link
Collaborator Author

am1808 commented Oct 1, 2019

OK. I have created the branch "vdc_based_on_vdc_upstream" which I have just pushed. Could you have a look at it? If it is fine I will do a pull request.

I have created two distinct command line arguments "--frame-start" and "--frame-final" to allow an independent control of the initial and final snapshots to render.

@daniel-meilak
Copy link
Collaborator

I've noticed an issue with how vdc processes the spin metadata files. Without the --frame-final parameter provided manually, the program doesn't know the actual number of files and always gives the error "Error! Spins metadata file spins-000000xx.meta cannot be opened. Exiting".

This happens because the vdc_final_file_id is set to a large number by default and never gets changed.

I'm not sure how to fix this since none of the input files say how many meta data files there are.

@daniel-meilak
Copy link
Collaborator

daniel-meilak commented Apr 5, 2020

I think I found out how to fix it. Looks like I had made a small change to spins.cpp with the aim of helping that actually caused this issue

@daniel-meilak
Copy link
Collaborator

So, I added an Error massage that triggered if you provided a "--frame-final" which was larger than the number of frames availible. Unfortunately, this would always trigger if frame-final wasn't provided since the default value is 99999.

It would be nice if we could set the default value of frame-final internally but I'm guessing this is difficult to implement since the number of spin meta files changes according to the number of processors used int the simulation?

@richard-evans
Copy link
Owner

Yep, the problem is that the spin file parsing exits when it can't find the next file - it should actually fail silently at this step (an error should only be triggered if a data file cannot be found). The following patch fixes the bug.

diff --git a/util/vdc/spins.cpp b/util/vdc/spins.cpp
index 43d6836..de84a67 100644
--- a/util/vdc/spins.cpp
+++ b/util/vdc/spins.cpp
@@ -114,9 +114,10 @@ bool read_spin_metadata(unsigned int file_id){

// check for open file, if not open then end program, end of snapshots
if(!smfile.is_open()){
  •  std::cerr << "Error! Spins metadata file spins-" << std::setfill('0') << std::setw(8)
    
  •  << file_id << ".meta cannot be opened. Exiting" << std::endl;
    
  •  exit(1);
    
  •  //std::cerr << "Error! Spins metadata file spins-" << std::setfill('0') << std::setw(8)
    
  •  //<< file_id << ".meta cannot be opened. Exiting" << std::endl;
    
  •  //exit(1);
    
  •  return false;
    
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants