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

Gas Profile from hdf5 #261

Closed

Conversation

f-schmitt
Copy link
Member

This pull allows to load the gas profile from an hdf5 file.

Update: The Valgrind errors happen in mainline/dev too, see #267, thus unrelated to this change.

 - (currently not working !)
 - add gasFromHdf5
 - add gasSetup/Teardown methods to all gas configs
 - pass fieldTmp to kernel during initialization
 - different access to DataBox fixes pure virtual error
 - use stricter types in gasSetup
 - remove unused gasTeardown
 - use intermediate buffer for hdf5 initialization
 - update copyrights
@f-schmitt
Copy link
Member Author

Question: is there a way to access 3D-DataBox using a continuous 1D-index?
This would be helpful here.

@f-schmitt f-schmitt modified the milestone: Open Beta Mar 11, 2014
@f-schmitt
Copy link
Member Author

Question: When I try to pass the device DataBox directly here, I get a pure virtual function call error but when I use an intermediate variable, it seems to work. Any ideas?

@psychocoderHPC
Copy link
Member

Please highlight the line which you mean with here if I follow the link I can't see which line you mean.
3D DataBox can't access as C array but you can use DataBoxDim1Access were you can access with operator[] I think this is what you need. Is it?

@f-schmitt
Copy link
Member Author

It's line 215 in Particles.tpp, which is the line you get top-most when following the link. I don't know why it isn't highlighted.

Yes, DataBoxDim1Access looks fine for me, thx.

@ax3l ax3l added this to the Open Beta milestone Mar 12, 2014
DINLINE float_X calcNormedDensitiy( floatD_X pos )
template<unsigned DIM, typename FieldBox>
DINLINE float_X calcNormedDensity( floatD_X pos, const DataSpace<DIM>& cellIdx,
FieldBox fieldTmp )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add in all GasProfiles where fieldTmp is not used only the type FieldBox without a variable name, else we get compiler warnings unused variable or similar.

@f-schmitt
Copy link
Member Author

Alright, let's shoot at STUFF!

pngimageelectrons_yx_0 5_000512

pngimageelectrons_yx_0 5_001024
(scaled with gimp)

@ax3l
Copy link
Member

ax3l commented Mar 12, 2014

Yeah, FRY!!!! 🚀

@psychocoderHPC
Copy link
Member

Cool my nvidia logo idea is comming 👍

@ax3l
Copy link
Member

ax3l commented Mar 12, 2014

First we shoot on a PIConGPU logo, then on everyones facial profile to see who gains the highest energies (thx @bussmann for that idea).

@f-schmitt f-schmitt assigned ax3l and unassigned psychocoderHPC Mar 12, 2014
@f-schmitt
Copy link
Member Author

Re-assigned @ax3l since @psychocoderHPC is still enjoying vacation (or so I hope).

@f-schmitt
Copy link
Member Author

This currently only works for a single GPU. For multiple GPUs, the overlapping regions are not properly loaded (see below):

pngimageelectrons_yx_0 5_000000

@ax3l
Copy link
Member

ax3l commented Mar 12, 2014

An idea for improvement:
The hdf5 file right now defines a field that has to match exactly the number of cells in the sim.

Let us lower that burden a bit by setting a constant value in gasConfig.param -> namespace gasFromHdf5 for all cells that are not between the beginning and the end of the hdf5 dataset. That constant should also have a value between [0.0, 1.0] (default: 0.0 for vacuum).

This would allow target designers to design a narrow target somewhere in space that they can move by defining the total_offset of the input field (in experiment: moving the target in or out of focus).

@f-schmitt
Copy link
Member Author

It seems the content is somewhat shifted after all...

pngimageelectrons_yx_0 5_000000

@ax3l
Copy link
Member

ax3l commented Mar 12, 2014

I think the next GPU just starts reading one supercell "too late".

@ax3l ax3l removed the question label Mar 12, 2014
@f-schmitt
Copy link
Member Author

Apparently, not shifting the databox at all seems to work for multiple GPUs (tested for 1, 2 and 4), any explanation for this?

PMACC_AUTO(dataBox, fieldBuffer.getHostBuffer().getDataBox());
typedef DataBoxDim1Access< typename GridBuffer<Type, simDim >::DataBoxType > D1Box;

D1Box d1RAccess(dataBox, fieldNoGuards);

for (int i = 0; i < bufferSize; ++i)
   d1RAccess[i].x() = tmpBfr[i];

@ax3l
Copy link
Member

ax3l commented Mar 13, 2014

you probably did not shift fieldTmp during filling from hdf5 and now corrected for that in the second call during Dim1Access?

@f-schmitt
Copy link
Member Author

I don't understand what you mean by this. As my comment states, I did not shift anything. I obtain the host databox to fieldTmp (which is larger than the data in the HDF5 file), obtain 1D access to it with the size of the data in the HDF5 file and than just copy data from HDF5 to the databox directly. In my understanding, it would be required to shift the databox with guard-offset because otherwise, my 1D access would include guard data.

@ax3l
Copy link
Member

ax3l commented Mar 13, 2014

What I mean: I think you should shift your Dim1Access again in Line 114 und put a according guard shift in the kernel before accessing fieldTmp(cellIdx).x() in line 168.

 - passes current VirtualWindow to gasSetup
 - support gas offset in png2gas
@f-schmitt
Copy link
Member Author

This has been tested to work with moving window and 3 (y) GPUs. Targets can be smaller and larger than the actual simulation area and can start at any 3D offset. The rest of the simulation area is filled with a default value gasDefaultValue, currently 0.0.

@ax3l
Copy link
Member

ax3l commented Mar 13, 2014

wow, great! ✨

@f-schmitt
Copy link
Member Author

pngimageelectrons_yx_0 5_000480
pngimageelectrons_yx_0 5_000992
pngimageelectrons_yx_0 5_001376

@psychocoderHPC
Copy link
Member

👍 coooool

@ax3l
Copy link
Member

ax3l commented Mar 13, 2014

Hrhr, you will be loved for that 😸

@ax3l
Copy link
Member

ax3l commented Mar 13, 2014

One work-flow we probably still have to think about is: how to restart from our FieldTmp generated charge density. Since the values there are not scaled to [0:1] this could be a bit tricky.

We might need some post-processing or an other option to override the GAS_DENSITY_SI range in a clever way with a value from hdf5...
We might also rescale the values there using the min/max from #237 .

Anyway, does not have to go with this pull request - we can open a new issue for that :)

@PrometheusPi
Copy link
Member

👍

@bussmann
Copy link
Member

We need this for the GTC talk!!!!!!

On 13. März 2014 17:22:04 MEZ, f-schmitt-zih [email protected] wrote:

pngimageelectrons_yx_0 5_000480
pngimageelectrons_yx_0 5_000992
pngimageelectrons_yx_0 5_001376


Reply to this email directly or view it on GitHub:
#261 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

@f-schmitt f-schmitt mentioned this pull request Mar 17, 2014
@f-schmitt
Copy link
Member Author

Continued as #280, closed.

@f-schmitt f-schmitt closed this Mar 17, 2014
@f-schmitt f-schmitt deleted the topic-profileHdf5 branch March 17, 2014 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core in PIConGPU (core application)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants