ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 40 forks source link

Question about adios_selection_boudingbox #176

Open Lucymugua opened 6 years ago

Lucymugua commented 6 years ago

I am using adios_selection_boundingbox for my adios reading. However , I met an error: image

This is only a test program and the code is rather simple. It just reads an integer variable from bp file. image

I don't know what is wrong. Could any one help me with this issue?

Thanks, Lucy

pnorbert commented 6 years ago

Lucy,

Your selection in the example is to read the first value (at offset 0) from a 1D array (of whatever size). But NX is not an array, just a simple scalar. Scalar variables have 0 dimensions. You can read them by passing 0 for selection.

sel = 0
call adios_schedule_read (f, sel, "NX", 0, 1, NX, ierr)

Better yet, you can use adios_get_scalar() in fortran to get the value faster (from metadata sitting in memory after adios_open).

call adios_get_scalar (f, "NX", NX, ierr)

Best regards Norbert

On Tue, Apr 17, 2018 at 10:11 PM, Lucymugua notifications@github.com wrote:

I am using adios_selection_boundingbox for my adios reading. However , I met an error: [image: image] https://user-images.githubusercontent.com/37583049/38907794-0ba59ce0-42f0-11e8-8b96-7c1eb809b6e7.png

This is only a test program and the code is rather simple. It just reads an integer variable from bp file. [image: image] https://user-images.githubusercontent.com/37583049/38907898-7b680766-42f0-11e8-95ae-8cb17840854d.png

I don't know what is wrong. Could any one help me with this issue?

Thanks, Lucy

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLR_hIZrPK2H2RvkFB6QLNpLExkMgks5tpqC3gaJpZM4TZT5z .

Lucymugua commented 6 years ago

Dear Norbert,

Thanks for your solution! I have already solved the problem.

Best regards, Lucy

Lucymugua commented 6 years ago

Hi Norbert,

Sorry for bother you again. I have another question. image What does each data.bp.dir\data.bp.R file contains? And what does global metadata file data.bp contains? If I want to read data, what file should I use? data.bp.R or data.bp file?

Thanks, Lucy

pnorbert commented 6 years ago

Hi Lucy,

All data is stored in those subfiles but each one has information about its own content only.

The .bp has the information about all data. So you just open it and you can access all data through it.

If you turn off writing the .bp file at large scale runs, you can generate it in post-processing with the bpmeta tool.

Norbert

On Fri, Apr 20, 2018, 11:13 PM Lucymugua notifications@github.com wrote:

Hi Norbert,

Sorry for bother you again. I have another question. [image: image] https://user-images.githubusercontent.com/37583049/39079771-d54e0112-4553-11e8-874e-2c883160c22f.png What does each data.bp.dir\data.bp.R file contains? And what does global metadata file data.bp contains? If I want to read data, what file should I use? data.bp.R or data.bp file?

Thanks, Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-383263475, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLctRyiWsTYljaEIqVNNl71zIBgnTks5tqqPJgaJpZM4TZT5z .

Lucymugua commented 6 years ago

Hi Norbert,

Thanks for your answer and I will have a try.

Best regards, Lucy

Lucymugua commented 6 years ago

Hi Norbert,

I have a few more question to bother you. Can a xml file has more than one global space? If the answer is yes, do these global spaces generate only one global metadata file? I want to write some 2d arrays and 3d arrays using adios method. Their first and second dimensions are the same. can I just use one global space? If that is true,should I design like these arrays order one by one in this single global space?

Thanks, Lucy

pnorbert commented 6 years ago

Hi Lucy,

Is your question related to the example:

https://github.com/ornladios/ADIOS/blob/master/examples/C/global-array-time/adios_globaltime.xml There you can see to separate 2d "spaces" because the example has two 2d arrays of different sizes.

An xml file can specify multiple adios-groups, that you use in different output (open...write...close).

A group can have multiple global-bounds entries, and each can have multiple arrays. You must put 2d and 3d arrays into separate global-bounds, one for the 2D data, one for the 3D data.

Best regards Norbert

On Sat, Apr 21, 2018 at 9:59 AM, Lucymugua notifications@github.com wrote:

Hi Norbert,

I have a few more question to bother you. Can a xml file has more than one global space? If the answer is yes, do these global spaces generate only one global metadata file? I want to write some 2d arrays and 3d arrays using adios method. Their first and second dimensions are the same. can I just use one global space? If that is true,should I design like these arrays order one by one in this single global space?

Thanks, Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-383297556, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLY41N2_qo8_sNRfd5ySRuK-7csETks5tqztAgaJpZM4TZT5z .

Lucymugua commented 6 years ago

Dear Norbert,

What if these 2d arrays have same number of dimensions and each dimension has the same size? Can they belong to the same global-bound? If the answer is yes, how do the offsets set?

And I understand that one adios-group corresponds to one global metadata bp file. However, what if these variables belong to the same adios-group but different global-bounds? Are those variables belong to the same global metadata bp file? If that, how to read them if they belong to different global-bounds?

Thanks so much Lucy

pnorbert commented 6 years ago

Lucy,

Yes, you can have a list of variables in one global-bound definition.

An adios group holds all variables that go into one output (one adios_open()....adios_close()). Scalars, local arrays and global arrays, all of them. The global metadata file is also related to that one output. So yes, all arrays in all the global bounds within the same group will be found in the same global metadata file.

Best regards Norbert

On Sun, Apr 22, 2018 at 11:04 AM, Lucymugua notifications@github.com wrote:

Dear Norbert,

What if these 2d arrays have same number of dimensions and each dimension has the same size? Can they belong to the same global-bound? If the answer is yes, how do the offsets set?

And I understand that one adios-group corresponds to one global metadata bp file. However, what if these variables belong to the same adios-group but different global-bounds? Are those variables belong to the same global metadata bp file? If that, how to read them if they belong to different global-bounds?

Thanks so much Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-383387961, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLUzXqkjHQ-IYmyabBA3uYmIGeoJFks5trJwQgaJpZM4TZT5z .

Lucymugua commented 6 years ago

Hi Norbert,

Thanks for your reply. I am trying to read data from the global metadata file. The bp file information are listed below using bpls tool: image

Each variable has 320 blocks and the block size is: BLCKX=180,BLCKY=144; I use adios_selection_boundingbox method to read variables. image

One process read one block of variable each time.However, I got an error like that image

I am wondering what does this error mean?

Thanks, Lucy

pnorbert commented 6 years ago

Lucy,

The error is telling you that on some process you are trying to read a block of data, where the 1st dimension size is 144, from the offset 2160. That means, in Fortran terms, read 144 columns from the column 2160 (note that counting starts from 0 !!!), i.e. read columns 2160..2303 However, your 2D variables have 2302 columns only (0..2301).

Either your read decomposition is off, or the writing is already off. Use "bpls -D bpfile h0" to see where each writer puts its array into the global space.

Do you have ghost cells in your code which makes it harder for you to correctly place each block into the global space? Or do you have non-uniform data size per process?

My hunch is by looking at your bpls output that you are running 320 processes in 20x16 2D-decomposition, each writing a 180x144 block, so the global space should be 3600x2304. But your global arrays are 3600x2302 (in your Fortran code. bpls shows in C order).

Best regards Norbert

On Sun, Apr 22, 2018 at 11:17 PM, Lucymugua notifications@github.com wrote:

Hi Norbert,

Thanks for your reply. I am trying to read data from the global metadata file. The bp file information are listed below using bpls tool: [image: image] https://user-images.githubusercontent.com/37583049/39105138-b9c4b686-46e6-11e8-80e0-54925fa025f7.png

Each variable has 320 blocks and the block size is: BLCKX=180,BLCKY=144; I use adios_selection_boundingbox method to read variables. [image: image] https://user-images.githubusercontent.com/37583049/39105261-79cb5c8c-46e7-11e8-9dea-d0c8ef046e18.png

One process read one block of variable each time.However, I got an error like that [image: image] https://user-images.githubusercontent.com/37583049/39105146-c9c190d6-46e6-11e8-8477-1ca94d62905b.png

I am wondering what does this error mean?

Thanks, Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-383443152, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLdxAe6Ol1TjoPtoleQvxIwJ6soAeks5trUfggaJpZM4TZT5z .

Lucymugua commented 6 years ago

Hi Norbert,

Thanks for your great help.

I have already solved my problems and complete the data format conversion program. And I have verified my adios output results are correct compared with my original netcdf format data. I previously misunderstood the relationship between the global metadata file,i.e. data.bp and process's own file,i.e. data.bp.dir\data.bp.R., which is the main reason of getting errors. And now have a deeper understanding of it.

At 2018-04-21 22:43:30, "pnorbert" notifications@github.com wrote: Hi Lucy,

Is your question related to the example:

https://github.com/ornladios/ADIOS/blob/master/examples/C/global-array-time/adios_globaltime.xml There you can see to separate 2d "spaces" because the example has two 2d arrays of different sizes.

An xml file can specify multiple adios-groups, that you use in different output (open...write...close).

A group can have multiple global-bounds entries, and each can have multiple arrays. You must put 2d and 3d arrays into separate global-bounds, one for the 2D data, one for the 3D data.

Best regards Norbert

On Sat, Apr 21, 2018 at 9:59 AM, Lucymugua notifications@github.com wrote:

Hi Norbert,

I have a few more question to bother you. Can a xml file has more than one global space? If the answer is yes, do these global spaces generate only one global metadata file? I want to write some 2d arrays and 3d arrays using adios method. Their first and second dimensions are the same. can I just use one global space? If that is true,should I design like these arrays order one by one in this single global space?

Thanks, Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-383297556, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLY41N2_qo8_sNRfd5ySRuK-7csETks5tqztAgaJpZM4TZT5z .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Lucymugua commented 6 years ago

Hi Norbert,

Thanks for your great help.

I have already solved my problems and complete the data format conversion program. And I have verified my adios output results are correct compared with my original netcdf format data. I previously misunderstood the relationship between the global metadata file,i.e. data.bp and process's own file,i.e. data.bp.dir\data.bp.R., which is the main reason of getting errors. And now have a deeper understanding of it. Yes. I have ghost cells in my program. I have already considered this in my program and have solved the problem.

I will use adios to optimize my input part next.

Best regards, Lucy

Lucymugua commented 6 years ago

Hi Norbert,

I am optimizing my input part recently and met a problem. I use adios_read_open method which have been used before in my data conversion program. However, I got a confused error hint: image

I have consulted the source code in this path:adios-1.12.0/src/core/adiosf_read_mod.f90 and didn't found anything wrong. image

And I wonder where is the mistake.

Thanks, Lucy

pnorbert commented 6 years ago

Hi Lucy,

You are looking at the wrong subroutine, adios_read_open_file, not adios_read_open, which you are using in your code...

The compilation error indicates that the type of the argument does not match the subroutine's expected argument type. It also shows that the problem is with 1.0. I think it could be that you are compiling cesm with forcing double precision everywhere and the "real" type that the subroutine expects becomes a double type, while 1.0 is always a real number. So you caught a bug in the adios fortran API... We should have explicitly real*4 type there.

    subroutine adios_read_open (fp, fname, method, comm, lockmode,

timeout_sec, err) implicit none integer8, intent(out) :: fp character(), intent(in) :: fname integer, intent(in) :: method integer, intent(in) :: comm integer, intent(in) :: lockmode real, intent(in) :: timeout_sec integer, intent(out) :: err end subroutine

Can you try 1.0d+0 or 1.0_8 to pass a double value here? This could still cause a problem if adios was compiled with single precision and in the adios library only a real value is expected. Let us know if something behaves strangely.

Just because you mixed up the two subroutines, I am asking: you do understand the difference in usage scenario between the two (step-by-step reading vs. reading many steps at once), right?

Thanks Norbert

On Mon, Apr 30, 2018 at 8:55 AM, Lucymugua notifications@github.com wrote:

Hi Norbert,

I am optimizing my input part recently and met a problem. I use adios_read_open method which have been used before in my data conversion program. However, I got a confused error hint: [image: image] https://user-images.githubusercontent.com/37583049/39427627-12f1866e-4cb7-11e8-88dd-97ca6c2eca0b.png

I have consulted the source code in this path:adios-1.12.0/src/core/adiosf_read_mod.f90 and didn't found anything wrong. [image: image] https://user-images.githubusercontent.com/37583049/39428112-d22cfa76-4cb8-11e8-9654-f03e95d4223f.png

And I wonder where is the mistake.

Thanks, Lucy

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ornladios/ADIOS/issues/176#issuecomment-385390211, or mute the thread https://github.com/notifications/unsubscribe-auth/ADGMLTUZw6NiPunpc5O0GYvr0H902j_pks5ttwnRgaJpZM4TZT5z .

Lucymugua commented 6 years ago

Hi Noerbert,

I  have already solved the above problem. Thanks for your great help.
I plan to use “MPI_AGGREGATE” method in my program, however it doesn't work. 

The configuration in XML file is listed as follow.

image Is there anything I have missed?

Thanks, Lucy