arfc / predicting-the-past

The predicting the past project.
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Create a full-fledged input file #14

Closed katyhuff closed 7 years ago

katyhuff commented 7 years ago

Using the reactor and recipe definitions you created in previous issues, create a fully working simulation input file to represent the past history of the united states reactor fleet.

The simulation has the following parameters:

This issue can be closed when a complete and running xml file is submitted to this repository.

katyhuff commented 7 years ago

When you are done with this @gyutaepark , we may be able to use @adityapb's work to run many parameterized simulations of this scenario on blue waters.

gyutaepark commented 7 years ago

@katyhuff Hi, I am currently working on the input file, but have an issue with Relax-NG parser error.

in_memory_buffer:436: element choice: Relax-NG parser error : Unexpected node text is not a pattern

I was trying to validate the xml input file againt a Relax-NG schema for cyclus so I can figure out what is wrong. I have tried using 'cyclus/share/cyclus.rng.in' for validation but according to xmllint, the 'cyclus.rng.in' fails to compile.

Can I get some hints on this please?

gyutaepark commented 7 years ago

Oops, I managed to find the schema from fuelcycle after some searching around with different key words. I will work on this

gyutaepark commented 7 years ago

Actually, the file found was still cyclus.rng.in.

Using xmllint, which is an xml file validator, the rng file still fails to compile. May I get some hints on this please?

katyhuff commented 7 years ago

What exactly are you trying to do? It's hard for me to give you a hint because I can't tell what input file you're trying to run or what commands are trying to execute. I also can't exactly tell what the purpose is. In general I can't diagnose anything without a link to the XML file that you're trying to run, or exactly which commands you executed before you received your error. For example, I don't know what you mean by saying you tried to use cyclus.rng.in for validation. Actually running cyclus is the appropriate way to use cyclus.rng.in for validation.

If you were just trying to test that your XML file works as a valid xmllint input file then you should run it as an input to cyclus.

To test a cyclus input file, you don't need xmllint. You shouldn't be trying to compile the installed cyclus.rng.in file.

To test an input file, You need to run cyclus. Run cyclus with the input you would like to test (cyclus will refer to its rng file plus the additions made by cycamore, etc. with reliance on the relaxng library.) cyclus will do the validation.

On Mon, Jun 5, 2017, 10:29 PM gyutaepark notifications@github.com wrote:

Actually, the file found was still cyclus.rng.in.

Using xmllint, which is an xml file validator, the rng file still fails to compile. May I get some hints on this please?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arfc/predicting-the-past/issues/14#issuecomment-306371797, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYCq-d4BgegvpaiJY16vQWG8icauYujks5sBMeHgaJpZM4NqzVi .

gyutaepark commented 7 years ago

Sorry for the confusion. I got into the error message, 'in_memory_buffer:436: element choice: Relax-NG parser error : Unexpected node text is not a pattern' when I tried running the 'cyclus_input/predicting_the_past.xml' file.

Since the error message was related to xml parsing with Relax-NG parser, I was hoping I could use the schema from cyclus to see if the 'predicting_the_past.xml' file follows the schema.

katyhuff commented 7 years ago

A relaxng parser error means that it doesn't follow the schema.

gyutaepark commented 7 years ago

yes, but it doesn't tell me where. So I was hoping if I could use a separate program to check these two but using xmllint, the schema fails to parse as well according to xmllint. I will try using some other software to see where I deviate from the schema after my tax meeting.

katyhuff commented 7 years ago

It is telling you where, just not very clearly. You create a much larger "file" in memory based on the many files that are one disk. The error is in "in_memory_buffer" ( I presume where the merged "file" is held in memory ), at line 436. So, what's the 436th line of the file you're ultimately creating with these includes?

line 16 of the top level file includes parts of buildtimes.xml which then include other files (the reactors). I suspect that means your error falls somewhere among your reactor definitions. Each reactor definition is 18 lines long (or thereabouts). So, maybe it's the Xth reactor in the list where X = (436-16)/ 18 .

katyhuff commented 7 years ago

(but, I should add, good thinking on your part, trying to use xmllint. I like your persistence!!)

gyutaepark commented 7 years ago

@katyhuff Running input file that parses and runs fully is uploaded and tested. To run the input file, go to cyclus_input/ and type 'cyclus -i predicting_the_past.xml'

Currently this runs with 112 reactors deploying at different times and takes a while (especially with my laptop...) But I have run the simulation with two reactors and it runs without issues as far as I could tell (it was hard to tell due to all the cyclib error messages that we should be ignoring).

To run the simulation with less reactors, 'deploy_reactors.py' script should be run with any number of reactors specified as input arguments.

katyhuff commented 7 years ago

Let's not close this until the associated pull request is merged.

gyutaepark commented 7 years ago

I have run the input file but after going through the output file, I realized that the time series power stays 0 throughout the simulation.

I will attempt to fix this issue. I think it may be related to buildtime and life time.

gyutaepark commented 7 years ago

@katyhuff I have a question regarding DeployInsts. Does it build prototypes one at a time or simultaneously?

So if I have Reactor A and B in prototype with build_times 1 and 10, do they start building at timestep 0, and finish at timestep 1 and 10, respectively? Or does A get built first at time step 1 and B get built once A is done building?

gyutaepark commented 7 years ago

Oops, I'm sorry I've found out that they are simultaneous. Please ignore the comment above.

gyutaepark commented 7 years ago

@katyhuff Hi, I know you're busy at this moment so please review this at a time when you are more free.

This is my progress so far:

  1. Finished cyclus input file
  2. Ran cyclus simulation
  3. Worked with Teddy on the analysis script
  4. Analyzed cyclus output file with the updated script

I have uploaded the results to the analysis folder. At this moment there are a few things to note:

Exception ignored in: 'pymodule.clear_pyagent_refs' NameError: name 'cyclib' is not defined

What should my next course of action be?

gyutaepark commented 7 years ago

Oh, and I have also realized that I was sent a form for accessing blue waters, a while ago but have missed the application deadline.

Would it be possible for me to be invited again please? I'm sorry about the inconvinience caused here.

katyhuff commented 7 years ago

quick note:

Exception ignored in: 'pymodule.clear_pyagent_refs' NameError: name 'cyclib' is not defined ^ this should be solved by installing pandas ( https://github.com/cyclus/cyclus/issues/1388)

I'll try to re-send the invitation from blue waters. I'm not sure when I'll have a chance to review code. Maybe sometime over the holiday weekend.

On Wed, Jun 28, 2017 at 3:39 PM, gyutaepark notifications@github.com wrote:

Oh, and I have also realized that I was sent a form for accessing blue waters, a while ago but have missed the application deadline.

Would it be possible for me to be invited again please? I'm sorry about the inconvinience caused here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arfc/predicting-the-past/issues/14#issuecomment-311782554, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYCq251LsiliW5Hf-6maashZM7rs5ibks5sIroNgaJpZM4NqzVi .

-- http://katyhuff.github.com

gyutaepark commented 7 years ago

Thank you, I'll try to install pandas, although it may already be installed with anaconda3. Also, please don't check the code over your holidays, you can do it later :)

I'd just like a few do this notes or things I can do after the analysis or for that.

Thank you

katyhuff commented 7 years ago

yes, it should be installed with anaconda. Is anaconda the python you're using (try "which python")? You may be using the system python.

On Wed, Jun 28, 2017 at 9:09 PM, gyutaepark notifications@github.com wrote:

Thank you, I'll try to install pandas, although it may already be installed with anaconda3. Also, please don't check the code over your holidays, you can do it later :)

I'd just like a few do this notes or things I can do after the analysis or for that.

Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arfc/predicting-the-past/issues/14#issuecomment-311842368, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYCq9uUIS-EvO5C8S7YF6VeJ7chEdPVks5sIwdkgaJpZM4NqzVi .

-- http://katyhuff.github.com

gyutaepark commented 7 years ago

yes, I am using anaconda python

katyhuff commented 7 years ago

my understanding was that this error does not appear if pandas can be imported. Please investigate?

On Wed, Jun 28, 2017 at 9:13 PM, gyutaepark notifications@github.com wrote:

yes, I am using anaconda python

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arfc/predicting-the-past/issues/14#issuecomment-311842888, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYCq-4cjvCRbGqhA_XkTFVqFn7Ktkjkks5sIwhUgaJpZM4NqzVi .

-- http://katyhuff.github.com

gyutaepark commented 7 years ago

I was able to import pandas from python. I'll try to build cyclus again to see if that fixes the problem

adityapb commented 7 years ago

If you're using the prefix option, try adding prefix/lib/pythonX.Y/site-packages to PYTHONPATH

gyutaepark commented 7 years ago

@adityapb This is my current path: "/home/user/anaconda3/bin:/home/user/cyclus/install/bin:$PATH"

When I build cyclus, I do install it with a --prefix option but I do not have a PYTHONPATH, should I add one to .bashrc?

adityapb commented 7 years ago

@gyutaepark Yes. You can also set it in the terminal to check if it works first and then add it to bashrc if it does

gyutaepark commented 7 years ago

@adityapb Added export PYTHONPATH="/home/user/anaconda3/lib/python3.6/site-packages:${PYTHONPATH}" to my bashrc file and then buildcyclus again, but the error still persists... What should I try next?

adityapb commented 7 years ago

I am out of ideas. Maybe you could stop by my desk tomorrow afternoon, we could have a look.

gyutaepark commented 7 years ago

Will do :) Currently trying to get pyne with conda 3 but with no luck

gyutaepark commented 7 years ago

@katyhuff I think this branch is now ready for discussion. I've done all the analysis part but may need to confirm with you to see if the results are reasonable. All analysis results are available in the ipython notebook in analysis folder.

katyhuff commented 7 years ago

@gyutaepark , Excellent! Please make a pull request -- I assume that by "this branch" you mean the develop branch, but please make a PR from your develop branch to master with the content that you would like to have reviewed.

I will look at this as soon as possible. In the meantime, @jbae11, do you think you could conduct a review of that pull request from @gyutaepark ?

katyhuff commented 7 years ago

Can this be closed ( @gyutaepark @jbae11 )? No one responded, but I see #17 was merged. Please mention the issue in the PR or the PR in the issue to connect them. Also, please close an issue if your PR fixing it has been pulled.

gyutaepark commented 7 years ago

Oops sorry about the delay. This has been completed with #16 . I'll close this issue now.