-
Notifications
You must be signed in to change notification settings - Fork 6
Rotate for json files. Fixes in nfde_rotate #188
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: main
Are you sure you want to change the base?
Conversation
5dec29f
to
321e8aa
Compare
847a93d
to
68a330b
Compare
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 some minor requests. Also, tests are currently failing.
test/rotate/CMakeLists.txt
Outdated
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 it is excessive to create so many files to test this function. Could you consider to put them in a single file (as separate tests) and include it maybe within test/system/ folder?
@@ -40,15 +40,17 @@ END SUBROUTINE nfde_rotate | |||
SUBROUTINE rotate_generateSpaceSteps (this, mpidir) |
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.
why is the name of these functions rotate_generateWhatever? I understand these are rotating structures but there is no generation, which is made during parsing.
newrotate=.false. !!ojo tocar luego | ||
#ifdef CompileWithSMBJSON | ||
newrotate=.true. |
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.
If we are going to always use the new rotate, then we should remove this flag.
c9f099b
to
969c22b
Compare
src_main_pub/semba_fdtd.F90
Outdated
DO | ||
READ (UNIT_EF, '(A)', end=1010) l_aux | ||
rawFileInfo%numero = rawFileInfo%numero + 1 | ||
IF (len_trim (adjustl(l_aux))>=BUFSIZE) then |
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.
When json files are modified using the json python module, they become oneliners. Many tests change minor things in the the json files to be able to tests several cases from a single test (chaning the materialId in the material association), or changing the number of steps, to run shorter tests. When those modified json reach this point, they are read a single line whose size is larger than BUFSIZE.
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.
Attempted fix:
- first, count the number of lines in the file
- if > 1, read the same way
- if == 1 and the file is *json, read chunks of the line (which has a large but a priori undefined size) with size 1024 (bufsize), and make newlines every time a "}" is found
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.
Changed: it is irrelevant that lines end in some particular separator. Reading up to every "}" risks not reading the content between the separator and the end of the buffer. NOW: split the json oneliner into chuncks of 1024 characters, each one will be a line
No description provided.