99 * University of Stuttgart. All rights reserved.
1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
12- * Copyright (c) 2008-2018 University of Houston. All rights reserved.
12+ * Copyright (c) 2008-2019 University of Houston. All rights reserved.
1313 * Copyright (c) 2015-2018 Research Organization for Information Science
1414 * and Technology (RIST). All rights reserved.
1515 * Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
@@ -75,7 +75,8 @@ int mca_common_ompio_file_open (ompi_communicator_t *comm,
7575 ompio_fh -> f_rank = ompi_comm_rank (comm );
7676 ompio_fh -> f_size = ompi_comm_size (comm );
7777 remote_arch = opal_local_arch ;
78- ompio_fh -> f_convertor = opal_convertor_create (remote_arch , 0 );
78+ ompio_fh -> f_mem_convertor = opal_convertor_create (remote_arch , 0 );
79+ ompio_fh -> f_file_convertor = opal_convertor_create (remote_arch , 0 );
7980
8081 if ( true == use_sharedfp ) {
8182 ret = ompi_comm_dup (comm , & ompio_fh -> f_comm );
@@ -323,17 +324,23 @@ int mca_common_ompio_file_close (ompio_file_t *ompio_fh)
323324 ompio_fh -> f_decoded_iov = NULL ;
324325 }
325326
326- if (NULL != ompio_fh -> f_convertor ) {
327- free (ompio_fh -> f_convertor );
328- ompio_fh -> f_convertor = NULL ;
327+ if (NULL != ompio_fh -> f_mem_convertor ) {
328+ opal_convertor_cleanup (ompio_fh -> f_mem_convertor );
329+ //free (ompio_fh->f_mem_convertor);
330+ ompio_fh -> f_mem_convertor = NULL ;
329331 }
330332
333+ if (NULL != ompio_fh -> f_file_convertor ) {
334+ opal_convertor_cleanup (ompio_fh -> f_file_convertor );
335+ //free (ompio_fh->f_file_convertor);
336+ ompio_fh -> f_file_convertor = NULL ;
337+ }
338+
331339 if (NULL != ompio_fh -> f_datarep ) {
332340 free (ompio_fh -> f_datarep );
333341 ompio_fh -> f_datarep = NULL ;
334342 }
335343
336-
337344 if ( NULL != ompio_fh -> f_coll_write_time ) {
338345 free ( ompio_fh -> f_coll_write_time );
339346 ompio_fh -> f_coll_write_time = NULL ;
@@ -557,6 +564,7 @@ int mca_common_ompio_decode_datatype (struct ompio_file_t *fh,
557564 int count ,
558565 const void * buf ,
559566 size_t * max_data ,
567+ opal_convertor_t * conv ,
560568 struct iovec * * iov ,
561569 uint32_t * iovec_count )
562570{
@@ -571,7 +579,7 @@ int mca_common_ompio_decode_datatype (struct ompio_file_t *fh,
571579 size_t temp_data ;
572580
573581
574- opal_convertor_clone (fh -> f_convertor , & convertor , 0 );
582+ opal_convertor_clone (conv , & convertor , 0 );
575583
576584 if (OMPI_SUCCESS != opal_convertor_prepare_for_send (& convertor ,
577585 & (datatype -> super ),
@@ -667,7 +675,8 @@ int mca_common_ompio_decode_datatype (struct ompio_file_t *fh,
667675 }
668676
669677 free (temp_iov );
670-
678+ opal_convertor_cleanup (& convertor );
679+
671680 return OMPI_SUCCESS ;
672681}
673682
0 commit comments