From f5ee1625e5d2e9a4a1727bf2ea73523de027e6a1 Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Fri, 23 Aug 2019 13:29:03 -0600 Subject: [PATCH 1/5] fixed dispatch table removal of _pe functions --- src/ncint/ncintdispatch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ncint/ncintdispatch.c b/src/ncint/ncintdispatch.c index 2260137544d..6a54436d6fc 100644 --- a/src/ncint/ncintdispatch.c +++ b/src/ncint/ncintdispatch.c @@ -39,8 +39,6 @@ NC_Dispatch NCINT_dispatcher = { PIO_NCINT_abort, PIO_NCINT_close, PIO_NCINT_set_fill, - NC_NOTNC3_inq_base_pe, - NC_NOTNC3_set_base_pe, PIO_NCINT_inq_format, PIO_NCINT_inq_format_extended, From d077e48fd089b1c2eab1c99076054bafc0a9c68b Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Fri, 23 Aug 2019 13:31:54 -0600 Subject: [PATCH 2/5] added use_ext_ncid to the parameters sent when a file is created in async mode --- src/clib/pio_msg.c | 7 +++++-- src/clib/pioc_support.c | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/clib/pio_msg.c b/src/clib/pio_msg.c index 9d9c25d0c90..b8fc7f31882 100644 --- a/src/clib/pio_msg.c +++ b/src/clib/pio_msg.c @@ -172,6 +172,7 @@ int create_file_handler(iosystem_desc_t *ios) int len; int iotype; int mode; + int use_ext_ncid; int mpierr; PLOG((1, "create_file_handler comproot = %d", ios->comproot)); @@ -191,8 +192,10 @@ int create_file_handler(iosystem_desc_t *ios) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&mode, 1, MPI_INT, 0, ios->intercomm))) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); - PLOG((1, "create_file_handler got parameters len = %d filename = %s iotype = %d mode = %d", - len, filename, iotype, mode)); + if ((mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, 0, ios->intercomm))) + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); + PLOG((1, "create_file_handler len %d filename %s iotype %d mode %d " + "use_ext_ncid %d", len, filename, iotype, mode, use_ext_ncid)); /* Call the create file function. */ PIOc_createfile(ios->iosysid, &ncid, &iotype, filename, mode); diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index 3b098a8b7ce..b9102233f37 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -2014,8 +2014,10 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename, mpierr = MPI_Bcast(&file->iotype, 1, MPI_INT, ios->compmaster, ios->intercomm); if (!mpierr) mpierr = MPI_Bcast(&mode, 1, MPI_INT, ios->compmaster, ios->intercomm); - PLOG((2, "len = %d filename = %s iotype = %d mode = %d", len, filename, - file->iotype, mode)); + if (!mpierr) + mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, ios->compmaster, ios->intercomm); + PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d", + len, filename, file->iotype, mode, use_ext_ncid)); } /* Handle MPI errors. */ From ba2bb47db632aa9ebc0d64666e748fe7bb98c6d8 Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Fri, 23 Aug 2019 13:34:43 -0600 Subject: [PATCH 3/5] added ncidp_present to the parameters sent when a file is created in async mode --- src/clib/pio_msg.c | 6 +++++- src/clib/pioc_support.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/clib/pio_msg.c b/src/clib/pio_msg.c index b8fc7f31882..091ae927799 100644 --- a/src/clib/pio_msg.c +++ b/src/clib/pio_msg.c @@ -173,6 +173,7 @@ int create_file_handler(iosystem_desc_t *ios) int iotype; int mode; int use_ext_ncid; + char ncidp_present; int mpierr; PLOG((1, "create_file_handler comproot = %d", ios->comproot)); @@ -194,8 +195,11 @@ int create_file_handler(iosystem_desc_t *ios) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, 0, ios->intercomm))) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); + if ((mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, 0, ios->intercomm))) + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); PLOG((1, "create_file_handler len %d filename %s iotype %d mode %d " - "use_ext_ncid %d", len, filename, iotype, mode, use_ext_ncid)); + "use_ext_ncid %d ncidp_present", len, filename, iotype, mode, + use_ext_ncid, ncidp_present)); /* Call the create file function. */ PIOc_createfile(ios->iosysid, &ncid, &iotype, filename, mode); diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index b9102233f37..f863e1fb3d6 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -1998,6 +1998,7 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename, if (!ios->ioproc) { int msg = PIO_MSG_CREATE_FILE; + char ncidp_present = ncidp ? 1 : 0; size_t len = strlen(filename); /* Send the message to the message handler. */ @@ -2016,8 +2017,11 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename, mpierr = MPI_Bcast(&mode, 1, MPI_INT, ios->compmaster, ios->intercomm); if (!mpierr) mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, ios->compmaster, ios->intercomm); - PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d", - len, filename, file->iotype, mode, use_ext_ncid)); + if (!mpierr) + mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, ios->compmaster, ios->intercomm); + PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d " + "ncidp_present %d", len, filename, file->iotype, mode, + use_ext_ncid, ncidp_present)); } /* Handle MPI errors. */ From 9f91675e5057a1dfd0f27c5fbe8fa028c25794c0 Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Fri, 23 Aug 2019 13:41:01 -0600 Subject: [PATCH 4/5] added contents of ncidp when ncidp_present to the parameters sent when a file is created in async mode --- src/clib/pio_msg.c | 10 ++++++---- src/clib/pioc_support.c | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/clib/pio_msg.c b/src/clib/pio_msg.c index 091ae927799..5d0116ce196 100644 --- a/src/clib/pio_msg.c +++ b/src/clib/pio_msg.c @@ -168,7 +168,7 @@ int set_fill_handler(iosystem_desc_t *ios) */ int create_file_handler(iosystem_desc_t *ios) { - int ncid; + int ncid = 0; int len; int iotype; int mode; @@ -197,14 +197,16 @@ int create_file_handler(iosystem_desc_t *ios) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); if ((mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, 0, ios->intercomm))) return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); + if (ncidp_present) + if ((mpierr = MPI_Bcast(&ncid, 1, MPI_INT, 0, ios->intercomm))) + return check_mpi(ios, NULL, mpierr, __FILE__, __LINE__); PLOG((1, "create_file_handler len %d filename %s iotype %d mode %d " - "use_ext_ncid %d ncidp_present", len, filename, iotype, mode, - use_ext_ncid, ncidp_present)); + "use_ext_ncid %d ncidp_present %d ncid %d", len, filename, iotype, mode, + use_ext_ncid, ncidp_present, ncid)); /* Call the create file function. */ PIOc_createfile(ios->iosysid, &ncid, &iotype, filename, mode); - PLOG((1, "create_file_handler succeeded!")); return PIO_NOERR; } diff --git a/src/clib/pioc_support.c b/src/clib/pioc_support.c index f863e1fb3d6..5488c4fbdc6 100644 --- a/src/clib/pioc_support.c +++ b/src/clib/pioc_support.c @@ -2019,6 +2019,9 @@ PIOc_createfile_int(int iosysid, int *ncidp, int *iotype, const char *filename, mpierr = MPI_Bcast(&use_ext_ncid, 1, MPI_INT, ios->compmaster, ios->intercomm); if (!mpierr) mpierr = MPI_Bcast(&ncidp_present, 1, MPI_CHAR, ios->compmaster, ios->intercomm); + if (ncidp_present) + if (!mpierr) + mpierr = MPI_Bcast(ncidp, 1, MPI_INT, ios->compmaster, ios->intercomm); PLOG((2, "len %d filename %s iotype %d mode %d use_ext_ncid %d " "ncidp_present %d", len, filename, file->iotype, mode, use_ext_ncid, ncidp_present)); From ae93759001640069666df5d347f96b383d548da8 Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Fri, 23 Aug 2019 13:43:52 -0600 Subject: [PATCH 5/5] now use PIOc_createfile_int() instead of PIOc_createfile() in pio_msg.c for async --- src/clib/pio_file.c | 13 +++---------- src/clib/pio_msg.c | 3 ++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/clib/pio_file.c b/src/clib/pio_file.c index f4b91d1bf98..631d1fa0c85 100644 --- a/src/clib/pio_file.c +++ b/src/clib/pio_file.c @@ -159,16 +159,9 @@ PIOc_createfile(int iosysid, int *ncidp, int *iotype, const char *filename, if ((ret = PIOc_createfile_int(iosysid, ncidp, iotype, filename, mode, 0))) return pio_err(ios, NULL, ret, __FILE__, __LINE__); - /* Run this on all tasks if async is not in use, but only on - * non-IO tasks if async is in use. (Because otherwise, in async - * mode, set_fill would be called twice by each IO task, since - * PIOc_createfile() will already be called on each IO task.) */ - if (!ios->async || !ios->ioproc) - { - /* Set the fill mode to NOFILL. */ - if ((ret = PIOc_set_fill(*ncidp, NC_NOFILL, NULL))) - return ret; - } + /* Set the fill mode to NOFILL. */ + if ((ret = PIOc_set_fill(*ncidp, NC_NOFILL, NULL))) + return ret; return ret; } diff --git a/src/clib/pio_msg.c b/src/clib/pio_msg.c index 5d0116ce196..988f2b71447 100644 --- a/src/clib/pio_msg.c +++ b/src/clib/pio_msg.c @@ -205,7 +205,8 @@ int create_file_handler(iosystem_desc_t *ios) use_ext_ncid, ncidp_present, ncid)); /* Call the create file function. */ - PIOc_createfile(ios->iosysid, &ncid, &iotype, filename, mode); + PIOc_createfile_int(ios->iosysid, &ncid, &iotype, filename, mode, + use_ext_ncid); PLOG((1, "create_file_handler succeeded!")); return PIO_NOERR;