Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Fix check for invalid number of vtk sample points #2046

Closed
wants to merge 2 commits into from
Closed

Conversation

jkozdon
Copy link

@jkozdon jkozdon commented Feb 18, 2021

The number of vtk sample points should be either 0 (meaning use the LGL grid) or >= 2 (meaning use specified number of equally spaced points)

closes #2045

@LenkaNovak
Copy link
Contributor

I'm afraid I tried running --vtk-number-sample-points 2 and got another error:

 DivideError: integer division error
Stacktrace:
 [1] div at ./int.jl:260 [inlined]
 [2] num_components at /home/lenka/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:24

(this is with the tutorials/Atmos/agnesi_hs_lin.jl case on master)

@kpamnany
Copy link
Contributor

kpamnany commented Mar 9, 2021

This error doesn't show up with 1 or 2 ranks, but happens at 32 ranks (but not on all the ranks):

ERROR: LoadError: DivideError: integer division error
Stacktrace:
 [1] div at ./int.jl:260 [inlined]
 [2] num_components at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:24 [inlined]
 [3] num_components at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:31 [inlined]
 [4] set_num_components at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:126 [inlined]
 [5] ::data_to_xml(data_to_xml(::::data_to_xml(::data_to_xml(::WriteVTK.DatasetFile, ::LightXML.XMLElement, ::Array{Float64,4}, ::String, ::WriteVTK.VTKPointData) at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:166
 [6] add_field_data(::WriteVTK.DatasetFile, ::Array{Float64,4}, ::String, ::WriteVTK.VTKPointData) at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:336
 [7] vtk_point_data at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:341 [inlined]
 [8] writemesh_highorder(::String, ::Array{Float64,4}, ::Array{Float64,4}, ::Array{Float64,4}; fields::WriteVTK.DatasetFile, ::LightXML.XMLElement, ::Array{Float64,4}, ::String, ::WriteVTK.VTKPointData) at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:166
 [9] writevtk_helper(::String, ::Array{Float64,3}, ::Array{Float64,3}, ::DiscontinuousSpectralElementGrid{Float64,3,WriteVTK.DatasetFile, ::LightXML.XMLElement, ::Array{Float64,4}, ::String, ::WriteVTK.VTKPointData) at /home/elencz/.julia/packages/WriteVTK/AMkQ9/src/write_data.jl:166

Any idea what could be happening @jkozdon?

@jkozdon
Copy link
Author

jkozdon commented Mar 9, 2021

This is with tutorials/Atmos/agnesi_hs_lin.jl and --vtk-number-sample-points 2?

@kpamnany
Copy link
Contributor

kpamnany commented Mar 9, 2021

I believe so.

mpiexec -np 32 julia --project tutorials/Atmos/agnesi_hs_lin.jl --vtk 0.5shours --vtk-number-sample-points 2 --sim-time 15000

I believe it happens pretty early in the run, so using 10steps might be better. Please correct me if I'm wrong @LenkaNovak.

@jkozdon
Copy link
Author

jkozdon commented Mar 9, 2021

Thanks. Will take a look and see if I can sort it out.

@jkozdon jkozdon force-pushed the jek/vtk_fix branch 2 times, most recently from edad4c8 to e57794b Compare March 9, 2021 20:44
@jkozdon
Copy link
Author

jkozdon commented Mar 11, 2021

I haven't forgotten about this. The issue is that when you run with 32 ranks, you have some ranks with no elements. This is what is breaking the VTK.

Still need to test everything.

@jkozdon
Copy link
Author

jkozdon commented Mar 11, 2021

OK. I think we might need an upstream fix... Will do some testing and open up an issue on WriteVTK.jl if we need to.

@jkozdon
Copy link
Author

jkozdon commented Mar 11, 2021

Nevermind about the upstream fix for now. There is some more fundamental issue.

When I run with 25 ranks which is fine in terms of having elements on all ranks, the VTK in paraview output suggests the data is garbage...

@jkozdon
Copy link
Author

jkozdon commented Mar 11, 2021

So I get weird data if I run:

mpiexec -np 6 julia --project tutorials/Atmos/agnesi_hs_lin.jl --vtk 0.5shours --sim-time 15000

on master. I get what's looks like garbage in paraview for energy.ρe.

I'm not sure where the problem is though, or why this is happening (e.g., is it something in the VTK or the simulation).

@jkozdon jkozdon closed this Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in VTK interpolation?
3 participants