Opened 6 years ago

Closed 6 years ago

#222 closed bug (fixed)

Initialization code in MPI-IO

Reported by: William Gropp <wgropp@…> Owned by: robl
Priority: major Milestone: mpich2-1.1rc1
Component: mpich Keywords:
Cc: robl@…

Description

Several of the routines have blocks of code like this:

    if (ADIO_Init_keyval == MPI_KEYVAL_INVALID) {
        MPI_Initialized(&flag);

        /* --BEGIN ERROR HANDLING-- */
        if (!flag) {
            error_code = MPIO_Err_create_code(MPI_SUCCESS,
                                              MPIR_ERR_RECOVERABLE,
                                              myname, __LINE__, MPI_ERR_OTHER,
                                              "**initialized", 0);
            goto fn_fail;
        }
        /* --END ERROR HANDLING-- */

        MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval,
                          (void *) 0);

/* put a dummy attribute on MPI_COMM_WORLD, because we want the delete
    function to be called when MPI_COMM_WORLD is freed. Hopefully the
    MPI library frees MPI_COMM_WORLD when MPI_Finalize is called,
    though the standard does not mandate this. */

        MPI_Attr_put(MPI_COMM_WORLD, ADIO_Init_keyval, (void *) 0);

/* initialize ADIO */

        ADIO_Init( (int *)0, (char ***)0, &error_code);
     }

First, it would be better if this was a common initialization routine.
(E.g., MPIR_MPIOInit()).

Second, we've now said, in MPI-2 section 4.8, that attributes on
MPI_COMM_SELF are deleted very early in MPI_Finalize, so the
ADIO_Init_keyval should be added to MPI_COMM_SELF rather than
MPI_COMM_WORLD.

Finally, if ADIO_Init_keyval is only used here, it should be freed
after it is added to COMM_SELF - this will permit MPI_Finalize to
report on unfreed attribute keyvals that the user has created (we
could add special cases for things like this, or add a finalize
callback to delete it, but if this is only used in this one case, it
would be simpler to just free it after adding the attribute to
COMM_SELF).

Bill

William Gropp
Deputy Director for Research
Institute for Advanced Computing Applications and Technologies
Paul and Cynthia Saylor Professor of Computer Science
University of Illinois Urbana-Champaign




Change History (9)

comment:1 Changed 6 years ago by William Gropp

  • id set to 222

This message has 0 attachment(s)

comment:2 Changed 6 years ago by balaji

  • Milestone set to mpich2-1.1a2
  • Owner set to thakur

comment:3 Changed 6 years ago by thakur

  • Milestone changed from mpich2-1.1a2 to mpich2-1.1b1
  • Owner changed from thakur to robl

comment:4 follow-up: Changed 6 years ago by gropp

This is just a ping - when debugging the thread and memory code, the messages produced because the Keyval free finalize (following the same model as for topologies, for example), generate a large amount of output when running the test suite. The fix is pretty easy, but should be done by the owner of the ROMIO code. I'm happy to help if there are any questions about what the solution should look like.

comment:5 in reply to: ↑ 4 Changed 6 years ago by robl

Replying to gropp:

This is just a ping - when debugging the thread and memory code, the messages produced because the Keyval free finalize (following the same model as for topologies, for example), generate a large amount of output when running the test suite. The fix is pretty easy, but should be done by the owner of the ROMIO code. I'm happy to help if there are any questions about what the solution should look like.

Hi Bill. Thanks for the ping. This one is all me, but it definitely fell off my list. I'll get to it soon. I think you've explained everything quite clearly, but I'll be sure to ask for explanations should I need them.

comment:6 Changed 6 years ago by balaji

  • Cc robl@… added
  • Milestone changed from mpich2-1.1b1 to mpich2-1.1b2

Robl: One more ping on this :-). When will you be able to get to this?

comment:7 Changed 6 years ago by Robert Latham

On Tue, Mar 10, 2009 at 07:29:39PM -0000, mpich2 wrote:
>  Robl: One more ping on this :-). When will you be able to get to this?

I'll have it done before you freeze for the next beta :>

==rob

--
Rob Latham
Mathematics and Computer Science Division    A215 0178 EA2D B059 8CDF
Argonne National Lab, IL USA                 B29D F333 664A 4280 315B

comment:8 Changed 6 years ago by robl

  • Status changed from new to assigned

OK, i've taken care of part one (make this a common routine) and part two
(make this an attribute on COMM_SELF, not COMM_WORLD). However I don't think
I can do the final part exactly as Bill suggests. ADIO_Init_keyval, a global
variable, is consulted at every entry point to ROMIO. If someone creates 100
files, ADIO_Init_keyval will be consulted every time.

I can free the keyval as part of the cleanup routine ADIOI_End_call. Is that
legal?

comment:9 Changed 6 years ago by robl

  • Resolution set to fixed
  • Status changed from assigned to closed

OK, this and all related bugs seem to be fixed by a flurry of commits ending in [57c200835782b9c6d2a2b7ba0b8fe01ec2a650ce]. closing

Note: See TracTickets for help on using tickets.