Compare commits
9 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 0de26d06e3 | |||
| ed256dcfb4 | |||
| 676e345393 | |||
| b2677afd16 | |||
| 751f748c71 | |||
| 9a0939998e | |||
| 5734d84e32 | |||
| 82176c5905 | |||
| c03905df39 |
12
README.md
12
README.md
@@ -1,12 +0,0 @@
|
||||
|
||||
## Build Results
|
||||
|
||||
Current state of mpich in openSUSE:Factory is
|
||||
|
||||

|
||||
|
||||
The current state of mpich in the devel project build (science:HPC)
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<multibuild>
|
||||
<package>ucx</package>
|
||||
<package>ucx-testsuite</package>
|
||||
<package>standard</package>
|
||||
<package>testsuite</package>
|
||||
<package>ofi</package>
|
||||
<package>ofi-testsuite</package>
|
||||
</multibuild>
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
commit 564c0affae6a79b3c99fce5717c402182d74daa1
|
||||
Author: Nicolas Morey <nmorey@suse.com>
|
||||
Date: Sat Nov 8 23:34:58 2025 +0100
|
||||
|
||||
ch4: shm: fix data type for recv_bytes in MPIDI_POSIX_mpi_release_gather_release
|
||||
|
||||
The number of received bytes in release_gather_release is badly cast between
|
||||
int and MPI_Aint. On most arch this is not an issue, but for Big-Endian 64b arch (s390x)
|
||||
it ends up losing the actual value as we only copy the first 4 MSB.
|
||||
Fix the issue by writing the whole MPI_AInt in the shm_buf instead of just an int.
|
||||
|
||||
Signed-off-by: Nicolas Morey <nmorey@suse.com>
|
||||
|
||||
diff --git src/mpid/ch4/shm/posix/release_gather/release_gather.h src/mpid/ch4/shm/posix/release_gather/release_gather.h
|
||||
index ac966cb9772e..ff1308830d00 100644
|
||||
--- src/mpid/ch4/shm/posix/release_gather/release_gather.h
|
||||
+++ src/mpid/ch4/shm/posix/release_gather/release_gather.h
|
||||
@@ -121,7 +121,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_POSIX_mpi_release_gather_release(void *local_
|
||||
datatype, root, MPIR_BCAST_TAG, comm_ptr, &status);
|
||||
MPIR_ERR_CHECK(mpi_errno);
|
||||
MPIR_Get_count_impl(&status, MPI_BYTE, &recv_bytes);
|
||||
- MPIR_Typerep_copy(bcast_data_addr, &recv_bytes, sizeof(int),
|
||||
+ MPIR_Typerep_copy(bcast_data_addr, &recv_bytes, sizeof(MPI_Aint),
|
||||
MPIR_TYPEREP_FLAG_NONE);
|
||||
/* It is necessary to copy the errflag as well to handle the case when non-root
|
||||
* becomes temporary root as part of compositions (or smp aware colls). These temp
|
||||
@@ -146,7 +146,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_POSIX_mpi_release_gather_release(void *local_
|
||||
/* When error checking is enabled, place the datasize in shm_buf first, followed by the
|
||||
* errflag, followed by the actual data with an offset of (2*cacheline_size) bytes from
|
||||
* the starting address */
|
||||
- MPIR_Typerep_copy(bcast_data_addr, &count, sizeof(int), MPIR_TYPEREP_FLAG_NONE);
|
||||
+ MPIR_Typerep_copy(bcast_data_addr, &count, sizeof(MPI_Aint), MPIR_TYPEREP_FLAG_NONE);
|
||||
/* It is necessary to copy the errflag as well to handle the case when non-root
|
||||
* becomes root as part of compositions (or smp aware colls). These roots might
|
||||
* expect same data as other ranks but different from the actual root. So only
|
||||
@@ -218,8 +218,9 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_POSIX_mpi_release_gather_release(void *local_
|
||||
* datasize is copied out from shm_buffer and compared against the count a rank was
|
||||
* expecting. Also, the errflag is copied out. In case of mismatch mpi_errno is set.
|
||||
* Actual data starts after (2*cacheline_size) bytes */
|
||||
- int recv_bytes, recv_errflag;
|
||||
- MPIR_Typerep_copy(&recv_bytes, bcast_data_addr, sizeof(int), MPIR_TYPEREP_FLAG_NONE);
|
||||
+ MPI_Aint recv_bytes;
|
||||
+ int recv_errflag;
|
||||
+ MPIR_Typerep_copy(&recv_bytes, bcast_data_addr, sizeof(MPI_Aint), MPIR_TYPEREP_FLAG_NONE);
|
||||
MPIR_Typerep_copy(&recv_errflag, (char *) bcast_data_addr + MPIDU_SHM_CACHE_LINE_LEN,
|
||||
sizeof(int), MPIR_TYPEREP_FLAG_NONE);
|
||||
MPIR_ERR_CHKANDJUMP2(recv_bytes != count, mpi_errno, MPI_ERR_OTHER,
|
||||
BIN
mpich-4.3.0.tar.gz
LFS
Normal file
BIN
mpich-4.3.0.tar.gz
LFS
Normal file
Binary file not shown.
BIN
mpich-4.3.2.tar.gz
LFS
BIN
mpich-4.3.2.tar.gz
LFS
Binary file not shown.
@@ -1,76 +1,3 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 4 17:54:18 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
|
||||
|
||||
- Use external hwloc
|
||||
- Rename standard multibuild flavor to ucx for more clarity
|
||||
- Add ch4-shm-fix-data-type-for-recv_bytes-in-MPIDI_POSIX_mpi_release_gather_release.patch
|
||||
to fix a datatype issue on s390x
|
||||
- Speed up testsuite by not rebuilding mpich completely
|
||||
- Fix random configure failure on aarch64
|
||||
- Fix FFLAGS
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 28 17:54:04 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
|
||||
|
||||
- Update to 4.3.2
|
||||
- Improve libfabric provider selection when available providers have
|
||||
negative internal score
|
||||
- Improve error messages when Level Zero failures are detected
|
||||
- Improve localhost detection in Hydra
|
||||
- Update libfabric usage to silence deprecation warnings
|
||||
- Update yaksa for improved reproducibility in code generation
|
||||
- Add compatibility with CUDA 13
|
||||
- Fix missing const in nondestructive request test and status query
|
||||
functions
|
||||
- Fix HCOLL support
|
||||
- Fix crash with GPU-aware build when running on systems with no GPUs
|
||||
- Fix HIP device query
|
||||
- Fix singleton init with Hydra
|
||||
- Fix thread safety for Level Zero memcpy functions
|
||||
- Fix potential crash when release gather collective initialization fails
|
||||
- Fix ch3 connect/accept protocol handling when a discard event arrives
|
||||
after a connection is already established
|
||||
- Fix inlining for posix eager modules in ch4/shm
|
||||
- Fix weak attribute usage in MPI ABI build
|
||||
- Fix potential use-after-free bug in Hydra during spawn operations
|
||||
- Fix bug in persistent bcast algorithm
|
||||
- Fix bug in fabric coordinate retrieval with PMIx
|
||||
- Fix integer overflow and signed/unsigned bugs in ROMIO
|
||||
- Fix Quobtye ROMIO driver build error
|
||||
- Fix broken string conversion in mpi_f08 module
|
||||
- Fix compilation issue with mpi_f08 and NAG compiler
|
||||
- Fixes for various test program bugs
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 25 06:59:00 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
|
||||
|
||||
- Remove romio-disable-tests.patch to reenable tests in OBS.
|
||||
- Add romio-test-fix-bad-snprintf-arguments.patch to fix a test
|
||||
issue when building with FORTIFY_SOURCE
|
||||
- Fix dependency from '*testsuite' packages to BuildRequires '*-devel'
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jun 22 17:39:27 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
|
||||
|
||||
- Update to 4.3.1
|
||||
- Fix initialization in GPU-aware builds when no devices are present
|
||||
- Fix internal pmix.h header conflict when building with an external
|
||||
PMIx library.
|
||||
- Fix build issue with Slurm by removing dependency on libslurm and
|
||||
always using internal logic for parsing the Slurm hostfile.
|
||||
- Fix potential stale GPU IPC handle usage resulting in data corruption
|
||||
or crashes
|
||||
- Update XPMEM thresholds to avoid excessive buffer mapping overhead
|
||||
- Fix potential hang in ROMIO when setting info hints on certain files
|
||||
- Improved detection of incompatible PMI[x] client/server configuration
|
||||
- Fix use of PMIX_PREFIX attribute for certain versions of OpenPMIx
|
||||
- Fix Intel GPU output with MPIR_CVAR_DEBUG_SUMMARY
|
||||
- Fix F08 binding compilation with nvfortran
|
||||
- Fix line continuation Hydra's --configfile option
|
||||
- Fix valgrind uninitialized read warnings in ch3
|
||||
- Fix missing mpixxx_opts.conf file with help text for mpicc and friends
|
||||
- Fixes for several compiler warnings
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 29 14:25:11 UTC 2025 - Nicolas Morey <nicolas.morey@suse.com>
|
||||
|
||||
|
||||
62
mpich.spec
62
mpich.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package mpich
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -29,10 +29,10 @@
|
||||
ExclusiveArch: do_not_build
|
||||
%endif
|
||||
|
||||
%if "%{flavor}" == "ucx"
|
||||
%if "%{flavor}" == "standard"
|
||||
%define build_flavor ucx
|
||||
%endif
|
||||
%if "%{flavor}" == "ucx-testsuite"
|
||||
%if "%{flavor}" == "testsuite"
|
||||
%define build_flavor ucx
|
||||
%define testsuite 1
|
||||
%endif
|
||||
@@ -65,12 +65,11 @@ ExclusiveArch: do_not_build
|
||||
%define p_mandir %{p_datadir}/man
|
||||
%define p_libdir %{p_prefix}/%{_lib}
|
||||
%define p_libexecdir %{p_prefix}/%{_lib}
|
||||
%define p_sysconfdir %{p_prefix}/%{_sysconfdir}
|
||||
%define _moduledir /usr/share/modules/gnu-%{module_name}
|
||||
%define package_name %{pname}%{?pack_suff}
|
||||
|
||||
Name: %{package_name}%{?testsuite:-testsuite}
|
||||
Version: 4.3.2
|
||||
Version: 4.3.0
|
||||
Release: 0
|
||||
Summary: High-performance and widely portable implementation of MPI
|
||||
License: MIT
|
||||
@@ -80,11 +79,9 @@ Source0: http://www.mpich.org/static/downloads/%{version}/mpich-%{version
|
||||
Source1: mpivars.sh
|
||||
Source2: mpivars.csh
|
||||
Source100: _multibuild
|
||||
Source101: README.md
|
||||
Patch1: autogen-only-deal-with-json-yaksa-if-enabled.patch
|
||||
Patch2: autoconf-pull-dynamic-and-not-static-libs-from-pkg-config.patch
|
||||
Patch3: romio-test-fix-bad-snprintf-arguments.patch
|
||||
Patch4: ch4-shm-fix-data-type-for-recv_bytes-in-MPIDI_POSIX_mpi_release_gather_release.patch
|
||||
Patch3: romio-disable-tests.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
BuildRequires: fdupes
|
||||
@@ -102,7 +99,6 @@ BuildRequires: libtool
|
||||
BuildRequires: libtool
|
||||
BuildRequires: mpi-selector
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: hwloc-devel >= 2.0
|
||||
|
||||
%if "%{build_flavor}" == "ofi"
|
||||
BuildRequires: libfabric-devel
|
||||
@@ -116,6 +112,7 @@ BuildRequires: libuct-devel >= 1.7.0
|
||||
# UCX is only available for 64b archs
|
||||
ExcludeArch: %ix86 %arm
|
||||
%endif
|
||||
|
||||
Provides: mpi
|
||||
BuildRequires: Modules
|
||||
BuildRequires: gcc-c++
|
||||
@@ -125,7 +122,7 @@ Requires: mpi-selector
|
||||
Requires(preun): mpi-selector
|
||||
|
||||
%if 0%{?testsuite}
|
||||
BuildRequires: %package_name-devel = %{version}
|
||||
BuildRequires: %package_name = %{version}
|
||||
%endif
|
||||
|
||||
%description
|
||||
@@ -188,15 +185,11 @@ rm -R modules/{ucx,libfabric,json-c}
|
||||
|
||||
# GCC10 needs an extra flag to allow badly passed parameters
|
||||
%if 0%{?suse_version} > 1500
|
||||
export FFLAGS="-fallow-argument-mismatch %{optflags}"
|
||||
export FCFLAGS="-fallow-argument-mismatch %{optflags}"
|
||||
export FFLAGS="-fallow-argument-mismatch $FFLAGS"
|
||||
export FCFLAGS="-fallow-argument-mismatch $FCFLAGS"
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
# For some reason, configure has random issue with defining this
|
||||
# on aarch64 only. Set it to avoid random failure
|
||||
export CROSS_F77_SIZEOF_INTEGER=4
|
||||
%endif
|
||||
autoreconf -fi
|
||||
|
||||
./autogen.sh --without-ucx --without-ofi --without-json
|
||||
%configure \
|
||||
--prefix=%{p_prefix} \
|
||||
--exec-prefix=%{p_prefix} \
|
||||
@@ -207,10 +200,8 @@ autoreconf -fi
|
||||
--libexecdir=%{p_libexecdir} \
|
||||
--mandir=%{p_mandir} \
|
||||
--docdir=%{_datadir}/doc/%{name} \
|
||||
--sysconfdir=%{p_sysconfdir} \
|
||||
--disable-rpath \
|
||||
--disable-wrapper-rpath \
|
||||
--with-hwloc \
|
||||
%if "%{build_flavor}" == "ofi"
|
||||
--with-ofi \
|
||||
--with-device=ch4:ofi \
|
||||
@@ -224,21 +215,6 @@ autoreconf -fi
|
||||
MPICHLIB_CFLAGS="%{optflags}" \
|
||||
MPICHLIB_CXXFLAGS="%{optflags}"
|
||||
|
||||
%if 0%{?testsuite}
|
||||
%install
|
||||
rm -rf %{buildroot}/*
|
||||
|
||||
%check
|
||||
# Disable CMA. Modern kernels require specific ptrace capabilities
|
||||
# that are not available in OBS
|
||||
export MPIR_CVAR_CH4_CMA_ENABLE=0
|
||||
for dir in src/mpl src/mpi/romio/test; do
|
||||
(
|
||||
cd $dir && make check
|
||||
)
|
||||
done
|
||||
|
||||
%else
|
||||
make %{?_smp_mflags} VERBOSE=1
|
||||
|
||||
%install
|
||||
@@ -272,6 +248,16 @@ find %{buildroot} -name "*.a" -delete
|
||||
%fdupes %{buildroot}%{p_datadir}
|
||||
%fdupes %{buildroot}%{p_libdir}/pkgconfig
|
||||
|
||||
%if 0%{?testsuite}
|
||||
# Remove everything from testsuite package
|
||||
# It is all contained by mpich packages
|
||||
rm -rf %{buildroot}/*
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
%else
|
||||
|
||||
# make and install mpivars files
|
||||
install -m 0755 -d %{buildroot}%{_bindir}
|
||||
sed -e 's,prefix,%p_prefix,g' -e 's,libdir,%{p_libdir},g' %{S:1} > %{buildroot}%{p_bindir}/mpivars.sh
|
||||
@@ -328,10 +314,12 @@ fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc CHANGES COPYRIGHT README README.envvar
|
||||
%doc CHANGES COPYRIGHT README README.envvar RELEASE_NOTES
|
||||
%dir /usr/%_lib/mpi
|
||||
%dir /usr/%_lib/mpi/gcc
|
||||
%dir /usr/share/modules
|
||||
%dir %{_moduledir}
|
||||
%{_moduledir}
|
||||
%doc %{_datadir}/doc/*
|
||||
%dir %{p_prefix}
|
||||
%dir %{p_bindir}
|
||||
@@ -341,11 +329,9 @@ fi
|
||||
%dir %{p_mandir}/man1
|
||||
%dir %{p_mandir}/man3
|
||||
%dir %{p_libdir}
|
||||
%{_moduledir}
|
||||
%{p_bindir}/*
|
||||
%{p_mandir}/man1/*
|
||||
%{p_libdir}/*.so.*
|
||||
%{p_sysconfdir}
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
|
||||
24
romio-disable-tests.patch
Normal file
24
romio-disable-tests.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
commit 064abd16295dd402a436d9e9e3a1ad887c6fafb6
|
||||
Author: Nicolas Morey <nmorey@suse.com>
|
||||
Date: Wed Feb 19 19:45:08 2025 +0100
|
||||
|
||||
romio: disable tests
|
||||
|
||||
Tests assumes mpich to be fully installed which does not work
|
||||
for %check
|
||||
|
||||
Signed-off-by: Nicolas Morey <nmorey@suse.com>
|
||||
|
||||
diff --git src/mpi/romio/Makefile.am src/mpi/romio/Makefile.am
|
||||
index a6429766fd47..eb9ccd4f2f81 100644
|
||||
--- src/mpi/romio/Makefile.am
|
||||
+++ src/mpi/romio/Makefile.am
|
||||
@@ -56,7 +56,7 @@ nodist_include_HEADERS += include/mpio.h include/mpiof.h
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
-SUBDIRS = $(external_subdirs) . test
|
||||
+SUBDIRS = $(external_subdirs) .
|
||||
DIST_SUBDIRS = test test-internal $(external_dist_subdirs)
|
||||
|
||||
# for the sake of parallel make and avoiding an excessive number of convenience
|
||||
@@ -1,124 +0,0 @@
|
||||
commit 4da63a0032ea22d1530adf4da05a095d841bc969
|
||||
Author: Nicolas Morey <nmorey@suse.com>
|
||||
Date: Fri Aug 1 13:24:12 2025 +0200
|
||||
|
||||
romio: test: fix bad snprintf arguments
|
||||
|
||||
Even though there can not be a buffer overflow as the string is properly
|
||||
sized, noncontig_coll2 fails when built with -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 :
|
||||
----
|
||||
FAIL: noncontig_coll2
|
||||
=====================
|
||||
Thread 1 "noncontig_coll2" received signal SIGABRT, Aborted.
|
||||
0x00007ffff709c5fc in __pthread_kill_implementation () from /lib64/libc.so.6
|
||||
(gdb) bt
|
||||
#0 0x00007ffff709c5fc in __pthread_kill_implementation ()
|
||||
from /lib64/libc.so.6
|
||||
#1 0x00007ffff7042106 in raise () from /lib64/libc.so.6
|
||||
#2 0x00007ffff702938b in abort () from /lib64/libc.so.6
|
||||
#3 0x00007ffff702a3ab in __libc_message_impl.cold () from /lib64/libc.so.6
|
||||
#4 0x00007ffff712b4fb in __fortify_fail () from /lib64/libc.so.6
|
||||
#5 0x00007ffff712adc6 in __chk_fail () from /lib64/libc.so.6
|
||||
#6 0x00007ffff712c8f5 in __snprintf_chk () from /lib64/libc.so.6
|
||||
#7 0x000000000040275e in snprintf (__s=0x4aafee "", __n=<optimized out>,
|
||||
__fmt=0x404077 "%s,") at /usr/include/bits/stdio2.h:68
|
||||
#8 default_str (mynod=<optimized out>, len=61, array=0x59fca0,
|
||||
dest=0x4aafd0 "hostname,")
|
||||
at src/mpi/romio/test/noncontig_coll2.c:189
|
||||
#9 main (argc=<optimized out>, argv=<optimized out>)
|
||||
at src/mpi/romio/test/noncontig_coll2.c:330
|
||||
----
|
||||
This is due to the len parameter of snprintf not being updated as we
|
||||
advance in the string.
|
||||
Fix this issue by introducing a remaining len var that contains the exact amount
|
||||
of bytes left.
|
||||
|
||||
Signed-off-by: Nicolas Morey <nmorey@suse.com>
|
||||
|
||||
diff --git src/mpi/romio/test/noncontig_coll2.c src/mpi/romio/test/noncontig_coll2.c
|
||||
index 2b37d4749fc9..beade70c2388 100644
|
||||
--- src/mpi/romio/test/noncontig_coll2.c
|
||||
+++ src/mpi/romio/test/noncontig_coll2.c
|
||||
@@ -181,12 +181,14 @@ int cb_gather_name_array(MPI_Comm comm, ADIO_cb_name_array * arrayp)
|
||||
void default_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
{
|
||||
char *ptr;
|
||||
- int i, p;
|
||||
+ int i, p, rlen;
|
||||
if (!mynod) {
|
||||
ptr = dest;
|
||||
+ rlen = len;
|
||||
for (i = 0; i < array->namect; i++) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
/* chop off that last comma */
|
||||
dest[strlen(dest) - 1] = '\0';
|
||||
@@ -197,12 +199,14 @@ void default_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
{
|
||||
char *ptr;
|
||||
- int i, p;
|
||||
+ int i, p, rlen;
|
||||
if (!mynod) {
|
||||
ptr = dest;
|
||||
- for (i = (array->namect - 1); i >= 0; i--) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ rlen = len;
|
||||
+ for (i = (array->namect - 1); i >= 0; i--) {
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
dest[strlen(dest) - 1] = '\0';
|
||||
}
|
||||
@@ -212,18 +216,21 @@ void reverse_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
void reverse_alternating_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
{
|
||||
char *ptr;
|
||||
- int i, p;
|
||||
+ int i, p, rlen;
|
||||
if (!mynod) {
|
||||
ptr = dest;
|
||||
+ rlen = len;
|
||||
/* evens */
|
||||
for (i = (array->namect - 1); i >= 0; i -= 2) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
/* odds */
|
||||
for (i = (array->namect - 2); i > 0; i -= 2) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
dest[strlen(dest) - 1] = '\0';
|
||||
}
|
||||
@@ -233,16 +240,19 @@ void reverse_alternating_str(int mynod, int len, ADIO_cb_name_array array, char
|
||||
void simple_shuffle_str(int mynod, int len, ADIO_cb_name_array array, char *dest)
|
||||
{
|
||||
char *ptr;
|
||||
- int i, p;
|
||||
+ int i, p, rlen;
|
||||
if (!mynod) {
|
||||
ptr = dest;
|
||||
+ rlen = len;
|
||||
for (i = (array->namect / 2); i < array->namect; i++) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
for (i = 0; i < (array->namect / 2); i++) {
|
||||
- p = snprintf(ptr, len, "%s,", array->names[i]);
|
||||
+ p = snprintf(ptr, rlen, "%s,", array->names[i]);
|
||||
ptr += p;
|
||||
+ rlen = rlen - p;
|
||||
}
|
||||
dest[strlen(dest) - 1] = '\0';
|
||||
}
|
||||
Reference in New Issue
Block a user