-
Notifications
You must be signed in to change notification settings - Fork 138
Mattdon/new melcor interface #2017
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
base: devel
Are you sure you want to change the base?
Conversation
This reverts commit 49913b9.
…to mattdon/New_MELCOR_Interface
Job Mingw Test on 3eb7f67 : invalidated by @joshua-cogliati-inl restarted civet |
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrea Alfonsi - NuCube <[email protected]>
ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mandd I have a couple of comments for you to consider.
@@ -13,104 +13,168 @@ | |||
# limitations under the License. | |||
""" | |||
Created on April 18, 2017 | |||
@author: Matteo Donorio (University of Rome La Sapienza), | |||
Fabio Gianneti (University of Rome La Sapienza), | |||
@author: Matteo D'Onorio (Sapienza University of Rome) | |||
Andrea Alfonsi (INL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably you need to update the affiliation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
This class is used a part of a code dictionary to specialize Model. Code for different MELCOR versions | ||
like MELCOR 2.2x, MELCOR 1.86, MELCOR for fusion applications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, is there any way that we can check the MELCOR version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure tbh
from .melgenInterface import MelgenApp | ||
from ..Generic import GenericParser | ||
import pandas as pd | ||
|
||
|
||
class Melcor(CodeInterfaceBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make Melcor interface inherit from GenericCodeInterface? I saw you are using GenericParser already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we rely only on the genericParser which is a separate module also called by GenericCode interface
Two addtional nodes need to be specified: the first one (i.e., \xmlNode{CodePlotFile}) indicates the name of the MELCOR plot file. | ||
The second one (i.e., \xmlNode{MelcorOutput}) specifies the name of the MELCOR message file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest add more detailed descriptions here. For example, what are the text format for the nodes? I assume the code can only accept one file for each of the nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a small additional description, now that we have a MELCOR user in the group we will gather more experience on this interface
self.melcorPlotFile = [var.strip() for var in plotNode.text.split(",")][0] | ||
self.melcorOutFile = [var.strip() for var in melNode.text.split(",")][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines indicate you may allow users to provide more than one files, but you only use the first file. Could you clarify why you would like to do it in this way? Do you expect to extend the interface to accept more files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
returnCommand = melgCommand + melcCommand, melcOut | ||
found = False | ||
|
||
melcOut = 'OUTPUT_MELCOR' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you define the "melcOut" in the init method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
precommand = executable | ||
melgCommand = str(preExec) + ' ' + melcin.getFilename() | ||
melcCommand = str(precommand) + ' ' + melcin.getFilename() | ||
returnCommand = [('serial',melgCommand + ' && ' + melcCommand +' ow=o ')],melcOut |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, can Melcor run in parallel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not think so
parser = GenericParser.GenericParser(inFiles) | ||
parser.modifyInternalDictionary(**Kwargs) | ||
parser.writeNewInput(currentInputFiles,origFiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me you can make this class inherit from Generic Code Interface class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above
failure = self.melcorInterface.checkForOutputFailure(output, workingDir) | ||
return failure | ||
failure = True | ||
goodWord = "Normal termination" # This is for MELCOR 2.2 (todo: list for other MELCOR versions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we define the "goodWord" in init method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to init
Job Test mac on de9ceac : invalidated by @joshua-cogliati-inl failed in set python environment with download failure |
@mandd I would also move the MELCOR test(s) in its dedicated folder (for better organization of the CodeInterface test folder) |
Job Mingw Test on 1e8fbe9 : invalidated by @joshua-cogliati-inl restarted civet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mandd Some minor comments for you to consider.
<author>mattdon</author> | ||
<created>2023-02-20</created> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not change the author here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
def finalizeCodeOutput(self, command, output, workingDir): | ||
if "dynamicevent" in samplerType.lower(): | ||
raise IOError("Dynamic Event Tree-based samplers not implemented for MELCOR yet! But we are working on that.") | ||
indexes = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems variable "indexes" is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressing latest comments
<author>mattdon</author> | ||
<created>2023-02-20</created> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Job Test Ubuntu 18 PIP on eeebb8c : invalidated by @mandd |
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #2125
What are the significant changes in functionality due to this change request?
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.