Commit 0ab04f2c authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add mode to use MPI_File_write_at_all.

parent 723d9575
...@@ -290,6 +290,7 @@ src/pio_impl.h -text ...@@ -290,6 +290,7 @@ src/pio_impl.h -text
src/pio_interface.c -text src/pio_interface.c -text
src/pio_interface.h -text src/pio_interface.h -text
src/pio_list_set.c -text src/pio_list_set.c -text
src/pio_mpi_fw_at_all.c -text
src/pio_mpi_fw_ordered.c -text src/pio_mpi_fw_ordered.c -text
src/pio_mpinonb.c -text src/pio_mpinonb.c -text
src/pio_posixasynch.c -text src/pio_posixasynch.c -text
...@@ -392,6 +393,7 @@ tests/ensure_array_size.h -text ...@@ -392,6 +393,7 @@ tests/ensure_array_size.h -text
tests/pio_cksum_asynch.in -text tests/pio_cksum_asynch.in -text
tests/pio_cksum_cdf.in -text tests/pio_cksum_cdf.in -text
tests/pio_cksum_fpguard.in -text tests/pio_cksum_fpguard.in -text
tests/pio_cksum_mpi_fw_at_all.in -text
tests/pio_cksum_mpi_fw_ordered.in -text tests/pio_cksum_mpi_fw_ordered.in -text
tests/pio_cksum_mpinonb.in -text tests/pio_cksum_mpinonb.in -text
tests/pio_cksum_writer.in -text tests/pio_cksum_writer.in -text
......
...@@ -30716,7 +30716,7 @@ cat >>confdefs.h <<_ACEOF ...@@ -30716,7 +30716,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
   
   
ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/test_f2003 tests/pio_write_run tests/pio_write_deco2d_run tests/pio_cksum_mpinonb tests/pio_cksum_mpi_fw_ordered tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf tests/test_resource_copy_mpi_run tests/test_cdf_transformation tables/gen_tableheaderfile util/serialrun" ac_config_files="$ac_config_files tests/test_cksum_grib tests/test_cksum_nc tests/test_cksum_nc2 tests/test_cksum_nc4 tests/test_cksum_extra tests/test_cksum_service tests/test_cksum_ieg tests/test_chunk_cksum tests/test_f2003 tests/pio_write_run tests/pio_write_deco2d_run tests/pio_cksum_mpinonb tests/pio_cksum_mpi_fw_ordered tests/pio_cksum_mpi_fw_at_all tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer tests/pio_cksum_cdf tests/test_resource_copy_mpi_run tests/test_cdf_transformation tables/gen_tableheaderfile util/serialrun"
   
   
ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings examples/pio/Makefile src/pkgconfig/cdi.pc src/pkgconfig/cdipio.pc" ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile cdi.settings examples/pio/Makefile src/pkgconfig/cdi.pc src/pkgconfig/cdipio.pc"
...@@ -32095,6 +32095,7 @@ do ...@@ -32095,6 +32095,7 @@ do
"tests/pio_write_deco2d_run") CONFIG_FILES="$CONFIG_FILES tests/pio_write_deco2d_run" ;; "tests/pio_write_deco2d_run") CONFIG_FILES="$CONFIG_FILES tests/pio_write_deco2d_run" ;;
"tests/pio_cksum_mpinonb") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpinonb" ;; "tests/pio_cksum_mpinonb") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpinonb" ;;
"tests/pio_cksum_mpi_fw_ordered") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpi_fw_ordered" ;; "tests/pio_cksum_mpi_fw_ordered") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpi_fw_ordered" ;;
"tests/pio_cksum_mpi_fw_at_all") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpi_fw_at_all" ;;
"tests/pio_cksum_fpguard") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_fpguard" ;; "tests/pio_cksum_fpguard") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_fpguard" ;;
"tests/pio_cksum_asynch") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_asynch" ;; "tests/pio_cksum_asynch") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_asynch" ;;
"tests/pio_cksum_writer") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_writer" ;; "tests/pio_cksum_writer") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_writer" ;;
...@@ -33917,6 +33918,7 @@ _LT_EOF ...@@ -33917,6 +33918,7 @@ _LT_EOF
"tests/pio_write_deco2d_run":F) chmod a+x "$ac_file" ;; "tests/pio_write_deco2d_run":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_mpinonb":F) chmod a+x "$ac_file" ;; "tests/pio_cksum_mpinonb":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_mpi_fw_ordered":F) chmod a+x "$ac_file" ;; "tests/pio_cksum_mpi_fw_ordered":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_mpi_fw_at_all":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_fpguard":F) chmod a+x "$ac_file" ;; "tests/pio_cksum_fpguard":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_asynch":F) chmod a+x "$ac_file" ;; "tests/pio_cksum_asynch":F) chmod a+x "$ac_file" ;;
"tests/pio_cksum_writer":F) chmod a+x "$ac_file" ;; "tests/pio_cksum_writer":F) chmod a+x "$ac_file" ;;
...@@ -385,6 +385,7 @@ AC_CONFIG_FILES([tests/test_cksum_grib \ ...@@ -385,6 +385,7 @@ AC_CONFIG_FILES([tests/test_cksum_grib \
tests/pio_write_deco2d_run \ tests/pio_write_deco2d_run \
tests/pio_cksum_mpinonb \ tests/pio_cksum_mpinonb \
tests/pio_cksum_mpi_fw_ordered \ tests/pio_cksum_mpi_fw_ordered \
tests/pio_cksum_mpi_fw_at_all \
tests/pio_cksum_fpguard \ tests/pio_cksum_fpguard \
tests/pio_cksum_asynch \ tests/pio_cksum_asynch \
tests/pio_cksum_writer \ tests/pio_cksum_writer \
......
...@@ -177,6 +177,7 @@ libcdipio_la_SOURCES = \ ...@@ -177,6 +177,7 @@ libcdipio_la_SOURCES = \
pio_interface.h \ pio_interface.h \
pio_mpinonb.c \ pio_mpinonb.c \
pio_mpi_fw_ordered.c \ pio_mpi_fw_ordered.c \
pio_mpi_fw_at_all.c \
pio_record_send.c \ pio_record_send.c \
pio_posixasynch.c \ pio_posixasynch.c \
pio_posixfpguardsendrecv.c \ pio_posixfpguardsendrecv.c \
......
...@@ -220,21 +220,22 @@ libcdipio_la_DEPENDENCIES = libcdi.la $(am__DEPENDENCIES_1) \ ...@@ -220,21 +220,22 @@ libcdipio_la_DEPENDENCIES = libcdi.la $(am__DEPENDENCIES_1) \
am__libcdipio_la_SOURCES_DIST = cdipio.h cdipioFortran.c cfortran.h \ am__libcdipio_la_SOURCES_DIST = cdipio.h cdipioFortran.c cfortran.h \
pio.c pio.h pio_comm.c pio_comm.h pio_dbuffer.c pio_id_set.h \ pio.c pio.h pio_comm.c pio_comm.h pio_dbuffer.c pio_id_set.h \
pio_impl.h pio_interface.c pio_interface.h pio_mpinonb.c \ pio_impl.h pio_interface.c pio_interface.h pio_mpinonb.c \
pio_mpi_fw_ordered.c pio_record_send.c pio_posixasynch.c \ pio_mpi_fw_ordered.c pio_mpi_fw_at_all.c pio_record_send.c \
pio_posixfpguardsendrecv.c pio_posixnonb.c pio_list_set.c \ pio_posixasynch.c pio_posixfpguardsendrecv.c pio_posixnonb.c \
resource_unpack.h resource_unpack.c pio_client.c pio_client.h \ pio_list_set.c resource_unpack.h resource_unpack.c \
pio_roles.c pio_rpc.c pio_rpc.h pio_server.c pio_server.h \ pio_client.c pio_client.h pio_roles.c pio_rpc.c pio_rpc.h \
pio_serialize.h pio_serialize.c pio_util.c pio_util.h \ pio_server.c pio_server.h pio_serialize.h pio_serialize.c \
pio_cdf_int.h pio_cdf_int.c pio_util.c pio_util.h pio_cdf_int.h pio_cdf_int.c
am__objects_5 = pio_cdf_int.lo am__objects_5 = pio_cdf_int.lo
@HAVE_PARALLEL_NC4_TRUE@@USE_MPI_TRUE@am__objects_6 = \ @HAVE_PARALLEL_NC4_TRUE@@USE_MPI_TRUE@am__objects_6 = \
@HAVE_PARALLEL_NC4_TRUE@@USE_MPI_TRUE@ $(am__objects_5) @HAVE_PARALLEL_NC4_TRUE@@USE_MPI_TRUE@ $(am__objects_5)
am_libcdipio_la_OBJECTS = cdipioFortran.lo pio.lo pio_comm.lo \ am_libcdipio_la_OBJECTS = cdipioFortran.lo pio.lo pio_comm.lo \
pio_dbuffer.lo pio_interface.lo pio_mpinonb.lo \ pio_dbuffer.lo pio_interface.lo pio_mpinonb.lo \
pio_mpi_fw_ordered.lo pio_record_send.lo pio_posixasynch.lo \ pio_mpi_fw_ordered.lo pio_mpi_fw_at_all.lo pio_record_send.lo \
pio_posixfpguardsendrecv.lo pio_posixnonb.lo pio_list_set.lo \ pio_posixasynch.lo pio_posixfpguardsendrecv.lo \
resource_unpack.lo pio_client.lo pio_roles.lo pio_rpc.lo \ pio_posixnonb.lo pio_list_set.lo resource_unpack.lo \
pio_server.lo pio_serialize.lo pio_util.lo $(am__objects_6) pio_client.lo pio_roles.lo pio_rpc.lo pio_server.lo \
pio_serialize.lo pio_util.lo $(am__objects_6)
libcdipio_la_OBJECTS = $(am_libcdipio_la_OBJECTS) libcdipio_la_OBJECTS = $(am_libcdipio_la_OBJECTS)
@ENABLE_CDI_LIB_FALSE@@USE_MPI_TRUE@am_libcdipio_la_rpath = @ENABLE_CDI_LIB_FALSE@@USE_MPI_TRUE@am_libcdipio_la_rpath =
@ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am_libcdipio_la_rpath = -rpath \ @ENABLE_CDI_LIB_TRUE@@USE_MPI_TRUE@am_libcdipio_la_rpath = -rpath \
...@@ -550,12 +551,12 @@ libcdiresunpack_la_SOURCES = \ ...@@ -550,12 +551,12 @@ libcdiresunpack_la_SOURCES = \
libcdipio_la_SOURCES = cdipio.h cdipioFortran.c cfortran.h pio.c pio.h \ libcdipio_la_SOURCES = cdipio.h cdipioFortran.c cfortran.h pio.c pio.h \
pio_comm.c pio_comm.h pio_dbuffer.c pio_id_set.h pio_impl.h \ pio_comm.c pio_comm.h pio_dbuffer.c pio_id_set.h pio_impl.h \
pio_interface.c pio_interface.h pio_mpinonb.c \ pio_interface.c pio_interface.h pio_mpinonb.c \
pio_mpi_fw_ordered.c pio_record_send.c pio_posixasynch.c \ pio_mpi_fw_ordered.c pio_mpi_fw_at_all.c pio_record_send.c \
pio_posixfpguardsendrecv.c pio_posixnonb.c pio_list_set.c \ pio_posixasynch.c pio_posixfpguardsendrecv.c pio_posixnonb.c \
resource_unpack.h resource_unpack.c pio_client.c pio_client.h \ pio_list_set.c resource_unpack.h resource_unpack.c \
pio_roles.c pio_rpc.c pio_rpc.h pio_server.c pio_server.h \ pio_client.c pio_client.h pio_roles.c pio_rpc.c pio_rpc.h \
pio_serialize.h pio_serialize.c pio_util.c pio_util.h \ pio_server.c pio_server.h pio_serialize.h pio_serialize.c \
pio_cdf_int.h $(am__append_7) pio_util.c pio_util.h pio_cdf_int.h $(am__append_7)
libcdipio_la_HAVE_PARALLEL_NC4_extra_sources = \ libcdipio_la_HAVE_PARALLEL_NC4_extra_sources = \
pio_cdf_int.c pio_cdf_int.c
...@@ -721,6 +722,7 @@ distclean-compile: ...@@ -721,6 +722,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_dbuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_dbuffer.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_interface.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_list_set.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_list_set.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_mpi_fw_at_all.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_mpi_fw_ordered.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_mpi_fw_ordered.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_mpinonb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_mpinonb.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_posixasynch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pio_posixasynch.Plo@am__quote@
......
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
#define PIO_ASYNCH 3 #define PIO_ASYNCH 3
#define PIO_FPGUARD 4 #define PIO_FPGUARD 4
#define PIO_MPI_FW_ORDERED 5 #define PIO_MPI_FW_ORDERED 5
#define PIO_MPI_FW_AT_ALL 6
#define PIO_MINIOMODE PIO_NONE #define PIO_MINIOMODE PIO_NONE
#define PIO_MAXIOMODE PIO_MPI_FW_ORDERED #define PIO_MAXIOMODE PIO_MPI_FW_AT_ALL
#define PIO_ROLE_CLIENT 0 #define PIO_ROLE_CLIENT 0
#define PIO_ROLE_COLLECTOR 1 #define PIO_ROLE_COLLECTOR 1
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
PARAMETER (PIO_FPGUARD = 4) PARAMETER (PIO_FPGUARD = 4)
INTEGER PIO_MPI_FW_ORDERED INTEGER PIO_MPI_FW_ORDERED
PARAMETER (PIO_MPI_FW_ORDERED = 5) PARAMETER (PIO_MPI_FW_ORDERED = 5)
INTEGER PIO_MPI_FW_AT_ALL
PARAMETER (PIO_MPI_FW_AT_ALL = 6)
INTEGER PIO_ROLE_CLIENT INTEGER PIO_ROLE_CLIENT
PARAMETER (PIO_ROLE_CLIENT = 0) PARAMETER (PIO_ROLE_CLIENT = 0)
INTEGER PIO_ROLE_COLLECTOR INTEGER PIO_ROLE_COLLECTOR
......
...@@ -96,6 +96,9 @@ void initMPINONB(void); ...@@ -96,6 +96,9 @@ void initMPINONB(void);
/* pio_mpi_fw_ordered.c */ /* pio_mpi_fw_ordered.c */
void cdiPioFileWriteOrderedInit(void); void cdiPioFileWriteOrderedInit(void);
/* pio_mpi_fw_at_all.c */
void cdiPioFileWriteAtAllInit(void);
/* common functionality for file split between collectors and writer(s) */ /* common functionality for file split between collectors and writer(s) */
void pioSendInitialize(void); void pioSendInitialize(void);
......
...@@ -563,6 +563,9 @@ cdiPioFileWritingInit(void) ...@@ -563,6 +563,9 @@ cdiPioFileWritingInit(void)
case PIO_MPI_FW_ORDERED: case PIO_MPI_FW_ORDERED:
cdiPioFileWriteOrderedInit(); cdiPioFileWriteOrderedInit();
break; break;
case PIO_MPI_FW_AT_ALL:
cdiPioFileWriteAtAllInit();
break;
} }
} }
......
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <mpi.h>
#include "cdi.h"
#include "dmemory.h"
#include "namespace.h"
#include "pio.h"
#include "pio_comm.h"
#include "pio_impl.h"
#include "pio_util.h"
typedef struct
{
MPI_File fh;
int fileID;
MPI_Offset pos;
char *name;
int collWriteSize[];
} aFiledataM;
static listSet *bibAFiledataM;
static int
fileIDTest(void *a, void *fileID)
{
return ((aFiledataM *)a)->fileID == (int)(intptr_t)fileID;
}
/***************************************************************/
static aFiledataM *
initAFiledataFileWriteAtAll(const char *filename, size_t bs)
{
MPI_Comm commPio = commInqCommPio();
int sizePio = commInqSizePio();
size_t nameSize = strlen(filename) + 1;
aFiledataM *of = Malloc(sizeof (*of)
+ sizeof (of->collWriteSize[0]) * (size_t)sizePio
+ nameSize);
of->name = (char *)((unsigned char *)of + sizeof (*of)
+ sizeof (of->collWriteSize[0]) * (size_t)sizePio);
memcpy(of->name, filename, nameSize);
MPI_Info open_info = MPI_INFO_NULL;
xmpi(MPI_Info_create(&open_info));
xmpi(MPI_Info_set(open_info, "access_style", "write_once"));
xmpi(MPI_Info_set(open_info, "collective_buffering", "true"));
/* tell IBM PE to buffer just as much as one buffer holds */
{
char buf_size_str[3*sizeof(size_t)*CHAR_BIT/8+1];
snprintf(buf_size_str, sizeof (buf_size_str), "%zu", bs);
xmpi(MPI_Info_set(open_info, "IBM_io_buffer_size", buf_size_str));
xmpi(MPI_Info_set(open_info, "IBM_largeblock_io", "false"));
}
xmpi(MPI_File_open(commPio, of->name,
MPI_MODE_CREATE|MPI_MODE_WRONLY|MPI_MODE_UNIQUE_OPEN,
open_info, &of->fh));
xmpi(MPI_Info_free(&open_info));
of->pos = 0;
return of;
}
/***************************************************************/
static int
destroyAFiledataFileWriteAtAll(void *v)
{
aFiledataM *of = v;
/* close file */
MPI_Offset endpos, fsize;
endpos = of->pos;
xmpi(MPI_File_get_size(of->fh, &fsize));
/* does the file need to be truncated? */
MPI_Comm commPio = commInqCommPio();
int trailingOctets = fsize > endpos;
xmpi(MPI_Allreduce(MPI_IN_PLACE, &trailingOctets, 1, MPI_INT, MPI_LOR,
commPio));
if (trailingOctets)
xmpi(MPI_File_set_size(of->fh, endpos));
int iret = MPI_File_close(&of->fh);
Free(of);
return iret == MPI_SUCCESS ? 0 : -1;
}
/***************************************************************/
static bool
compareNamesFileWriteAtAll(void *v1, void *v2)
{
aFiledataM *afm1 = v1, *afm2 = v2;
return !strcmp(afm1->name, afm2->name);
}
/***************************************************************/
static size_t
fwFileWriteAtAll(int fileID, const void *buffer, size_t len)
{
aFiledataM *of
= listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
xassert(of && len <= INT_MAX);
MPI_Comm commPio = commInqCommPio();
int sizePio = commInqSizePio(),
rankPio = commInqRankPio();
/* find position to write to */
of->collWriteSize[rankPio] = (int)len;
xmpi(MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
of->collWriteSize, 1, MPI_INT, commPio));
MPI_Offset myPos = of->pos, nextWritePos;
for (size_t i = 0; i < (size_t)rankPio; ++i)
myPos += of->collWriteSize[i];
nextWritePos = myPos;
for (size_t i = (size_t)rankPio; i < (size_t)sizePio; ++i)
nextWritePos += of->collWriteSize[i];
/* write buffer */
xassert(len <= INT_MAX);
xmpi(MPI_File_write_at_all(of->fh, myPos, (void *)buffer, (int)len,
MPI_UNSIGNED_CHAR, MPI_STATUS_IGNORE));
of->pos = nextWritePos;
return len;
}
/***************************************************************/
static int fcFileWriteAtAll(int fileID)
{
aFiledataM *of
= listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
if (!of)
xabort("listSet, fileID=%d not found", fileID);
int iret = listSetRemove(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
return iret;
}
/***************************************************************/
static void
elemCheck(void *q, void *nm)
{
aFiledataM *afm = q;
const char *name = nm;
if (!strcmp(name, afm->name))
xabort("Filename %s has already been added to set\n", name);
}
static int
fowFileWriteAtAll(const char *filename, const char *mode)
{
static unsigned long buffersize = 0;
int id;
enum {
bcastRoot = 0
};
MPI_Comm commPio = commInqCommPio ();
int rankPio = commInqRankPio ();
if ((mode[0] != 'w' && mode[0] != 'W') || mode[0] == 0 || mode[1] != 0)
xabort("Unsupported mode \"%s\" in parallel file open.", mode);
/* broadcast buffersize to collectors ( just once, for all files )*/
if (!buffersize)
{
if (rankPio == bcastRoot)
buffersize = findWriteAccumBufsize();
xmpi(MPI_Bcast(&buffersize, 1, MPI_UNSIGNED_LONG, bcastRoot, commPio));
}
xdebug("buffersize=%lu", buffersize);
listSetForeach(bibAFiledataM, elemCheck, (void *)filename);
aFiledataM *of = initAFiledataFileWriteAtAll(filename, (size_t)buffersize);
if ((id = listSetAdd(bibAFiledataM, of)) < 0 )
xabort("filename %s not unique", of->name);
of->fileID = id;
return id;
}
/***************************************************************/
static void finalizeFileWriteAtAll(void)
{
if (!listSetIsEmpty(bibAFiledataM))
xabort("set bibAFiledataM not empty");
else
{
xdebug("%s", "destroy set");
listSetDelete(bibAFiledataM);
}
}
/***************************************************************/
void
cdiPioFileWriteAtAllInit(void)
{
bibAFiledataM = listSetNew( destroyAFiledataFileWriteAtAll, compareNamesFileWriteAtAll );
namespaceSwitchSet(NSSWITCH_FILE_OPEN, NSSW_FUNC(fowFileWriteAtAll));
namespaceSwitchSet(NSSWITCH_FILE_CLOSE, NSSW_FUNC(fcFileWriteAtAll));
namespaceSwitchSet(NSSWITCH_FILE_WRITE, NSSW_FUNC(fwFileWriteAtAll));
cdiPioFileWritingFinalize = finalizeFileWriteAtAll;
if ( bibAFiledataM == NULL )
xabort ( "listSetNew did not succeed" );
}
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
...@@ -48,6 +48,7 @@ cdiPioCSRSelectRange(MPI_Comm commSuper, int IOMode, ...@@ -48,6 +48,7 @@ cdiPioCSRSelectRange(MPI_Comm commSuper, int IOMode,
break; break;
case PIO_MPI: case PIO_MPI:
case PIO_MPI_FW_ORDERED: case PIO_MPI_FW_ORDERED:
case PIO_MPI_FW_AT_ALL:
role = (commRank >= clientRangeStart && commRank <= clientRangeEnd) role = (commRank >= clientRangeStart && commRank <= clientRangeEnd)
? PIO_ROLE_CLIENT : PIO_ROLE_WRITER_COLLECTOR; ? PIO_ROLE_CLIENT : PIO_ROLE_WRITER_COLLECTOR;
break; break;
......
...@@ -8,6 +8,7 @@ TESTS = cksum_verify \ ...@@ -8,6 +8,7 @@ TESTS = cksum_verify \
pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \ pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \
pio_cksum_asynch pio_cksum_writer pio_cksum_cdf \ pio_cksum_asynch pio_cksum_writer pio_cksum_cdf \
pio_cksum_mpi_fw_ordered \ pio_cksum_mpi_fw_ordered \
pio_cksum_mpi_fw_at_all \
test_resource_copy pio_write_deco2d_run \ test_resource_copy pio_write_deco2d_run \
test_f2003 test_cdf_transformation test_f2003 test_cdf_transformation
check_PROGRAMS = cksum_verify test_grib cksum_write cksum_read pio_write \ check_PROGRAMS = cksum_verify test_grib cksum_write cksum_read pio_write \
......
...@@ -82,8 +82,9 @@ TESTS = cksum_verify$(EXEEXT) test_cksum_grib test_cksum_nc \ ...@@ -82,8 +82,9 @@ TESTS = cksum_verify$(EXEEXT) test_cksum_grib test_cksum_nc \
test_cksum_nc4 test_cksum_ieg test_chunk_cksum pio_write_run \ test_cksum_nc4 test_cksum_ieg test_chunk_cksum pio_write_run \
pio_cksum_mpinonb pio_cksum_fpguard pio_cksum_asynch \ pio_cksum_mpinonb pio_cksum_fpguard pio_cksum_asynch \
pio_cksum_writer pio_cksum_cdf pio_cksum_mpi_fw_ordered \ pio_cksum_writer pio_cksum_cdf pio_cksum_mpi_fw_ordered \
test_resource_copy$(EXEEXT) pio_write_deco2d_run test_f2003 \ pio_cksum_mpi_fw_at_all test_resource_copy$(EXEEXT) \
test_cdf_transformation $(am__append_2) pio_write_deco2d_run test_f2003 test_cdf_transformation \
$(am__append_2)
check_PROGRAMS = cksum_verify$(EXEEXT) test_grib$(EXEEXT) \ check_PROGRAMS = cksum_verify$(EXEEXT) test_grib$(EXEEXT) \
cksum_write$(EXEEXT) cksum_read$(EXEEXT) pio_write$(EXEEXT) \ cksum_write$(EXEEXT) cksum_read$(EXEEXT) pio_write$(EXEEXT) \
test_resource_copy$(EXEEXT) cksum_write_chunk$(EXEEXT) \ test_resource_copy$(EXEEXT) cksum_write_chunk$(EXEEXT) \
...@@ -102,6 +103,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ ...@@ -102,6 +103,7 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(srcdir)/pio_write_deco2d_run.in \ $(srcdir)/pio_write_deco2d_run.in \
$(srcdir)/pio_cksum_mpinonb.in \ $(srcdir)/pio_cksum_mpinonb.in \
$(srcdir)/pio_cksum_mpi_fw_ordered.in \ $(srcdir)/pio_cksum_mpi_fw_ordered.in \
$(srcdir)/pio_cksum_mpi_fw_at_all.in \
$(srcdir)/pio_cksum_fpguard.in $(srcdir)/pio_cksum_asynch.in \ $(srcdir)/pio_cksum_fpguard.in $(srcdir)/pio_cksum_asynch.in \
$(srcdir)/pio_cksum_writer.in $(srcdir)/pio_cksum_cdf.in \ $(srcdir)/pio_cksum_writer.in $(srcdir)/pio_cksum_cdf.in \
$(srcdir)/test_resource_copy_mpi_run.in \ $(srcdir)/test_resource_copy_mpi_run.in \
...@@ -143,8 +145,9 @@ CONFIG_CLEAN_FILES = test_cksum_grib test_cksum_nc test_cksum_nc2 \ ...@@ -143,8 +145,9 @@ CONFIG_CLEAN_FILES = test_cksum_grib test_cksum_nc test_cksum_nc2 \
test_cksum_nc4 test_cksum_extra test_cksum_service \ test_cksum_nc4 test_cksum_extra test_cksum_service \
test_cksum_ieg test_chunk_cksum test_f2003 pio_write_run \ test_cksum_ieg test_chunk_cksum test_f2003 pio_write_run \
pio_write_deco2d_run pio_cksum_mpinonb \ pio_write_deco2d_run pio_cksum_mpinonb \
pio_cksum_mpi_fw_ordered pio_cksum_fpguard pio_cksum_asynch \ pio_cksum_mpi_fw_ordered pio_cksum_mpi_fw_at_all \
pio_cksum_writer pio_cksum_cdf test_resource_copy_mpi_run \ pio_cksum_fpguard pio_cksum_asynch pio_cksum_writer \
pio_cksum_cdf test_resource_copy_mpi_run \
test_cdf_transformation test_cdf_transformation
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
@ENABLE_NETCDF_TRUE@am__EXEEXT_1 = test_cdf_write$(EXEEXT) \ @ENABLE_NETCDF_TRUE@am__EXEEXT_1 = test_cdf_write$(EXEEXT) \
...@@ -602,6 +605,8 @@ pio_cksum_mpinonb: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpinonb.in ...@@ -602,6 +605,8 @@ pio_cksum_mpinonb: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpinonb.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
pio_cksum_mpi_fw_ordered: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpi_fw_ordered.in pio_cksum_mpi_fw_ordered: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpi_fw_ordered.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
pio_cksum_mpi_fw_at_all: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpi_fw_at_all.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
pio_cksum_fpguard: $(top_builddir)/config.status $(srcdir)/pio_cksum_fpguard.in pio_cksum_fpguard: $(top_builddir)/config.status $(srcdir)/pio_cksum_fpguard.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
pio_cksum_asynch: $(top_builddir)/config.status $(srcdir)/pio_cksum_asynch.in pio_cksum_asynch: $(top_builddir)/config.status $(srcdir)/pio_cksum_asynch.in
......
#! @SHELL@
pio_write_args="-p PIO_MPI_FW_AT_ALL -w 2"
mpi_task_num=5
LOG=pio_cksum_mpi_fw_at_all.log
if [ "@USE_MPI@" = yes ]; then
. ./pio_write_run
else
exit 77
fi
...@@ -49,6 +49,7 @@ static const struct { ...@@ -49,6 +49,7 @@ static const struct {
{ "PIO_ASYNCH", PIO_ASYNCH }, { "PIO_ASYNCH", PIO_ASYNCH },
{ "PIO_WRITER", PIO_WRITER }, { "PIO_WRITER", PIO_WRITER },
{ "PIO_MPI_FW_ORDERED", PIO_MPI_FW_ORDERED }, { "PIO_MPI_FW_ORDERED", PIO_MPI_FW_ORDERED },
{ "PIO_MPI_FW_AT_ALL", PIO_MPI_FW_AT_ALL },
}; };
static inline int static inline int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment