@@ -41,19 +41,18 @@ mca_io_romio341_file_open (ompi_communicator_t *comm,
41
41
// An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call
42
42
// below with an MPI_Info, we need to create an equivalent MPI_Info. This
43
43
// isn't ideal but it only happens a few places.
44
- ompi_info_t * ompi_info ;
45
- ompi_info = OBJ_NEW (ompi_info_t );
46
- if (!ompi_info ) { return (MPI_ERR_NO_MEM ); }
47
- opal_info_t * opal_info = & (ompi_info -> super );
44
+ ompi_info_t ompi_info ;
45
+ OBJ_CONSTRUCT (& ompi_info , ompi_info_t );
46
+ opal_info_t * opal_info = & (ompi_info .super );
48
47
opal_info_dup (info , & opal_info );
49
48
50
49
data = (mca_io_romio341_data_t * ) fh -> f_io_selected_data ;
51
50
// OPAL_THREAD_LOCK (&mca_io_romio341_mutex);
52
- ret = ROMIO_PREFIX (MPI_File_open )(comm , filename , amode , ompi_info ,
51
+ ret = ROMIO_PREFIX (MPI_File_open )(comm , filename , amode , & ompi_info ,
53
52
& data -> romio_fh );
54
53
// OPAL_THREAD_UNLOCK (&mca_io_romio341_mutex);
55
54
56
- ompi_info_free (& ompi_info );
55
+ OBJ_DESTRUCT (& ompi_info );
57
56
return ret ;
58
57
}
59
58
@@ -206,20 +205,19 @@ mca_io_romio341_file_set_view (ompi_file_t *fh,
206
205
// An opal_info_t isn't a full ompi_info_t. so if we're using an MPI call
207
206
// below with an MPI_Info, we need to create an equivalent MPI_Info. This
208
207
// isn't ideal but it only happens a few places.
209
- ompi_info_t * ompi_info ;
210
- ompi_info = OBJ_NEW (ompi_info_t );
211
- if (!ompi_info ) { return (MPI_ERR_NO_MEM ); }
212
- opal_info_t * opal_info = & (ompi_info -> super );
208
+ ompi_info_t ompi_info ;
209
+ OBJ_CONSTRUCT (& ompi_info , ompi_info_t );
210
+ opal_info_t * opal_info = & (ompi_info .super );
213
211
opal_info_dup (info , & opal_info );
214
212
215
213
data = (mca_io_romio341_data_t * ) fh -> f_io_selected_data ;
216
214
OPAL_THREAD_LOCK (& mca_io_romio341_mutex );
217
215
ret =
218
216
ROMIO_PREFIX (MPI_File_set_view ) (data -> romio_fh , disp , etype , filetype ,
219
- datarep , ompi_info );
217
+ datarep , & ompi_info );
220
218
OPAL_THREAD_UNLOCK (& mca_io_romio341_mutex );
221
219
222
- ompi_info_free (& ompi_info );
220
+ OBJ_DESTRUCT (& ompi_info );
223
221
return ret ;
224
222
}
225
223
0 commit comments