Skip to content

Commit 2811c1f

Browse files
committed
Convert Fortran file_iwrite_* functions
Signed-off-by: Jake Tronge <[email protected]>
1 parent ced48f8 commit 2811c1f

11 files changed

+32
-253
lines changed

ompi/mpi/fortran/use-mpi-f08/Makefile.am

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ mpi_api_files = \
200200
file_get_size_f08.F90 \
201201
file_get_type_extent_f08.F90 \
202202
file_get_view_f08.F90 \
203-
file_iwrite_at_f08.F90 \
204-
file_iwrite_f08.F90 \
205-
file_iwrite_at_all_f08.F90 \
206-
file_iwrite_shared_f08.F90 \
207203
file_open_f08.F90 \
208204
file_preallocate_f08.F90 \
209205
file_read_all_begin_f08.F90 \

ompi/mpi/fortran/use-mpi-f08/Makefile.prototype_files

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ ready_prototype_files = \
153153
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_shared_ts.c.in \
154154
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iread_ts.c.in \
155155
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_all_ts.c.in \
156+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in \
157+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in \
158+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in \
159+
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in \
156160
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/file_write_ts.c.in \
157161
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/reduce_ts.c.in \
158162
$(abs_top_srcdir)/ompi/mpi/fortran/use-mpi-f08/waitall.c.in \

ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_f08.F90

Lines changed: 0 additions & 31 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_all_ts.c.in

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,15 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/file/file.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_File_iwrite_at_all";
30-
31-
void ompi_file_iwrite_at_all_ts(MPI_Fint *fh, MPI_Offset *offset, CFI_cdesc_t *x,
32-
MPI_Fint *count, MPI_Fint *datatype,
33-
MPI_Fint *request, MPI_Fint *ierr)
22+
PROTOTYPE VOID file_iwrite_at_all(FILE fh, OFFSET offset, BUFFER x,
23+
COUNT count, DATATYPE datatype,
24+
REQUEST_OUT request)
3425
{
3526
int c_ierr;
3627
MPI_File c_fh = PMPI_File_f2c(*fh);
3728
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
3829
void *buf = OMPI_CFI_BASE_ADDR(x);
39-
int c_count = OMPI_FINT_2_INT(*count);
30+
@COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count;
4031
MPI_Request c_request;
4132

4233
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr);
@@ -46,11 +37,11 @@ void ompi_file_iwrite_at_all_ts(MPI_Fint *fh, MPI_Offset *offset, CFI_cdesc_t *x
4637
return;
4738
}
4839

49-
c_ierr = PMPI_File_iwrite_at_all(c_fh, (MPI_Offset) *offset,
50-
OMPI_F2C_BOTTOM(buf),
51-
c_count,
52-
c_datatype,
53-
&c_request);
40+
c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset,
41+
OMPI_F2C_BOTTOM(buf),
42+
c_count,
43+
c_datatype,
44+
&c_request);
5445

5546
if (c_datatype != c_type) {
5647
ompi_datatype_destroy(&c_datatype);

ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_f08.F90

Lines changed: 0 additions & 31 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/file_iwrite_at_ts.c.in

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,15 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/file/file.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_File_iwrite_at";
30-
31-
void ompi_file_iwrite_at_ts(MPI_Fint *fh, MPI_Offset *offset, CFI_cdesc_t *x,
32-
MPI_Fint *count, MPI_Fint *datatype,
33-
MPI_Fint *request, MPI_Fint *ierr)
22+
PROTOTYPE VOID file_iwrite_at(FILE fh, OFFSET offset, BUFFER x,
23+
COUNT count, DATATYPE datatype,
24+
REQUEST_OUT request)
3425
{
3526
int c_ierr;
3627
MPI_File c_fh = PMPI_File_f2c(*fh);
3728
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
3829
void *buf = OMPI_CFI_BASE_ADDR(x);
39-
int c_count = OMPI_FINT_2_INT(*count);
30+
@COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count;
4031
MPI_Request c_request;
4132

4233
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr);
@@ -46,11 +37,11 @@ void ompi_file_iwrite_at_ts(MPI_Fint *fh, MPI_Offset *offset, CFI_cdesc_t *x,
4637
return;
4738
}
4839

49-
c_ierr = PMPI_File_iwrite_at(c_fh, (MPI_Offset) *offset,
50-
OMPI_F2C_BOTTOM(buf),
51-
c_count,
52-
c_datatype,
53-
&c_request);
40+
c_ierr = @INNER_CALL@(c_fh, (MPI_Offset) *offset,
41+
OMPI_F2C_BOTTOM(buf),
42+
c_count,
43+
c_datatype,
44+
&c_request);
5445

5546
if (c_datatype != c_type) {
5647
ompi_datatype_destroy(&c_datatype);

ompi/mpi/fortran/use-mpi-f08/file_iwrite_f08.F90

Lines changed: 0 additions & 30 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_f08.F90

Lines changed: 0 additions & 30 deletions
This file was deleted.

ompi/mpi/fortran/use-mpi-f08/file_iwrite_shared_ts.c.in

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,14 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/file/file.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_File_iwrite_shared";
30-
31-
void ompi_file_iwrite_shared_ts(MPI_Fint *fh, CFI_cdesc_t *x, MPI_Fint *count,
32-
MPI_Fint *datatype, MPI_Fint *request,
33-
MPI_Fint *ierr)
22+
PROTOTYPE VOID file_iwrite_shared(FILE fh, BUFFER x, COUNT count,
23+
DATATYPE datatype, REQUEST_OUT request)
3424
{
3525
int c_ierr;
3626
MPI_File c_fh = PMPI_File_f2c(*fh);
3727
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
3828
void *buf = OMPI_CFI_BASE_ADDR(x);
39-
int c_count = OMPI_FINT_2_INT(*count);
29+
@COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count;
4030
MPI_Request c_request;
4131

4232
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr);
@@ -46,11 +36,8 @@ void ompi_file_iwrite_shared_ts(MPI_Fint *fh, CFI_cdesc_t *x, MPI_Fint *count,
4636
return;
4737
}
4838

49-
c_ierr = PMPI_File_iwrite_shared(c_fh,
50-
OMPI_F2C_BOTTOM(buf),
51-
c_count,
52-
c_datatype,
53-
&c_request);
39+
c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count,
40+
c_datatype, &c_request);
5441

5542
if (c_datatype != c_type) {
5643
ompi_datatype_destroy(&c_datatype);

ompi/mpi/fortran/use-mpi-f08/file_iwrite_ts.c.in

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,14 @@
1919
* $HEADER$
2020
*/
2121

22-
#include "ompi_config.h"
23-
24-
#include "ompi/file/file.h"
25-
#include "ompi/errhandler/errhandler.h"
26-
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h"
27-
#include "ompi/mpi/fortran/base/constants.h"
28-
29-
static const char FUNC_NAME[] = "MPI_File_iwrite";
30-
31-
void ompi_file_iwrite_ts(MPI_Fint *fh, CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr)
22+
PROTOTYPE VOID file_iwrite(FILE fh, BUFFER x, COUNT count, DATATYPE datatype,
23+
REQUEST_OUT request)
3224
{
3325
int c_ierr;
3426
MPI_File c_fh = PMPI_File_f2c(*fh);
3527
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype);
3628
void *buf = OMPI_CFI_BASE_ADDR(x);
37-
int c_count = OMPI_FINT_2_INT(*count);
29+
@COUNT_TYPE@ c_count = (@COUNT_TYPE@) *count;
3830
MPI_Request c_request;
3931

4032
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr);
@@ -44,10 +36,8 @@ void ompi_file_iwrite_ts(MPI_Fint *fh, CFI_cdesc_t *x, MPI_Fint *count, MPI_Fint
4436
return;
4537
}
4638

47-
c_ierr = PMPI_File_iwrite(c_fh, OMPI_F2C_BOTTOM(buf),
48-
c_count,
49-
c_datatype,
50-
&c_request);
39+
c_ierr = @INNER_CALL@(c_fh, OMPI_F2C_BOTTOM(buf), c_count,
40+
c_datatype, &c_request);
5141

5242
if (c_datatype != c_type) {
5343
ompi_datatype_destroy(&c_datatype);

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3595,64 +3595,6 @@ subroutine MPI_File_get_view_f08(fh,disp,etype,filetype,datarep,ierror)
35953595
end subroutine MPI_File_get_view_f08
35963596
end interface MPI_File_get_view
35973597

3598-
interface MPI_File_iwrite
3599-
subroutine MPI_File_iwrite_f08(fh,buf,count,datatype,request,ierror)
3600-
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
3601-
implicit none
3602-
TYPE(MPI_File), INTENT(IN) :: fh
3603-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
3604-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf
3605-
INTEGER, INTENT(IN) :: count
3606-
TYPE(MPI_Datatype), INTENT(IN) :: datatype
3607-
TYPE(MPI_Request), INTENT(OUT) :: request
3608-
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3609-
end subroutine MPI_File_iwrite_f08
3610-
end interface MPI_File_iwrite
3611-
3612-
interface MPI_File_iwrite_at
3613-
subroutine MPI_File_iwrite_at_f08(fh,offset,buf,count,datatype,request,ierror)
3614-
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND
3615-
implicit none
3616-
TYPE(MPI_File), INTENT(IN) :: fh
3617-
INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset
3618-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
3619-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf
3620-
INTEGER, INTENT(IN) :: count
3621-
TYPE(MPI_Datatype), INTENT(IN) :: datatype
3622-
TYPE(MPI_Request), INTENT(OUT) :: request
3623-
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3624-
end subroutine MPI_File_iwrite_at_f08
3625-
end interface MPI_File_iwrite_at
3626-
3627-
interface MPI_File_iwrite_at_all
3628-
subroutine MPI_File_iwrite_at_all_f08(fh,offset,buf,count,datatype,request,ierror)
3629-
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND
3630-
implicit none
3631-
TYPE(MPI_File), INTENT(IN) :: fh
3632-
INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset
3633-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
3634-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf
3635-
INTEGER, INTENT(IN) :: count
3636-
TYPE(MPI_Datatype), INTENT(IN) :: datatype
3637-
TYPE(MPI_Request), INTENT(OUT) :: request
3638-
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3639-
end subroutine MPI_File_iwrite_at_all_f08
3640-
end interface MPI_File_iwrite_at_all
3641-
3642-
interface MPI_File_iwrite_shared
3643-
subroutine MPI_File_iwrite_shared_f08(fh,buf,count,datatype,request,ierror)
3644-
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
3645-
implicit none
3646-
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
3647-
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) OMPI_ASYNCHRONOUS :: buf
3648-
TYPE(MPI_File), INTENT(IN) :: fh
3649-
INTEGER, INTENT(IN) :: count
3650-
TYPE(MPI_Datatype), INTENT(IN) :: datatype
3651-
TYPE(MPI_Request), INTENT(OUT) :: request
3652-
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3653-
end subroutine MPI_File_iwrite_shared_f08
3654-
end interface MPI_File_iwrite_shared
3655-
36563598
interface MPI_File_open
36573599
subroutine MPI_File_open_f08(comm,filename,amode,info,fh,ierror)
36583600
use :: mpi_f08_types, only : MPI_Comm, MPI_Info, MPI_File

0 commit comments

Comments
 (0)