compdyn / partmc

Particle-resolved stochastic atmospheric aerosol model
http://lagrange.mechse.illinois.edu/partmc/
GNU General Public License v2.0
28 stars 16 forks source link

MPI issues to address before merge noalloc branch #10

Closed jcurtis2 closed 9 years ago

jcurtis2 commented 9 years ago

This is something I have nearly done on my fork. It works (mostly) for the serial code. However, there are the following unresolved issues regarding MPI related things that need a solution.

NOTE: I will need to re-verify these issues but here are the initial thoughts.

1.) Parallel mixing of aero_states in aero_state.F90

aero_state_mix() has a call to aero_states_sampled() which samples the particles and puts them in an aero_state for transfer. This aero_state contains unallocated allocatable arrays such as n_part_ideal. This causes problems when packing as it tries to calculate the size of an unallocated 2D array.

Thoughts: We possibly allocate all parts of the aero_state even though n_part_ideal is meaningless here. Or we test for this in the MPI routines?

2.) With test case inputs, we seem to have problems with test cases that contain no emissions, background, etc. This is a result of when we place a line "# empty aerosol state with no particles" in these files. This causes problems when packing and sending the scenario data type.

Thoughts: Similar as above for a fix. This is possibly solved by adding files such as aeroemit*_comp.dat and aero_back_comp.dat and setting the values to actually be zero. This is rather than leaving things blank.

Not sure what this note is about but I'll look more closely as a cause ---> It appeared to segfault on len_trim command for the aero_mode name for packing size. Why is this?

jcurtis2 commented 9 years ago

Fixed with f9b23d3fd47b7574f05d0eea08db2c75089f95d1

I added a logical that has the allocation status of arrays for the pack, pack size and unpack arrays. When an array is not allocated, all that is packed and unpacked is the false allocation status. Otherwise, the array is pack/unpacked as normal.