misc: Use C99 snprintf
Esse commit está contido em:
@@ -3650,12 +3650,6 @@ if test "$ac_cv_func_strerror_r" = "yes" ; then
|
||||
PAC_FUNC_NEEDS_DECL([#include <string.h>],strerror_r)
|
||||
fi
|
||||
|
||||
# Use snprintf if possible when creating messages
|
||||
AC_CHECK_FUNCS(snprintf)
|
||||
if test "$ac_cv_func_snprintf" = "yes" ; then
|
||||
PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
|
||||
fi
|
||||
|
||||
# qsort will be used in MPI_Comm_split, if available
|
||||
AC_CHECK_FUNCS([qsort])
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ static inline void MPIR_Handle_free(MPIR_Object_alloc_t * objmem)
|
||||
do { \
|
||||
if (MPL_VG_RUNNING_ON_VALGRIND()) { \
|
||||
char desc_str[256]; \
|
||||
MPL_snprintf(desc_str, sizeof(desc_str)-1, \
|
||||
snprintf(desc_str, sizeof(desc_str)-1, \
|
||||
"[MPICH handle: objptr=%p handle=0x%x %s/%s]", \
|
||||
(objptr_), (objptr_)->handle, \
|
||||
((is_direct_) ? "DIRECT" : "INDIRECT"), \
|
||||
|
||||
@@ -89,7 +89,7 @@ static int get_string_value(char *s, int type, int val)
|
||||
if (type == MPIR_COMM_HINT_TYPE_BOOL) {
|
||||
strncpy(s, val ? "true" : "false", MPI_MAX_INFO_VAL);
|
||||
} else if (type == MPIR_COMM_HINT_TYPE_INT) {
|
||||
MPL_snprintf(s, MPI_MAX_INFO_VAL, "%d", val);
|
||||
snprintf(s, MPI_MAX_INFO_VAL, "%d", val);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -59,15 +59,14 @@ static void dump_context_id(MPIR_Context_id_t context_id, char *out_str, int len
|
||||
MPIR_Assert(FALSE);
|
||||
break;
|
||||
}
|
||||
MPL_snprintf(out_str, len,
|
||||
"context_id=%d (%#x): DYNAMIC_PROC=%d PREFIX=%#x IS_LOCALCOMM=%d SUBCOMM=%s SUFFIX=%s",
|
||||
context_id,
|
||||
context_id,
|
||||
MPIR_CONTEXT_READ_FIELD(DYNAMIC_PROC, context_id),
|
||||
MPIR_CONTEXT_READ_FIELD(PREFIX, context_id),
|
||||
MPIR_CONTEXT_READ_FIELD(IS_LOCALCOMM, context_id),
|
||||
subcomm_type_name,
|
||||
(MPIR_CONTEXT_READ_FIELD(SUFFIX, context_id) ? "coll" : "pt2pt"));
|
||||
snprintf(out_str, len,
|
||||
"context_id=%d (%#x): DYNAMIC_PROC=%d PREFIX=%#x IS_LOCALCOMM=%d SUBCOMM=%s SUFFIX=%s",
|
||||
context_id,
|
||||
context_id,
|
||||
MPIR_CONTEXT_READ_FIELD(DYNAMIC_PROC, context_id),
|
||||
MPIR_CONTEXT_READ_FIELD(PREFIX, context_id),
|
||||
MPIR_CONTEXT_READ_FIELD(IS_LOCALCOMM, context_id),
|
||||
subcomm_type_name, (MPIR_CONTEXT_READ_FIELD(SUFFIX, context_id) ? "coll" : "pt2pt"));
|
||||
}
|
||||
|
||||
/* Create a string that contains the context mask. This is
|
||||
@@ -96,7 +95,7 @@ static char *context_mask_to_str(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < maxset; i++) {
|
||||
MPL_snprintf(&bufstr[i * 8], 9, "%.8x", context_mask[i]);
|
||||
snprintf(&bufstr[i * 8], 9, "%.8x", context_mask[i]);
|
||||
}
|
||||
return bufstr;
|
||||
}
|
||||
|
||||
+41
-42
@@ -610,7 +610,7 @@ void MPIR_Handle_fatal_error(MPIR_Comm * comm_ptr, const char fcname[], int errc
|
||||
/* FIXME: Not internationalized. Since we are using MPIR_Err_get_string,
|
||||
* we are assuming that the code is still able to execute a full
|
||||
* MPICH error code to message conversion. */
|
||||
MPL_snprintf(error_msg, MAX_ERRMSG_STRING, "Fatal error in %s: ", fcname);
|
||||
snprintf(error_msg, MAX_ERRMSG_STRING, "Fatal error in %s: ", fcname);
|
||||
len = (int) strlen(error_msg);
|
||||
MPIR_Err_get_string(errcode, &error_msg[len], MAX_ERRMSG_STRING - len, NULL);
|
||||
|
||||
@@ -787,7 +787,7 @@ void MPIR_Err_get_string(int errorcode, char *msg, int length, MPIR_Err_get_clas
|
||||
generic_idx = ((errorcode & ERROR_GENERIC_MASK) >> ERROR_GENERIC_SHIFT) - 1;
|
||||
|
||||
if (generic_idx >= 0) {
|
||||
MPL_snprintf(msg, num_remaining, ", %s", generic_err_msgs[generic_idx].long_name);
|
||||
snprintf(msg, num_remaining, ", %s", generic_err_msgs[generic_idx].long_name);
|
||||
msg[num_remaining - 1] = '\0';
|
||||
goto fn_exit;
|
||||
}
|
||||
@@ -1102,7 +1102,7 @@ int MPIR_Err_create_code_valist(int lastcode, int fatal, const char fcname[],
|
||||
} else {
|
||||
specific_fmt = specific_msg;
|
||||
}
|
||||
MPL_snprintf(user_ring_msg, sizeof(user_ring_msg), specific_fmt, user_error_code);
|
||||
snprintf(user_ring_msg, sizeof(user_ring_msg), specific_fmt, user_error_code);
|
||||
} else {
|
||||
user_ring_msg[0] = 0;
|
||||
}
|
||||
@@ -1194,8 +1194,7 @@ int MPIR_Err_create_code_valist(int lastcode, int fatal, const char fcname[],
|
||||
}
|
||||
|
||||
if (fcname != NULL) {
|
||||
MPL_snprintf(ErrorRing[ring_idx].location, MAX_LOCATION_LEN, "%s(%d)", fcname,
|
||||
line);
|
||||
snprintf(ErrorRing[ring_idx].location, MAX_LOCATION_LEN, "%s(%d)", fcname, line);
|
||||
ErrorRing[ring_idx].location[MAX_LOCATION_LEN] = '\0';
|
||||
} else {
|
||||
ErrorRing[ring_idx].location[0] = '\0';
|
||||
@@ -1286,7 +1285,7 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
|
||||
if (ErrorRing[ring_idx].id == ring_id) {
|
||||
int nchrs;
|
||||
MPL_snprintf(str, maxlen, "%s", ErrorRing[ring_idx].location);
|
||||
snprintf(str, maxlen, "%s", ErrorRing[ring_idx].location);
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
@@ -1317,8 +1316,8 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
if (len > maxlen)
|
||||
break;
|
||||
/* FIXME: Don't use Snprint to append a string ! */
|
||||
MPL_snprintf(str, MPIR_CVAR_CHOP_ERROR_STACK - 1 - max_location_len,
|
||||
"%s", cur_pos);
|
||||
snprintf(str, MPIR_CVAR_CHOP_ERROR_STACK - 1 - max_location_len,
|
||||
"%s", cur_pos);
|
||||
str[MPIR_CVAR_CHOP_ERROR_STACK - 1 - max_location_len] = '\n';
|
||||
cur_pos += MPIR_CVAR_CHOP_ERROR_STACK - 1 - max_location_len;
|
||||
str += MPIR_CVAR_CHOP_ERROR_STACK - max_location_len;
|
||||
@@ -1326,13 +1325,13 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
if (maxlen < max_location_len)
|
||||
break;
|
||||
for (i = 0; i < max_location_len; i++) {
|
||||
MPL_snprintf(str, maxlen, " ");
|
||||
snprintf(str, maxlen, " ");
|
||||
maxlen--;
|
||||
str++;
|
||||
}
|
||||
len = (int) strlen(cur_pos);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "%s\n", cur_pos);
|
||||
snprintf(str, maxlen, "%s\n", cur_pos);
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
@@ -1340,7 +1339,7 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "%s\n", ErrorRing[ring_idx].msg);
|
||||
snprintf(str, maxlen, "%s\n", ErrorRing[ring_idx].msg);
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
@@ -1372,7 +1371,7 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
if (!p) {
|
||||
p = "<NULL>";
|
||||
}
|
||||
MPL_snprintf(str, maxlen, "(unknown)(): %s\n", p);
|
||||
snprintf(str, maxlen, "(unknown)(): %s\n", p);
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
@@ -1386,13 +1385,13 @@ static void MPIR_Err_print_stack_string(int errcode, char *str, int maxlen)
|
||||
error_class = ERROR_GET_CLASS(errcode);
|
||||
|
||||
if (error_class <= MPICH_ERR_LAST_MPIX) {
|
||||
MPL_snprintf(str, maxlen, "(unknown)(): %s\n", get_class_msg(ERROR_GET_CLASS(errcode)));
|
||||
snprintf(str, maxlen, "(unknown)(): %s\n", get_class_msg(ERROR_GET_CLASS(errcode)));
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
} else {
|
||||
/* FIXME: Not internationalized */
|
||||
MPL_snprintf(str, maxlen, "Error code contains an invalid class (%d)\n", error_class);
|
||||
snprintf(str, maxlen, "Error code contains an invalid class (%d)\n", error_class);
|
||||
len = (int) strlen(str);
|
||||
maxlen -= len;
|
||||
str += len;
|
||||
@@ -1531,9 +1530,9 @@ static const char *GetAssertString(int d)
|
||||
}
|
||||
if (d) {
|
||||
if (len < ASSERT_STR_MAXLEN)
|
||||
MPL_snprintf(cur, len, " | 0x%x", d);
|
||||
snprintf(cur, len, " | 0x%x", d);
|
||||
else
|
||||
MPL_snprintf(cur, len, "assert=0x%x", d);
|
||||
snprintf(cur, len, "assert=0x%x", d);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@@ -1561,7 +1560,7 @@ static const char *GetDTypeString(MPI_Datatype d)
|
||||
if (combiner == MPI_COMBINER_NAMED) {
|
||||
str = MPIR_Datatype_builtin_to_string(d);
|
||||
if (str == NULL) {
|
||||
MPL_snprintf(default_str, sizeof(default_str), "dtype=0x%08x", d);
|
||||
snprintf(default_str, sizeof(default_str), "dtype=0x%08x", d);
|
||||
return default_str;
|
||||
}
|
||||
return str;
|
||||
@@ -1570,10 +1569,10 @@ static const char *GetDTypeString(MPI_Datatype d)
|
||||
/* default is not thread safe */
|
||||
str = MPIR_Datatype_combiner_to_string(combiner);
|
||||
if (str == NULL) {
|
||||
MPL_snprintf(default_str, sizeof(default_str), "dtype=USER<0x%08x>", d);
|
||||
snprintf(default_str, sizeof(default_str), "dtype=USER<0x%08x>", d);
|
||||
return default_str;
|
||||
}
|
||||
MPL_snprintf(default_str, sizeof(default_str), "dtype=USER<%s>", str);
|
||||
snprintf(default_str, sizeof(default_str), "dtype=USER<%s>", str);
|
||||
return default_str;
|
||||
}
|
||||
|
||||
@@ -1614,7 +1613,7 @@ static const char *GetMPIOpString(MPI_Op o)
|
||||
return "MPI_NO_OP";
|
||||
}
|
||||
/* FIXME: default is not thread safe */
|
||||
MPL_snprintf(default_str, sizeof(default_str), "op=0x%x", o);
|
||||
snprintf(default_str, sizeof(default_str), "op=0x%x", o);
|
||||
return default_str;
|
||||
}
|
||||
|
||||
@@ -1651,7 +1650,7 @@ static const char *get_keyval_string(int keyval)
|
||||
return "MPI_WIN_MODEL";
|
||||
}
|
||||
/* FIXME: default is not thread safe */
|
||||
MPL_snprintf(default_str, sizeof(default_str), "keyval=0x%x", keyval);
|
||||
snprintf(default_str, sizeof(default_str), "keyval=0x%x", keyval);
|
||||
return default_str;
|
||||
}
|
||||
|
||||
@@ -1717,19 +1716,19 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
break;
|
||||
case (int) 'd':
|
||||
d = va_arg(list, int);
|
||||
MPL_snprintf(str, maxlen, "%d", d);
|
||||
snprintf(str, maxlen, "%d", d);
|
||||
break;
|
||||
case (int) 'L':
|
||||
ll = va_arg(list, long long);
|
||||
MPL_snprintf(str, maxlen, "%lld", ll);
|
||||
snprintf(str, maxlen, "%lld", ll);
|
||||
break;
|
||||
case (int) 'x':
|
||||
d = va_arg(list, int);
|
||||
MPL_snprintf(str, maxlen, "%x", d);
|
||||
snprintf(str, maxlen, "%x", d);
|
||||
break;
|
||||
case (int) 'X':
|
||||
ll = va_arg(list, long long);
|
||||
MPL_snprintf(str, maxlen, "%llx", ll);
|
||||
snprintf(str, maxlen, "%llx", ll);
|
||||
break;
|
||||
case (int) 'i':
|
||||
i = va_arg(list, int);
|
||||
@@ -1744,7 +1743,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
MPL_strncpy(str, "MPI_ROOT", maxlen);
|
||||
break;
|
||||
default:
|
||||
MPL_snprintf(str, maxlen, "%d", i);
|
||||
snprintf(str, maxlen, "%d", i);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1759,7 +1758,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
* though there is one example in the MPI-3.0 standard
|
||||
* that sets status.MPI_TAG to MPI_UNDEFINED in a
|
||||
* generalized request example. */
|
||||
MPL_snprintf(str, maxlen, "%d", t);
|
||||
snprintf(str, maxlen, "%d", t);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1774,7 +1773,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
* (including Windows) that don't prefix %p with 0x.
|
||||
* This must be done with a capability, not a test on
|
||||
* particular OS or header files */
|
||||
MPL_snprintf(str, maxlen, "%p", p);
|
||||
snprintf(str, maxlen, "%p", p);
|
||||
}
|
||||
break;
|
||||
case (int) 'C':
|
||||
@@ -1790,7 +1789,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
MPL_strncpy(str, "MPI_COMM_NULL", maxlen);
|
||||
break;
|
||||
default:
|
||||
MPL_snprintf(str, maxlen, "comm=0x%x", C);
|
||||
snprintf(str, maxlen, "comm=0x%x", C);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1799,12 +1798,12 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
if (info == MPI_INFO_NULL) {
|
||||
MPL_strncpy(str, "MPI_INFO_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "info=0x%x", info);
|
||||
snprintf(str, maxlen, "info=0x%x", info);
|
||||
}
|
||||
break;
|
||||
case (int) 'D':
|
||||
D = va_arg(list, MPI_Datatype);
|
||||
MPL_snprintf(str, maxlen, "%s", GetDTypeString(D));
|
||||
snprintf(str, maxlen, "%s", GetDTypeString(D));
|
||||
break;
|
||||
/* Include support for %F only if MPI-IO is enabled */
|
||||
#ifdef HAVE_ROMIO
|
||||
@@ -1815,7 +1814,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
if (F == MPI_FILE_NULL) {
|
||||
MPL_strncpy(str, "MPI_FILE_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "file=0x%lx", (unsigned long) F);
|
||||
snprintf(str, maxlen, "file=0x%lx", (unsigned long) F);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1825,31 +1824,31 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
if (W == MPI_WIN_NULL) {
|
||||
MPL_strncpy(str, "MPI_WIN_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "win=0x%x", W);
|
||||
snprintf(str, maxlen, "win=0x%x", W);
|
||||
}
|
||||
break;
|
||||
case (int) 'A':
|
||||
d = va_arg(list, int);
|
||||
MPL_snprintf(str, maxlen, "%s", GetAssertString(d));
|
||||
snprintf(str, maxlen, "%s", GetAssertString(d));
|
||||
break;
|
||||
case (int) 'G':
|
||||
G = va_arg(list, MPI_Group);
|
||||
if (G == MPI_GROUP_NULL) {
|
||||
MPL_strncpy(str, "MPI_GROUP_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "group=0x%x", G);
|
||||
snprintf(str, maxlen, "group=0x%x", G);
|
||||
}
|
||||
break;
|
||||
case (int) 'O':
|
||||
O = va_arg(list, MPI_Op);
|
||||
MPL_snprintf(str, maxlen, "%s", GetMPIOpString(O));
|
||||
snprintf(str, maxlen, "%s", GetMPIOpString(O));
|
||||
break;
|
||||
case (int) 'R':
|
||||
R = va_arg(list, MPI_Request);
|
||||
if (R == MPI_REQUEST_NULL) {
|
||||
MPL_strncpy(str, "MPI_REQUEST_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "req=0x%x", R);
|
||||
snprintf(str, maxlen, "req=0x%x", R);
|
||||
}
|
||||
break;
|
||||
case (int) 'E':
|
||||
@@ -1857,7 +1856,7 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
if (E == MPI_ERRHANDLER_NULL) {
|
||||
MPL_strncpy(str, "MPI_ERRHANDLER_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "errh=0x%x", E);
|
||||
snprintf(str, maxlen, "errh=0x%x", E);
|
||||
}
|
||||
break;
|
||||
case (int) 'S':
|
||||
@@ -1865,17 +1864,17 @@ static int vsnprintf_mpi(char *str, size_t maxlen, const char *fmt_orig, va_list
|
||||
if (S == MPI_SESSION_NULL) {
|
||||
MPL_strncpy(str, "MPI_SESSION_NULL", maxlen);
|
||||
} else {
|
||||
MPL_snprintf(str, maxlen, "session=0x%x", S);
|
||||
snprintf(str, maxlen, "session=0x%x", S);
|
||||
}
|
||||
break;
|
||||
case (int) 'K':
|
||||
d = va_arg(list, int);
|
||||
MPL_snprintf(str, maxlen, "%s", get_keyval_string(d));
|
||||
snprintf(str, maxlen, "%s", get_keyval_string(d));
|
||||
break;
|
||||
case (int) 'c':
|
||||
c = va_arg(list, MPI_Count);
|
||||
MPIR_Assert(sizeof(long long) >= sizeof(MPI_Count));
|
||||
MPL_snprintf(str, maxlen, "%lld", (long long) c);
|
||||
snprintf(str, maxlen, "%lld", (long long) c);
|
||||
break;
|
||||
default:
|
||||
/* Error: unhandled output type */
|
||||
@@ -2138,7 +2137,7 @@ static int ErrGetInstanceString(int errorcode, char msg[], int num_remaining)
|
||||
if (ErrorRing[ring_idx].id == ring_id) {
|
||||
/* just keep clobbering old values until the
|
||||
* end of the stack is reached */
|
||||
MPL_snprintf(msg, num_remaining, ", %s", ErrorRing[ring_idx].msg);
|
||||
snprintf(msg, num_remaining, ", %s", ErrorRing[ring_idx].msg);
|
||||
msg[num_remaining - 1] = '\0';
|
||||
errorcode = ErrorRing[ring_idx].prev_error;
|
||||
} else {
|
||||
|
||||
@@ -344,13 +344,13 @@ int MPIR_Abort_impl(MPIR_Comm * comm_ptr, int errorcode)
|
||||
int len = MPI_MAX_OBJECT_NAME;
|
||||
MPIR_Comm_get_name_impl(comm_ptr, comm_name, &len);
|
||||
if (len == 0) {
|
||||
MPL_snprintf(comm_name, MPI_MAX_OBJECT_NAME, "comm=0x%X", comm_ptr->handle);
|
||||
snprintf(comm_name, MPI_MAX_OBJECT_NAME, "comm=0x%X", comm_ptr->handle);
|
||||
}
|
||||
if (!MPIR_CVAR_SUPPRESS_ABORT_MESSAGE)
|
||||
/* FIXME: This is not internationalized */
|
||||
MPL_snprintf(abort_str, sizeof(abort_str),
|
||||
"application called MPI_Abort(%s, %d) - process %d", comm_name, errorcode,
|
||||
comm_ptr->rank);
|
||||
snprintf(abort_str, sizeof(abort_str),
|
||||
"application called MPI_Abort(%s, %d) - process %d", comm_name, errorcode,
|
||||
comm_ptr->rank);
|
||||
mpi_errno = MPID_Abort(comm_ptr, mpi_errno, errorcode, abort_str);
|
||||
|
||||
return mpi_errno;
|
||||
|
||||
+15
-15
@@ -25,22 +25,22 @@ const char MPII_Version_custom[] = MPICH_CUSTOM_STRING;
|
||||
int MPIR_Get_library_version_impl(char *version, int *resultlen)
|
||||
{
|
||||
int printed_len;
|
||||
printed_len = MPL_snprintf(version, MPI_MAX_LIBRARY_VERSION_STRING,
|
||||
"MPICH Version: %s\n"
|
||||
"MPICH Release date: %s\n"
|
||||
"MPICH ABI: %s\n"
|
||||
"MPICH Device: %s\n"
|
||||
"MPICH configure: %s\n"
|
||||
"MPICH CC: %s\n"
|
||||
"MPICH CXX: %s\n"
|
||||
"MPICH F77: %s\n"
|
||||
"MPICH FC: %s\n",
|
||||
MPII_Version_string, MPII_Version_date, MPII_Version_ABI,
|
||||
MPII_Version_device, MPII_Version_configure, MPII_Version_CC,
|
||||
MPII_Version_CXX, MPII_Version_F77, MPII_Version_FC);
|
||||
printed_len = snprintf(version, MPI_MAX_LIBRARY_VERSION_STRING,
|
||||
"MPICH Version: %s\n"
|
||||
"MPICH Release date: %s\n"
|
||||
"MPICH ABI: %s\n"
|
||||
"MPICH Device: %s\n"
|
||||
"MPICH configure: %s\n"
|
||||
"MPICH CC: %s\n"
|
||||
"MPICH CXX: %s\n"
|
||||
"MPICH F77: %s\n"
|
||||
"MPICH FC: %s\n",
|
||||
MPII_Version_string, MPII_Version_date, MPII_Version_ABI,
|
||||
MPII_Version_device, MPII_Version_configure, MPII_Version_CC,
|
||||
MPII_Version_CXX, MPII_Version_F77, MPII_Version_FC);
|
||||
if (strlen(MPII_Version_custom) > 0)
|
||||
MPL_snprintf(version + printed_len, MPI_MAX_LIBRARY_VERSION_STRING - printed_len,
|
||||
"MPICH Custom Information:\t%s\n", MPII_Version_custom);
|
||||
snprintf(version + printed_len, MPI_MAX_LIBRARY_VERSION_STRING - printed_len,
|
||||
"MPICH Custom Information:\t%s\n", MPII_Version_custom);
|
||||
|
||||
*resultlen = (int) strlen(version);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void ADIOI_GPFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
|
||||
/* number of processes that perform I/O in collective I/O */
|
||||
MPI_Comm_size(fd->comm, &nprocs);
|
||||
nprocs_is_valid = 1;
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
ADIOI_Info_set(info, "cb_nodes", value);
|
||||
#ifdef BGQPLATFORM
|
||||
fd->hints->cb_nodes = -1;
|
||||
|
||||
@@ -680,7 +680,7 @@ static void ADIOI_Read_and_exch(ADIO_File fd, void *buf, MPI_Datatype
|
||||
#endif
|
||||
if (flag) {
|
||||
char round[50];
|
||||
MPL_snprintf(round, sizeof(round), "two-phase-round=%d", m);
|
||||
snprintf(round, sizeof(round), "two-phase-round=%d", m);
|
||||
setenv("LIBIOLOG_EXTRA_INFO", round, 1);
|
||||
ADIOI_Assert(size == (int) size);
|
||||
ADIO_ReadContig(fd, read_buf + for_curr_iter, (int) size, MPI_BYTE,
|
||||
|
||||
@@ -858,7 +858,7 @@ static void ADIOI_Exch_and_write(ADIO_File fd, const void *buf, MPI_Datatype
|
||||
|
||||
if (flag) {
|
||||
char round[50];
|
||||
MPL_snprintf(round, sizeof(round), "two-phase-round=%d", m);
|
||||
snprintf(round, sizeof(round), "two-phase-round=%d", m);
|
||||
setenv("LIBIOLOG_EXTRA_INFO", round, 1);
|
||||
ADIOI_Assert(size == (int) size);
|
||||
if (gpfsmpio_pthreadio == 1) {
|
||||
|
||||
@@ -106,8 +106,8 @@ void ADIOI_LUSTRE_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
|
||||
* value in fd unless it was in user_info, but knowing
|
||||
* the value - default or explicit - is useful.
|
||||
* Set the final number of extents in the fd->info */
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d",
|
||||
fd->hints->fs_hints.lustre.lock_ahead_num_extents);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d",
|
||||
fd->hints->fs_hints.lustre.lock_ahead_num_extents);
|
||||
ADIOI_Info_set(fd->info, "romio_lustre_cb_lock_ahead_num_extents", value);
|
||||
|
||||
/* Get user's flags */
|
||||
|
||||
@@ -128,15 +128,15 @@ void ADIOI_LUSTRE_Open(ADIO_File fd, int *error_code)
|
||||
if (!err) {
|
||||
|
||||
fd->hints->striping_unit = lum->lmm_stripe_size;
|
||||
MPL_snprintf(value, value_sz, "%d", lum->lmm_stripe_size);
|
||||
snprintf(value, value_sz, "%d", lum->lmm_stripe_size);
|
||||
ADIOI_Info_set(fd->info, "striping_unit", value);
|
||||
|
||||
fd->hints->striping_factor = lum->lmm_stripe_count;
|
||||
MPL_snprintf(value, value_sz, "%d", lum->lmm_stripe_count);
|
||||
snprintf(value, value_sz, "%d", lum->lmm_stripe_count);
|
||||
ADIOI_Info_set(fd->info, "striping_factor", value);
|
||||
|
||||
fd->hints->start_iodevice = lum->lmm_stripe_offset;
|
||||
MPL_snprintf(value, value_sz, "%d", lum->lmm_stripe_offset);
|
||||
snprintf(value, value_sz, "%d", lum->lmm_stripe_offset);
|
||||
ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
|
||||
|
||||
}
|
||||
|
||||
@@ -283,48 +283,47 @@ void ADIOI_PANFS_Open(ADIO_File fd, int *error_code)
|
||||
/* Error - set layout type to unknown */
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
|
||||
} else {
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
|
||||
if (file_query_args.layout.layout_is_valid == 1) {
|
||||
switch (file_query_args.layout.agg_type) {
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAID0:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid0.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid0.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid0.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid0.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.parity_stripe_width);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.parity_stripe_width);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.parity_stripe_depth);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.parity_stripe_depth);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.layout_visit_policy);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.layout_visit_policy);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.layout_visit_policy);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.layout_visit_policy);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID:
|
||||
|
||||
@@ -349,62 +349,59 @@ void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code)
|
||||
/* Error - set layout type to unknown */
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_type", "PAN_FS_CLIENT_LAYOUT_TYPE__INVALID");
|
||||
} else {
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u", file_query_args.layout.agg_type);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_type", temp_buffer);
|
||||
if (file_query_args.layout.layout_is_valid == 1) {
|
||||
switch (file_query_args.layout.agg_type) {
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAIDN_PARITY_STRIPE:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.
|
||||
parity_stripe_width);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.parity_stripe_width);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.
|
||||
parity_stripe_depth);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.parity_stripe_depth);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.max_faults);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.max_faults);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_max_faults", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.encoding);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raidn_parity_stripe.encoding);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_encoding", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAID1_5_PARITY_STRIPE:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
parity_stripe_width);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
parity_stripe_width);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_width", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
parity_stripe_depth);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
parity_stripe_depth);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_parity_stripe_depth", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.
|
||||
raid1_5_parity_stripe.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
layout_visit_policy);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid1_5_parity_stripe.
|
||||
layout_visit_policy);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__RAID10:
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.stripe_unit);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.stripe_unit);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_stripe_unit", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.total_num_comps);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.total_num_comps);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_total_num_comps", temp_buffer);
|
||||
MPL_snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.layout_visit_policy);
|
||||
snprintf(temp_buffer, TEMP_BUFFER_SIZE, "%u",
|
||||
file_query_args.layout.u.raid10.layout_visit_policy);
|
||||
ADIOI_Info_set(fd->info, "panfs_layout_visit_policy", temp_buffer);
|
||||
break;
|
||||
case PAN_FS_CLIENT_LAYOUT_TYPE__INVALID:
|
||||
|
||||
@@ -178,7 +178,7 @@ void ADIOI_Calc_file_realms_aar(ADIO_File fd, int nprocs_for_coll, int cb_pfr,
|
||||
#endif
|
||||
}
|
||||
if (fd->hints->cb_pfr == ADIOI_HINT_ENABLE) {
|
||||
MPL_snprintf(value, sizeof(value), "%d", fr_size);
|
||||
snprintf(value, sizeof(value), "%d", fr_size);
|
||||
ADIOI_Info_set(fd->info, "romio_cb_fr_type", value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
|
||||
fd->hints->cb_config_list = NULL;
|
||||
|
||||
/* number of processes that perform I/O in collective I/O */
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
ADIOI_Info_set(info, "cb_nodes", value);
|
||||
fd->hints->cb_nodes = nprocs;
|
||||
|
||||
@@ -230,7 +230,7 @@ void ADIOI_GEN_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code)
|
||||
/* can't ask for more aggregators than mpi processes, though it
|
||||
* might be interesting to think what such oversubscription
|
||||
* might mean... someday */
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", nprocs);
|
||||
ADIOI_Info_set(info, "cb_nodes", value);
|
||||
fd->hints->cb_nodes = nprocs;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ static int build_cb_config_list(ADIO_File fd,
|
||||
fd->hints->cb_nodes = rank_ct;
|
||||
/* TEMPORARY -- REMOVE WHEN NO LONGER UPDATING INFO FOR FS-INDEP. */
|
||||
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", rank_ct);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", rank_ct);
|
||||
ADIOI_Info_set(fd->info, "cb_nodes", value);
|
||||
ADIOI_Free(value);
|
||||
}
|
||||
|
||||
@@ -123,13 +123,13 @@ void ADIOI_GEN_OpenColl(ADIO_File fd, int rank, int access_mode, int *error_code
|
||||
* info object about the file configuration. deferred open,
|
||||
* though, skips that step for non-aggregators. we do the
|
||||
* info-setting here */
|
||||
MPL_snprintf(value, sizeof(value), "%d", fd->hints->striping_unit);
|
||||
snprintf(value, sizeof(value), "%d", fd->hints->striping_unit);
|
||||
ADIOI_Info_set(fd->info, "striping_unit", value);
|
||||
|
||||
MPL_snprintf(value, sizeof(value), "%d", fd->hints->striping_factor);
|
||||
snprintf(value, sizeof(value), "%d", fd->hints->striping_factor);
|
||||
ADIOI_Info_set(fd->info, "striping_factor", value);
|
||||
|
||||
MPL_snprintf(value, sizeof(value), "%d", fd->hints->start_iodevice);
|
||||
snprintf(value, sizeof(value), "%d", fd->hints->start_iodevice);
|
||||
ADIOI_Info_set(fd->info, "romio_lustre_start_iodevice", value);
|
||||
|
||||
*error_code = MPI_SUCCESS;
|
||||
|
||||
@@ -82,7 +82,7 @@ int ADIOI_cb_bcast_rank_map(ADIO_File fd)
|
||||
/* TEMPORARY -- REMOVE WHEN NO LONGER UPDATING INFO FOR
|
||||
* FS-INDEP. */
|
||||
value = (char *) ADIOI_Malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char));
|
||||
MPL_snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", fd->hints->cb_nodes);
|
||||
snprintf(value, MPI_MAX_INFO_VAL + 1, "%d", fd->hints->cb_nodes);
|
||||
ADIOI_Info_set(fd->info, "cb_nodes", value);
|
||||
p = value;
|
||||
/* the (by MPI rank) list of aggregators can be larger than
|
||||
@@ -91,7 +91,7 @@ int ADIOI_cb_bcast_rank_map(ADIO_File fd)
|
||||
* end in the truncate case */
|
||||
for (i = 0; i < fd->hints->cb_nodes; i++) {
|
||||
int incr, remain = (MPI_MAX_INFO_VAL) - (p - value);
|
||||
incr = MPL_snprintf(p, remain, "%d ", fd->hints->ranklist[i]);
|
||||
incr = snprintf(p, remain, "%d ", fd->hints->ranklist[i]);
|
||||
if (incr >= remain)
|
||||
break;
|
||||
p += incr;
|
||||
|
||||
@@ -25,9 +25,9 @@ int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[],
|
||||
|
||||
buf = (char *) ADIOI_Malloc(1024);
|
||||
if (buf != NULL) {
|
||||
idx += MPL_snprintf(buf, 1023, "%s (line %d): ", fcname, line);
|
||||
idx += snprintf(buf, 1023, "%s (line %d): ", fcname, line);
|
||||
if (specific_msg == NULL) {
|
||||
MPL_snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg);
|
||||
snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg);
|
||||
} else {
|
||||
va_start(Argp, specific_msg);
|
||||
vsnprintf(&buf[idx], 1023 - idx, specific_msg, Argp);
|
||||
|
||||
@@ -72,7 +72,7 @@ int MPIO_Err_return_file(MPI_File mpi_fh, int error_code)
|
||||
if (MPIR_Err_is_fatal(error_code) || kind == 0) {
|
||||
ADIO_File fh = MPIO_File_resolve(mpi_fh);
|
||||
|
||||
MPL_snprintf(error_msg, 4096, "I/O error: ");
|
||||
snprintf(error_msg, 4096, "I/O error: ");
|
||||
len = (int) strlen(error_msg);
|
||||
MPIR_Err_get_string(error_code, &error_msg[len], 4096 - len, NULL);
|
||||
MPIR_Abort(fh->comm, MPI_SUCCESS, error_code, error_msg);
|
||||
|
||||
@@ -25,9 +25,9 @@ int MPIO_Err_create_code(int lastcode, int fatal, const char fcname[],
|
||||
|
||||
buf = (char *) ADIOI_Malloc(1024);
|
||||
if (buf != NULL) {
|
||||
idx += MPL_snprintf(buf, 1023, "%s (line %d): ", fcname, line);
|
||||
idx += snprintf(buf, 1023, "%s (line %d): ", fcname, line);
|
||||
if (specific_msg == NULL) {
|
||||
MPL_snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg);
|
||||
snprintf(&buf[idx], 1023 - idx, "%s\n", generic_msg);
|
||||
} else {
|
||||
va_start(Argp, specific_msg);
|
||||
vsnprintf(&buf[idx], 1023 - idx, specific_msg, Argp);
|
||||
|
||||
@@ -54,7 +54,7 @@ static int comm_split_filesystem_exhaustive(MPI_Comm comm, int key,
|
||||
ret = mkdir(testdirname, S_IRWXU);
|
||||
if (ret == -1 && errno != EEXIST)
|
||||
goto fn_fail;
|
||||
MPL_snprintf(filename, PATH_MAX, "%s/%d", testdirname, rank);
|
||||
snprintf(filename, PATH_MAX, "%s/%d", testdirname, rank);
|
||||
open(filename, O_CREAT, S_IRUSR | S_IWUSR);
|
||||
|
||||
MPI_Barrier(comm);
|
||||
|
||||
@@ -329,7 +329,7 @@ static int GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname, MPL_soc
|
||||
* environment to each process. There's no way to do this with
|
||||
* the param interface, so we need to use getenv() here. */
|
||||
char namebuf[1024];
|
||||
MPL_snprintf(namebuf, sizeof(namebuf), "MPICH_INTERFACE_HOSTNAME_R%d", myRank);
|
||||
snprintf(namebuf, sizeof(namebuf), "MPICH_INTERFACE_HOSTNAME_R%d", myRank);
|
||||
ifname_string = getenv(namebuf);
|
||||
|
||||
if (DBG_IFNAME && ifname_string) {
|
||||
|
||||
@@ -242,7 +242,7 @@ static int restore_env(pid_t parent_pid, int rank)
|
||||
int ret;
|
||||
char strerrbuf[MPIR_STRERROR_BUF_SIZE];
|
||||
|
||||
MPL_snprintf(env_filename, MAX_STR_LEN, "/tmp/hydra-env-file-%d:%d", parent_pid, rank);
|
||||
snprintf(env_filename, MAX_STR_LEN, "/tmp/hydra-env-file-%d:%d", parent_pid, rank);
|
||||
|
||||
f = fopen(env_filename, "r");
|
||||
CHECK_ERR(!f, MPIR_Strerror(errno, strerrbuf, MPIR_STRERROR_BUF_SIZE));
|
||||
|
||||
@@ -2816,7 +2816,7 @@ int MPIDI_CH3I_Sock_get_host_description(int myRank, char *host_description, int
|
||||
* the process manager only delievers the same values for the
|
||||
* environment to each process */
|
||||
char namebuf[1024];
|
||||
MPL_snprintf(namebuf, sizeof(namebuf), "MPICH_INTERFACE_HOSTNAME_R_%d", myRank);
|
||||
snprintf(namebuf, sizeof(namebuf), "MPICH_INTERFACE_HOSTNAME_R_%d", myRank);
|
||||
env_hostname = getenv(namebuf);
|
||||
}
|
||||
|
||||
@@ -3069,7 +3069,7 @@ int MPIDI_CH3I_Sock_get_error_class_string(int error, char *error_string, size_t
|
||||
MPL_strncpy(error_string, "no new connection available", length);
|
||||
break;
|
||||
default:
|
||||
MPL_snprintf(error_string, length, "unknown socket error %d", error);
|
||||
snprintf(error_string, length, "unknown socket error %d", error);
|
||||
break;
|
||||
}
|
||||
MPIR_FUNC_EXIT;
|
||||
|
||||
@@ -84,7 +84,7 @@ int MPIDI_CH3I_Comm_init(void)
|
||||
int size = strlen("HCOLL_BCOL=") + strlen(MPID_CH3I_CH_HCOLL_BCOL) + 1;
|
||||
|
||||
MPIR_CHKLMEM_MALLOC(envstr, char *, size, mpi_errno, "**malloc", MPL_MEM_COMM);
|
||||
MPL_snprintf(envstr, size, "HCOLL_BCOL=%s", MPID_CH3I_CH_HCOLL_BCOL);
|
||||
snprintf(envstr, size, "HCOLL_BCOL=%s", MPID_CH3I_CH_HCOLL_BCOL);
|
||||
|
||||
r = MPL_putenv(envstr);
|
||||
MPIR_ERR_CHKANDJUMP(r, mpi_errno, MPI_ERR_OTHER, "**putenv");
|
||||
|
||||
@@ -791,7 +791,7 @@ int MPIDI_CH3_PktPrint_EagerShortSend( FILE *fp, MPIDI_CH3_Pkt_t *pkt )
|
||||
int i;
|
||||
if (datalen > 32) datalen = 32;
|
||||
for (i=0; i<datalen; i++) {
|
||||
MPL_snprintf( &databytes[2*i], 64 - 2*i, "%2x", p[i] );
|
||||
snprintf( &databytes[2*i], 64 - 2*i, "%2x", p[i] );
|
||||
}
|
||||
MPL_DBG_MSG_S(MPIDI_CH3_DBG_OTHER,TERSE," data ......... %s\n", databytes);
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ static char *tag_val_to_str(int tag, char *out, int max)
|
||||
MPL_strncpy(out, "MPI_ANY_TAG", max);
|
||||
}
|
||||
else {
|
||||
MPL_snprintf(out, max, "%d", tag);
|
||||
snprintf(out, max, "%d", tag);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -1129,7 +1129,7 @@ static char *rank_val_to_str(int rank, char *out, int max)
|
||||
MPL_strncpy(out, "MPI_ANY_SOURCE", max);
|
||||
}
|
||||
else {
|
||||
MPL_snprintf(out, max, "%d", rank);
|
||||
snprintf(out, max, "%d", rank);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ int MPID_Abort(MPIR_Comm * comm, int mpi_errno, int exit_code,
|
||||
{
|
||||
MPIR_Err_get_string(mpi_errno, msg, MPI_MAX_ERROR_STRING, NULL);
|
||||
/* FIXME: Not internationalized */
|
||||
MPL_snprintf(error_str, sizeof(error_str), "internal ABORT - process %d: %s", rank, msg);
|
||||
snprintf(error_str, sizeof(error_str), "internal ABORT - process %d: %s", rank, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME: Not internationalized */
|
||||
MPL_snprintf(error_str, sizeof(error_str), "internal ABORT - process %d", rank);
|
||||
snprintf(error_str, sizeof(error_str), "internal ABORT - process %d", rank);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ static inline void setupProcessorName( void )
|
||||
static inline void setupProcessorName( void )
|
||||
{
|
||||
/* Set the name as the rank of the process */
|
||||
MPL_snprintf( processorName, MPI_MAX_PROCESSOR_NAME, "%d",
|
||||
snprintf( processorName, MPI_MAX_PROCESSOR_NAME, "%d",
|
||||
MPIDI_Process.my_pg_rank );
|
||||
processorNameLen = (int)strlen( processorName );
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ int MPIDI_PG_SetConnInfo( int rank, const char *connString )
|
||||
|
||||
int len;
|
||||
char key[40];
|
||||
len = MPL_snprintf(key, sizeof(key), "P%d-businesscard", rank);
|
||||
len = snprintf(key, sizeof(key), "P%d-businesscard", rank);
|
||||
MPIR_ERR_CHKANDJUMP1(len < 0 || len > sizeof(key), mpi_errno, MPI_ERR_OTHER, "**snprintf", "**snprintf %d", len);
|
||||
|
||||
mpi_errno = MPIR_pmi_kvs_put(key, connString);
|
||||
@@ -552,7 +552,7 @@ static int getConnInfoKVS( int rank, char *buf, int bufsize, MPIDI_PG_t *pg )
|
||||
|
||||
int len;
|
||||
char key[40];
|
||||
len = MPL_snprintf(key, sizeof(key), "P%d-businesscard", rank);
|
||||
len = snprintf(key, sizeof(key), "P%d-businesscard", rank);
|
||||
MPIR_ERR_CHKANDJUMP1(len < 0 || len > sizeof(key), mpi_errno, MPI_ERR_OTHER, "**snprintf", "**snprintf %d", len);
|
||||
|
||||
mpi_errno = MPIR_pmi_kvs_get(rank, key, buf, bufsize);
|
||||
@@ -587,7 +587,7 @@ static int connToStringKVS( char **buf_p, int *slen, MPIDI_PG_t *pg )
|
||||
string[len++] = 0;
|
||||
|
||||
/* Add the size of the pg */
|
||||
MPL_snprintf( &string[len], curSlen - len, "%d", pg->size );
|
||||
snprintf( &string[len], curSlen - len, "%d", pg->size );
|
||||
while (string[len]) len++;
|
||||
len++;
|
||||
|
||||
@@ -729,7 +729,7 @@ static int connToString( char **buf_p, int *slen, MPIDI_PG_t *pg )
|
||||
while (*pg_id) str[len++] = *pg_id++;
|
||||
str[len++] = 0;
|
||||
|
||||
MPL_snprintf( &str[len], 20, "%d", pg->size);
|
||||
snprintf( &str[len], 20, "%d", pg->size);
|
||||
/* Skip over the length */
|
||||
while (str[len++]);
|
||||
|
||||
|
||||
@@ -210,14 +210,14 @@ const char *MPIDI_Pkt_GetDescString(MPIDI_CH3_Pkt_t * pkt)
|
||||
/* For data messages, the string (...) is (context,tag,rank,size) */
|
||||
switch (pkt->type) {
|
||||
case MPIDI_CH3_PKT_EAGER_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"EAGER_SEND - (%d,%d,%d,)%" PRIdPTR,
|
||||
pkt->eager_send.match.parts.context_id,
|
||||
(int) pkt->eager_send.match.parts.tag,
|
||||
pkt->eager_send.match.parts.rank, pkt->eager_send.data_sz);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_EAGER_SYNC_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"EAGER_SYNC_SEND - (%d,%d,%d,)%" PRIdPTR " req=%d",
|
||||
pkt->eager_sync_send.match.parts.context_id,
|
||||
(int) pkt->eager_sync_send.match.parts.tag,
|
||||
@@ -225,18 +225,18 @@ const char *MPIDI_Pkt_GetDescString(MPIDI_CH3_Pkt_t * pkt)
|
||||
pkt->eager_sync_send.data_sz, pkt->eager_sync_send.sender_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_EAGER_SYNC_ACK:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"EAGER_SYNC_ACK - req=%d", pkt->eager_sync_ack.sender_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_READY_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"READY_SEND - (%d,%d,%d,)%" PRIdPTR,
|
||||
pkt->ready_send.match.parts.context_id,
|
||||
(int) pkt->ready_send.match.parts.tag,
|
||||
pkt->ready_send.match.parts.rank, pkt->ready_send.data_sz);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_RNDV_REQ_TO_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"RNDV_REQ_TO_SEND - (%d,%d,%d,)%" PRIdPTR " req=%d",
|
||||
pkt->rndv_req_to_send.match.parts.context_id,
|
||||
(int) pkt->rndv_req_to_send.match.parts.tag,
|
||||
@@ -244,61 +244,61 @@ const char *MPIDI_Pkt_GetDescString(MPIDI_CH3_Pkt_t * pkt)
|
||||
pkt->rndv_req_to_send.data_sz, pkt->rndv_req_to_send.sender_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_RNDV_CLR_TO_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"RNDV_CLRTO_SEND - req=%d, recv req=%d",
|
||||
pkt->rndv_clr_to_send.sender_req_id, pkt->rndv_clr_to_send.receiver_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_RNDV_SEND:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"RNDV_SEND - recv req=%d", pkt->rndv_send.receiver_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_CANCEL_SEND_REQ:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"CANCEL_SEND_REQ - req=%d", pkt->cancel_send_req.sender_req_id);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_CANCEL_SEND_RESP:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"CANCEL_SEND_RESP - req=%d ack=%d",
|
||||
pkt->cancel_send_resp.sender_req_id, pkt->cancel_send_resp.ack);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_PUT:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"PUT - (%p,%d,0x%08X)",
|
||||
pkt->put.addr, pkt->put.count, pkt->put.target_win_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_GET:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"GET - (%p,%d,0x%08X) req=%d",
|
||||
pkt->get.addr,
|
||||
pkt->get.count, pkt->get.target_win_handle, pkt->get.request_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_GET_RESP:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "GET_RESP - req=%d", pkt->get_resp.request_handle);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "GET_RESP - req=%d", pkt->get_resp.request_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_ACCUMULATE:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg),
|
||||
snprintf(pktmsg, sizeof(pktmsg),
|
||||
"ACCUMULATE - (%p,%d,0x%08X)",
|
||||
pkt->accum.addr, pkt->accum.count, pkt->accum.target_win_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_LOCK:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "LOCK - %d", pkt->lock.target_win_handle);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "LOCK - %d", pkt->lock.target_win_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_ACK:
|
||||
/* There is no rma_done packet type */
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "RMA_DONE - 0x%08X", pkt->ack.source_win_handle);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "RMA_DONE - 0x%08X", pkt->ack.source_win_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_LOCK_ACK:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "LOCK_ACK - 0x%08X", pkt->lock_ack.source_win_handle);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "LOCK_ACK - 0x%08X", pkt->lock_ack.source_win_handle);
|
||||
break;
|
||||
case MPIDI_CH3_PKT_FLOW_CNTL_UPDATE:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "FLOW_CNTL_UPDATE");
|
||||
snprintf(pktmsg, sizeof(pktmsg), "FLOW_CNTL_UPDATE");
|
||||
break;
|
||||
case MPIDI_CH3_PKT_CLOSE:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "CLOSE ack=%d", pkt->close.ack);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "CLOSE ack=%d", pkt->close.ack);
|
||||
break;
|
||||
|
||||
default:
|
||||
MPL_snprintf(pktmsg, sizeof(pktmsg), "INVALID PACKET type=%d", pkt->type);
|
||||
snprintf(pktmsg, sizeof(pktmsg), "INVALID PACKET type=%d", pkt->type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ int MPIDI_CH3U_Get_business_card_sock(int myRank,
|
||||
info = gethostbyname( ifname );
|
||||
if (info && info->h_addr_list) {
|
||||
p = (unsigned char *)(info->h_addr_list[0]);
|
||||
MPL_snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u",
|
||||
snprintf( ifname, sizeof(ifname), "%u.%u.%u.%u",
|
||||
p[0], p[1], p[2], p[3] );
|
||||
MPL_DBG_MSG_S(MPIDI_CH3_DBG_CONNECT,VERBOSE,"ifname = %s",ifname );
|
||||
str_errno = MPL_str_add_string_arg( bc_val_p,
|
||||
@@ -1239,7 +1239,7 @@ const char * MPIDI_CH3_VC_SockGetStateString( struct MPIDI_VC *vc )
|
||||
case MPIDI_CH3I_VC_STATE_CONNECTED: name = "CH3I_VC_STATE_CONNECTED"; break;
|
||||
case MPIDI_CH3I_VC_STATE_FAILED: name = "CH3I_VC_STATE_FAILED"; break;
|
||||
default:
|
||||
MPL_snprintf( asdigits, sizeof(asdigits), "%d", state );
|
||||
snprintf( asdigits, sizeof(asdigits), "%d", state );
|
||||
asdigits[20-1] = 0;
|
||||
name = (const char *)asdigits;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ int MPIDU_CH3U_GetSockInterfaceAddr(int myRank, char *ifname, int maxIfname,
|
||||
the process manager only delievers the same values for the
|
||||
environment to each process */
|
||||
char namebuf[1024];
|
||||
MPL_snprintf( namebuf, sizeof(namebuf),
|
||||
snprintf( namebuf, sizeof(namebuf),
|
||||
"MPICH_INTERFACE_HOSTNAME_R%d", myRank );
|
||||
ifname_string = getenv( namebuf );
|
||||
if (dbg_ifname && ifname_string) {
|
||||
|
||||
@@ -1304,7 +1304,7 @@ static int try_open_shared_av(struct fid_domain *domain, struct fid_av **p_av, i
|
||||
av_attr.count = MPIR_Process.size;
|
||||
|
||||
char av_name[128];
|
||||
MPL_snprintf(av_name, sizeof(av_name), "FI_NAMED_AV_%d\n", MPIR_Process.appnum);
|
||||
snprintf(av_name, sizeof(av_name), "FI_NAMED_AV_%d\n", MPIR_Process.appnum);
|
||||
av_attr.name = av_name;
|
||||
av_attr.flags = FI_READ;
|
||||
av_attr.map_addr = 0;
|
||||
|
||||
@@ -68,9 +68,9 @@ static int MPIDI_IPC_mpi_fd_cleanup(void)
|
||||
}
|
||||
|
||||
if (MPIDI_IPCI_global_fd_pids[MPIR_Process.local_rank] != 0 && MPIR_Process.local_rank != i) {
|
||||
MPL_snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d",
|
||||
MPIDI_IPCI_global_fd_pids[MPIR_Process.local_rank],
|
||||
MPIR_Process.local_rank, i);
|
||||
snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d",
|
||||
MPIDI_IPCI_global_fd_pids[MPIR_Process.local_rank],
|
||||
MPIR_Process.local_rank, i);
|
||||
sock_err = unlink(sock_name);
|
||||
MPIR_ERR_CHKANDJUMP2(sock_err == -1, mpi_errno, MPI_ERR_OTHER, "**sock_unlink",
|
||||
"**sock_unlink %s %d",
|
||||
@@ -179,8 +179,8 @@ int MPIDI_IPC_mpi_socks_init(void)
|
||||
int sock;
|
||||
|
||||
/* Create the local socket name */
|
||||
MPL_snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d", pid,
|
||||
MPIR_Process.local_rank, j);
|
||||
snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d", pid,
|
||||
MPIR_Process.local_rank, j);
|
||||
|
||||
/* Create a socket for local rank i */
|
||||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
@@ -213,12 +213,12 @@ int MPIDI_IPC_mpi_socks_init(void)
|
||||
struct sockaddr_un remote_sockaddr;
|
||||
|
||||
/* Create the remote socket name */
|
||||
MPL_snprintf(remote_sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d",
|
||||
MPIDI_IPCI_global_fd_pids[i], i, MPIR_Process.local_rank);
|
||||
snprintf(remote_sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d",
|
||||
MPIDI_IPCI_global_fd_pids[i], i, MPIR_Process.local_rank);
|
||||
|
||||
/* Create the local socket name */
|
||||
MPL_snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d", pid,
|
||||
MPIR_Process.local_rank, i);
|
||||
snprintf(sock_name, SOCK_MAX_STR_LEN, "/tmp/mpich-ipc-fd-sock-%d:%d-%d", pid,
|
||||
MPIR_Process.local_rank, i);
|
||||
|
||||
/* Create a socket for local rank j */
|
||||
MPIDI_IPCI_global_fd_socks[i] = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
|
||||
@@ -105,8 +105,8 @@ int MPID_Abort(MPIR_Comm * comm, int mpi_errno, int exit_code, const char *error
|
||||
}
|
||||
|
||||
char error_str[3 * MPI_MAX_ERROR_STRING + 128];
|
||||
MPL_snprintf(error_str, sizeof(error_str), "Abort(%d)%s%s: %s%s\n",
|
||||
exit_code, world_str, comm_str, error_msg, sys_str);
|
||||
snprintf(error_str, sizeof(error_str), "Abort(%d)%s%s: %s%s\n",
|
||||
exit_code, world_str, comm_str, error_msg, sys_str);
|
||||
MPL_error_printf("%s", error_str);
|
||||
|
||||
#ifdef HAVE_DEBUGGER_SUPPORT
|
||||
|
||||
@@ -725,7 +725,7 @@ int MPID_Get_processor_name(char *name, int namelen, int *resultlen)
|
||||
MPIDI_global.pname_len = (int) strlen(MPIDI_global.pname);
|
||||
|
||||
#else
|
||||
MPL_snprintf(MPIDI_global.pname, MPI_MAX_PROCESSOR_NAME, "%d", MPIR_Process.rank);
|
||||
snprintf(MPIDI_global.pname, MPI_MAX_PROCESSOR_NAME, "%d", MPIR_Process.rank);
|
||||
MPIDI_global.pname_len = (int) strlen(MPIDI_global.pname);
|
||||
#endif
|
||||
MPIDI_global.pname_set = 1;
|
||||
|
||||
@@ -1364,7 +1364,7 @@ static int win_ctrl_handler(int handler_id, void *am_hdr, void *data, MPI_Aint i
|
||||
break;
|
||||
|
||||
default:
|
||||
MPL_snprintf(buff, sizeof(buff), "Invalid message type: %d\n", handler_id);
|
||||
snprintf(buff, sizeof(buff), "Invalid message type: %d\n", handler_id);
|
||||
MPID_Abort(NULL, MPI_ERR_INTERN, 1, buff);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ int MPID_NS_Publish(MPID_NS_Handle handle, const MPIR_Info * info_ptr,
|
||||
case ENOMEM:
|
||||
reason "Insufficient kernel memory available";
|
||||
default:
|
||||
MPL_snprintf(rstr, sizeof(rstr), "errno = %d", errno);
|
||||
snprintf(rstr, sizeof(rstr), "errno = %d", errno);
|
||||
}
|
||||
#endif
|
||||
err = MPIR_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE, __func__, __LINE__,
|
||||
|
||||
@@ -307,14 +307,14 @@ int mypreamble(void *data, ProcessState * pState)
|
||||
/* Create the string of ranks. These are ranks in comm_world */
|
||||
ranks[0] = 0;
|
||||
for (i = 0; i < size; i++) {
|
||||
MPL_snprintf(digits, sizeof(digits), "%d,", i);
|
||||
snprintf(digits, sizeof(digits), "%d,", i);
|
||||
MPL_strnapp(ranks, digits, sizeof(ranks));
|
||||
}
|
||||
/* Remove the trailing comma */
|
||||
if (size > 0)
|
||||
ranks[strlen(ranks) - 1] = 0;
|
||||
/* Add this to the predefined keys */
|
||||
MPL_snprintf(key, sizeof(key), "pmiPrivateLocalRanks_%d", pState->wRank);
|
||||
snprintf(key, sizeof(key), "pmiPrivateLocalRanks_%d", pState->wRank);
|
||||
/* printf("%s = %s\n", key, ranks); */
|
||||
|
||||
pmix_preput(key, ranks);
|
||||
|
||||
@@ -129,8 +129,8 @@ HYD_status HYD_pmcd_pmi_add_kvs(const char *key, const char *val, struct HYD_pmc
|
||||
|
||||
HYDU_MALLOC_OR_JUMP(key_pair, struct HYD_pmcd_pmi_kvs_pair *,
|
||||
sizeof(struct HYD_pmcd_pmi_kvs_pair), status);
|
||||
MPL_snprintf(key_pair->key, PMI_MAXKEYLEN, "%s", key);
|
||||
MPL_snprintf(key_pair->val, PMI_MAXVALLEN, "%s", val);
|
||||
snprintf(key_pair->key, PMI_MAXKEYLEN, "%s", key);
|
||||
snprintf(key_pair->val, PMI_MAXVALLEN, "%s", val);
|
||||
key_pair->next = NULL;
|
||||
|
||||
*ret = 0;
|
||||
|
||||
@@ -50,7 +50,7 @@ static HYD_status lsf_get_path(char **path)
|
||||
if (MPL_env2str("LSF_BINDIR", (const char **) &bin_dir) && bin_dir) {
|
||||
length = strlen(bin_dir) + 2 + strlen("blaunch");
|
||||
HYDU_MALLOC_OR_JUMP(*path, char *, length, status);
|
||||
MPL_snprintf(*path, length, "%s/blaunch", bin_dir);
|
||||
snprintf(*path, length, "%s/blaunch", bin_dir);
|
||||
}
|
||||
}
|
||||
if (*path == NULL)
|
||||
@@ -79,7 +79,7 @@ static HYD_status sge_get_path(char **path)
|
||||
MPL_env2str("ARC", (const char **) &arc) && sge_root && arc) {
|
||||
length = strlen(sge_root) + strlen("/bin/") + strlen(arc) + 1 + strlen("qrsh") + 1;
|
||||
HYDU_MALLOC_OR_JUMP(*path, char *, length, status);
|
||||
MPL_snprintf(*path, length, "%s/bin/%s/qrsh", sge_root, arc);
|
||||
snprintf(*path, length, "%s/bin/%s/qrsh", sge_root, arc);
|
||||
}
|
||||
}
|
||||
if (*path == NULL)
|
||||
@@ -173,7 +173,7 @@ HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_li
|
||||
/* Create a quoted version of the exec string, which is only used
|
||||
* when the executable is not launched directly, but through an
|
||||
* actual launcher */
|
||||
MPL_snprintf(quoted_exec_string, HYD_TMP_STRLEN, "\"%s\"", targs[exec_idx]);
|
||||
snprintf(quoted_exec_string, HYD_TMP_STRLEN, "\"%s\"", targs[exec_idx]);
|
||||
|
||||
/* Increase pid list to accommodate these new pids */
|
||||
HYDT_bscu_pid_list_grow(num_hosts);
|
||||
@@ -202,7 +202,7 @@ HYD_status HYDT_bscd_common_launch_procs(char **args, struct HYD_proxy *proxy_li
|
||||
len = strlen(proxy->node->user) + strlen("@") + strlen(proxy->node->hostname) + 1;
|
||||
|
||||
HYDU_MALLOC_OR_JUMP(targs[host_idx], char *, len, status);
|
||||
MPL_snprintf(targs[host_idx], len, "%s@%s", proxy->node->user, proxy->node->hostname);
|
||||
snprintf(targs[host_idx], len, "%s@%s", proxy->node->user, proxy->node->hostname);
|
||||
}
|
||||
|
||||
/* append proxy ID */
|
||||
|
||||
@@ -67,7 +67,7 @@ HYD_status HYDT_bscd_ll_launch_procs(char **args, struct HYD_proxy *proxy_list,
|
||||
/* Create a quoted version of the exec string, which is only used
|
||||
* when the executable is not launched directly, but through an
|
||||
* actual launcher */
|
||||
MPL_snprintf(quoted_exec_string, HYD_TMP_STRLEN, "\"%s\"", targs[exec_idx]);
|
||||
snprintf(quoted_exec_string, HYD_TMP_STRLEN, "\"%s\"", targs[exec_idx]);
|
||||
MPL_free(targs[exec_idx]);
|
||||
targs[exec_idx] = quoted_exec_string;
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ static HYD_status extract_tasks_per_node(int nnodes, char *task_list)
|
||||
i = 0;
|
||||
do {
|
||||
HYDU_MALLOC_OR_JUMP(tmp_core_list[i], char *, strlen(task_set) + 1, status);
|
||||
MPL_snprintf(tmp_core_list[i], strlen(task_set) + 1, "%s", task_set);
|
||||
snprintf(tmp_core_list[i], strlen(task_set) + 1, "%s", task_set);
|
||||
i++;
|
||||
task_set = strtok(NULL, ",");
|
||||
} while (task_set);
|
||||
|
||||
@@ -21,7 +21,7 @@ HYD_status HYDU_dbg_init(const char *str)
|
||||
HYDU_ERR_SETANDJUMP(status, HYD_SOCK_ERROR, "unable to get local host name\n");
|
||||
|
||||
HYDU_MALLOC_OR_JUMP(HYD_dbg_prefix, char *, strlen(hostname) + 1 + strlen(str) + 1, status);
|
||||
MPL_snprintf(HYD_dbg_prefix, strlen(hostname) + 1 + strlen(str) + 1, "%s@%s", str, hostname);
|
||||
snprintf(HYD_dbg_prefix, strlen(hostname) + 1 + strlen(str) + 1, "%s@%s", str, hostname);
|
||||
|
||||
fn_exit:
|
||||
HYDU_FUNC_EXIT();
|
||||
|
||||
@@ -506,7 +506,7 @@ HYDU_sock_create_and_listen_portstr(char *iface, char *hostname, char *port_rang
|
||||
sport = HYDU_int_to_str(port);
|
||||
HYDU_ERR_CHKANDJUMP(status, NULL == sport, HYD_INTERNAL_ERROR, "%s", "");
|
||||
HYDU_MALLOC_OR_JUMP(*port_str, char *, strlen(ip) + 1 + strlen(sport) + 1, status);
|
||||
MPL_snprintf(*port_str, strlen(ip) + 1 + strlen(sport) + 1, "%s:%s", ip, sport);
|
||||
snprintf(*port_str, strlen(ip) + 1 + strlen(sport) + 1, "%s:%s", ip, sport);
|
||||
MPL_free(sport);
|
||||
|
||||
fn_exit:
|
||||
|
||||
@@ -67,7 +67,7 @@ HYD_status HYDU_str_alloc_and_join(char **strlist, char **strjoin)
|
||||
(*strjoin)[0] = 0;
|
||||
|
||||
for (i = 0; strlist[i] != NULL; i++) {
|
||||
MPL_snprintf(*strjoin + count, len - count + 1, "%s", strlist[i]);
|
||||
snprintf(*strjoin + count, len - count + 1, "%s", strlist[i]);
|
||||
count += strlen(strlist[i]);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ char *HYDU_size_t_to_str(size_t x)
|
||||
for (i = 0; i < len; i++)
|
||||
str[i] = '0';
|
||||
|
||||
MPL_snprintf(str, len, "%llu", (unsigned long long) x);
|
||||
snprintf(str, len, "%llu", (unsigned long long) x);
|
||||
|
||||
fn_exit:
|
||||
HYDU_FUNC_EXIT();
|
||||
@@ -202,7 +202,7 @@ char *HYDU_int_to_str_pad(int x, int maxlen)
|
||||
for (i = 0; i < actual_len; i++)
|
||||
str[i] = '0';
|
||||
|
||||
MPL_snprintf(str + actual_len - len - 1, len + 1, "%d", x);
|
||||
snprintf(str + actual_len - len - 1, len + 1, "%d", x);
|
||||
|
||||
fn_exit:
|
||||
HYDU_FUNC_EXIT();
|
||||
|
||||
@@ -64,7 +64,7 @@ HYD_status HYD_uii_mpx_get_parameters(char **t_argv)
|
||||
len = strlen(home) + strlen("/.mpiexec.hydra.conf") + 1;
|
||||
|
||||
HYDU_MALLOC_OR_JUMP(conf_file, char *, len, status);
|
||||
MPL_snprintf(conf_file, len, "%s/.mpiexec.hydra.conf", home);
|
||||
snprintf(conf_file, len, "%s/.mpiexec.hydra.conf", home);
|
||||
|
||||
ret = open(conf_file, O_RDONLY);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -218,7 +218,7 @@ static HYD_status genvlist_fn(char *arg, char ***argv)
|
||||
|
||||
len = strlen("list:") + strlen(**argv) + 1;
|
||||
HYDU_MALLOC_OR_JUMP(HYD_server_info.user_global.global_env.prop, char *, len, status);
|
||||
MPL_snprintf(HYD_server_info.user_global.global_env.prop, len, "list:%s", **argv);
|
||||
snprintf(HYD_server_info.user_global.global_env.prop, len, "list:%s", **argv);
|
||||
|
||||
fn_exit:
|
||||
(*argv)++;
|
||||
@@ -720,7 +720,7 @@ static HYD_status envlist_fn(char *arg, char ***argv)
|
||||
|
||||
len = strlen("list:") + strlen(**argv) + 1;
|
||||
HYDU_MALLOC_OR_JUMP(exec->env_prop, char *, len, status);
|
||||
MPL_snprintf(exec->env_prop, len, "list:%s", **argv);
|
||||
snprintf(exec->env_prop, len, "list:%s", **argv);
|
||||
(*argv)++;
|
||||
|
||||
fn_exit:
|
||||
|
||||
@@ -383,7 +383,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
|
||||
/* This is the first dead process */
|
||||
MPL_free(pg_scratch->dead_processes);
|
||||
HYDU_MALLOC_OR_JUMP(pg_scratch->dead_processes, char *, PMI_MAXVALLEN, status);
|
||||
MPL_snprintf(pg_scratch->dead_processes, PMI_MAXVALLEN, "%d", terminated_rank);
|
||||
snprintf(pg_scratch->dead_processes, PMI_MAXVALLEN, "%d", terminated_rank);
|
||||
} else {
|
||||
/* FIXME: If the list of dead processes does not fit
|
||||
* inside a single value length, set it as a
|
||||
@@ -419,8 +419,8 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
|
||||
MPL_free(current_list);
|
||||
HYDU_MALLOC_OR_JUMP(str, char *, PMI_MAXVALLEN, status);
|
||||
|
||||
MPL_snprintf(str, PMI_MAXVALLEN, "%s,%d", pg_scratch->dead_processes,
|
||||
terminated_rank);
|
||||
snprintf(str, PMI_MAXVALLEN, "%s,%d", pg_scratch->dead_processes,
|
||||
terminated_rank);
|
||||
} else {
|
||||
str = current_list;
|
||||
}
|
||||
|
||||
@@ -180,17 +180,17 @@ static HYD_status resolve_pattern_string(const char *pattern, char **str, int pg
|
||||
|
||||
switch (pattern[pos]) {
|
||||
case 'r':
|
||||
MPL_snprintf(tmp[i], HYD_TMP_STRLEN, "%d", rank);
|
||||
snprintf(tmp[i], HYD_TMP_STRLEN, "%d", rank);
|
||||
break;
|
||||
case 'g':
|
||||
MPL_snprintf(tmp[i], HYD_TMP_STRLEN, "%d", pgid);
|
||||
snprintf(tmp[i], HYD_TMP_STRLEN, "%d", pgid);
|
||||
break;
|
||||
case 'p':
|
||||
MPL_snprintf(tmp[i], HYD_TMP_STRLEN, "%d", proxy_id);
|
||||
snprintf(tmp[i], HYD_TMP_STRLEN, "%d", proxy_id);
|
||||
break;
|
||||
case 't':
|
||||
MPL_snprintf(tmp[i], HYD_TMP_STRLEN, "%d",
|
||||
(int) (time(NULL) - HYD_server_info.time_start));
|
||||
snprintf(tmp[i], HYD_TMP_STRLEN, "%d",
|
||||
(int) (time(NULL) - HYD_server_info.time_start));
|
||||
break;
|
||||
case 'h':
|
||||
pg = PMISERV_pg_by_id(pgid);
|
||||
@@ -198,7 +198,7 @@ static HYD_status resolve_pattern_string(const char *pattern, char **str, int pg
|
||||
HYDU_ASSERT(proxy_id >= 0 && proxy_id < pg->proxy_count, status);
|
||||
|
||||
proxy = &pg->proxy_list[proxy_id];
|
||||
MPL_snprintf(tmp[i], HYD_TMP_STRLEN, "%s", proxy->node->hostname);
|
||||
snprintf(tmp[i], HYD_TMP_STRLEN, "%s", proxy->node->hostname);
|
||||
break;
|
||||
case '\0':
|
||||
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
|
||||
|
||||
@@ -710,7 +710,7 @@ static HYD_status singleton_init(struct pmip_pg *pg, int singleton_pid, int sing
|
||||
HYDU_ERR_POP(status, "unable to send msg to singleton process\n");
|
||||
status = HYDU_sock_read(fd, msg, 1024, &recvd, &closed, HYDU_SOCK_COMM_NONE);
|
||||
HYDU_ERR_POP(status, "unable to read msg from singleton process\n");
|
||||
MPL_snprintf(msg, 1024, "cmd=singinit_info versionok=yes stdio=no kvsname=%s\n", pg->kvsname);
|
||||
snprintf(msg, 1024, "cmd=singinit_info versionok=yes stdio=no kvsname=%s\n", pg->kvsname);
|
||||
status = HYDU_sock_write(fd, msg, strlen(msg), &sent, &closed, HYDU_SOCK_COMM_MSGWAIT);
|
||||
HYDU_ERR_POP(status, "unable to send msg to singleton process\n");
|
||||
|
||||
|
||||
@@ -709,8 +709,8 @@ HYD_status HYD_pmcd_pmip_get_params(char **t_argv)
|
||||
HYD_pmcd_pmip.local.retries = 0;
|
||||
|
||||
HYDU_dbg_finalize();
|
||||
MPL_snprintf(dbg_prefix, 2 * MAX_HOSTNAME_LEN, "proxy:%d:%d",
|
||||
HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.local.id);
|
||||
snprintf(dbg_prefix, 2 * MAX_HOSTNAME_LEN, "proxy:%d:%d",
|
||||
HYD_pmcd_pmip.local.pgid, HYD_pmcd_pmip.local.id);
|
||||
status = HYDU_dbg_init((const char *) dbg_prefix);
|
||||
HYDU_ERR_POP(status, "unable to initialization debugging\n");
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ int MPIE_Args(int argc, char *argv[], ProcessUniverse * mypUniv,
|
||||
} else if (strncmp(argv[i], "-channel=", 9) == 0) {
|
||||
const char *channame = argv[i] + 9;
|
||||
char envstring[256];
|
||||
MPL_snprintf(envstring, sizeof(envstring), "MPICH_CH3CHANNEL=%s", channame);
|
||||
snprintf(envstring, sizeof(envstring), "MPICH_CH3CHANNEL=%s", channame);
|
||||
MPIE_Putenv(mypUniv->worlds, envstring);
|
||||
}
|
||||
/* End of the MPICH mpiexec common extensions */
|
||||
|
||||
@@ -32,14 +32,6 @@
|
||||
#include "process.h"
|
||||
#include "labelout.h"
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
#define MPL_snprintf snprintf
|
||||
#ifdef NEEDS_SNPRINTF_DECL
|
||||
/* style: allow:sprintf:1 sig:0 */
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MAX_LABEL 32
|
||||
|
||||
typedef struct {
|
||||
@@ -201,9 +193,9 @@ static int IOLabelSetLabelText(const char pattern[], char label[],
|
||||
char worldnumAsChar[12];
|
||||
|
||||
/* Convert the rank in world to characters */
|
||||
MPL_snprintf(rankAsChar, sizeof(rankAsChar), "%d", rank);
|
||||
snprintf(rankAsChar, sizeof(rankAsChar), "%d", rank);
|
||||
/* Convert the world number to characters */
|
||||
MPL_snprintf(worldnumAsChar, sizeof(worldnumAsChar), "%d", worldnum);
|
||||
snprintf(worldnumAsChar, sizeof(worldnumAsChar), "%d", worldnum);
|
||||
|
||||
pout[0] = 0;
|
||||
/* Copy the pattern looking for format commands */
|
||||
|
||||
@@ -181,7 +181,7 @@ int PMIServGetPort(int *fdout, char *portString, int portLen)
|
||||
char hostname[MAX_HOST_NAME + 1];
|
||||
hostname[0] = 0;
|
||||
MPIE_GetMyHostName(hostname, sizeof(hostname));
|
||||
MPL_snprintf(portString, portLen, "%s:%d", hostname, portnum);
|
||||
snprintf(portString, portLen, "%s:%d", hostname, portnum);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+40
-48
@@ -36,13 +36,6 @@
|
||||
/* ??? */
|
||||
#include "simple_pmiutil.h"
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
#define MPL_snprintf snprintf
|
||||
#ifdef NEEDS_SNPRINTF_DECL
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* isascii is an extension, so define it if it isn't defined */
|
||||
#ifndef isascii
|
||||
#define isascii(c) (((c)&~0x7f)==0)
|
||||
@@ -169,7 +162,7 @@ int PMISetupInClient(int usePort, PMISetup * pmiinfo)
|
||||
|
||||
if (usePort == 0) {
|
||||
close(pmiinfo->fdpair[0]);
|
||||
MPL_snprintf(env_pmi_fd, sizeof(env_pmi_fd), "PMI_FD=%d", pmiinfo->fdpair[1]);
|
||||
snprintf(env_pmi_fd, sizeof(env_pmi_fd), "PMI_FD=%d", pmiinfo->fdpair[1]);
|
||||
if (MPIE_Putenv(pmiinfo->pWorld, env_pmi_fd)) {
|
||||
MPL_internal_error_printf("Could not set environment PMI_FD");
|
||||
return 1;
|
||||
@@ -177,7 +170,7 @@ int PMISetupInClient(int usePort, PMISetup * pmiinfo)
|
||||
} else {
|
||||
/* We must communicate the port name to the process */
|
||||
if (pmiinfo->portName) {
|
||||
MPL_snprintf(env_pmi_port, sizeof(env_pmi_port), "PMI_PORT=%s", pmiinfo->portName);
|
||||
snprintf(env_pmi_port, sizeof(env_pmi_port), "PMI_PORT=%s", pmiinfo->portName);
|
||||
if (MPIE_Putenv(pmiinfo->pWorld, env_pmi_port)) {
|
||||
MPL_internal_error_printf("Could not set environment PMI_PORT");
|
||||
perror("Reason: ");
|
||||
@@ -400,7 +393,7 @@ static int fPMI_Handle_finalize(PMIProcess * pentry)
|
||||
pentry->pState->status = PROCESS_FINALIZED;
|
||||
|
||||
/* send back an acknowledgement to release the process */
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=finalize_ack\n");
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=finalize_ack\n");
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
|
||||
return 0;
|
||||
@@ -464,7 +457,7 @@ static PMIKVSpace *fPMIKVSAllocate(void)
|
||||
* hostname as well, just to avoid getting the same pid on two
|
||||
* different hosts, but this is probably good enough for most
|
||||
* uses) */
|
||||
MPL_snprintf((char *) (kvs->kvsname), MAXNAMELEN, "kvs_%d_%d", (int) getpid(), kvsnum++);
|
||||
snprintf((char *) (kvs->kvsname), MAXNAMELEN, "kvs_%d_%d", (int) getpid(), kvsnum++);
|
||||
kvs->pairs = 0;
|
||||
kvs->lastByIdx = 0;
|
||||
kvs->lastIdx = -1;
|
||||
@@ -631,7 +624,7 @@ static int fPMI_Handle_create_kvs(PMIProcess * pentry)
|
||||
/* PANIC - allocation failed */
|
||||
return 1;
|
||||
}
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=newkvs kvsname=%s\n", kvsname);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=newkvs kvsname=%s\n", kvsname);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("Handle_create_kvs new name %s\n", kvsname));
|
||||
return 0;
|
||||
@@ -651,12 +644,12 @@ static int fPMI_Handle_destroy_kvs(PMIProcess * pentry)
|
||||
kvs = fPMIKVSFindSpace(kvsname);
|
||||
if (kvs) {
|
||||
PMIKVSFree(kvs);
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "KVS_%s_successfully_destroyed", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "KVS_%s_successfully_destroyed", kvsname);
|
||||
} else {
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "KVS %s not found", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "KVS %s not found", kvsname);
|
||||
rc = -1;
|
||||
}
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=kvs_destroyed rc=%d msg=%s\n", rc, message);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=kvs_destroyed rc=%d msg=%s\n", rc, message);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
return 0;
|
||||
}
|
||||
@@ -683,19 +676,19 @@ static int fPMI_Handle_put(PMIProcess * pentry)
|
||||
rc = fPMIKVSAddPair(kvs, key, val);
|
||||
if (rc == 1) {
|
||||
rc = -1; /* no duplicate keys allowed */
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "duplicate_key %s", key);
|
||||
snprintf(message, PMIU_MAXLINE, "duplicate_key %s", key);
|
||||
} else if (rc == -1) {
|
||||
rc = -1;
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "no_room_in_kvs_%s", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "no_room_in_kvs_%s", kvsname);
|
||||
} else {
|
||||
rc = 0;
|
||||
MPL_strncpy(message, "success", PMIU_MAXLINE);
|
||||
}
|
||||
} else {
|
||||
rc = -1;
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "kvs_%s_not_found", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "kvs_%s_not_found", kvsname);
|
||||
}
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=put_result rc=%d msg=%s\n", rc, message);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=put_result rc=%d msg=%s\n", rc, message);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
return 0;
|
||||
}
|
||||
@@ -726,15 +719,14 @@ static int fPMI_Handle_get(PMIProcess * pentry)
|
||||
} else if (rc) {
|
||||
rc = -1;
|
||||
MPL_strncpy(value, "unknown", PMIU_MAXLINE);
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "key_%s_not_found", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "key_%s_not_found", kvsname);
|
||||
}
|
||||
} else {
|
||||
rc = -1;
|
||||
MPL_strncpy(value, "unknown", PMIU_MAXLINE);
|
||||
MPL_snprintf(message, PMIU_MAXLINE, "kvs_%s_not_found", kvsname);
|
||||
snprintf(message, PMIU_MAXLINE, "kvs_%s_not_found", kvsname);
|
||||
}
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE,
|
||||
"cmd=get_result rc=%d msg=%s value=%s\n", rc, message, value);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=get_result rc=%d msg=%s value=%s\n", rc, message, value);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
return rc;
|
||||
@@ -748,7 +740,7 @@ static int fPMI_Handle_get_my_kvsname(PMIProcess * pentry)
|
||||
|
||||
kvs = pentry->group->kvs;
|
||||
if (kvs && kvs->kvsname) {
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=my_kvsname kvsname=%s\n", kvs->kvsname);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=my_kvsname kvsname=%s\n", kvs->kvsname);
|
||||
} else {
|
||||
MPL_internal_error_printf("Group has no associated KVS");
|
||||
return -1;
|
||||
@@ -763,7 +755,7 @@ static int fPMI_Handle_get_universe_size(PMIProcess * pentry)
|
||||
{
|
||||
char outbuf[PMIU_MAXLINE];
|
||||
/* Import the universe size from the process structures */
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=universe_size size=%d\n", pUniv.size);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=universe_size size=%d\n", pUniv.size);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
return 0;
|
||||
@@ -774,7 +766,7 @@ static int fPMI_Handle_get_appnum(PMIProcess * pentry)
|
||||
{
|
||||
ProcessApp *app = pentry->pState->app;
|
||||
char outbuf[PMIU_MAXLINE];
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=appnum appnum=%d\n", app->myAppNum);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=appnum appnum=%d\n", app->myAppNum);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
return 0;
|
||||
@@ -798,9 +790,9 @@ static int fPMI_Handle_init(PMIProcess * pentry)
|
||||
|
||||
pentry->pState->status = PROCESS_COMMUNICATING;
|
||||
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE,
|
||||
"cmd=response_to_init pmi_version=%d pmi_subversion=%d rc=%d\n",
|
||||
PMI_VERSION, PMI_SUBVERSION, rc);
|
||||
snprintf(outbuf, PMIU_MAXLINE,
|
||||
"cmd=response_to_init pmi_version=%d pmi_subversion=%d rc=%d\n",
|
||||
PMI_VERSION, PMI_SUBVERSION, rc);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
return 0;
|
||||
@@ -810,9 +802,9 @@ static int fPMI_Handle_init(PMIProcess * pentry)
|
||||
static int fPMI_Handle_get_maxes(PMIProcess * pentry)
|
||||
{
|
||||
char outbuf[PMIU_MAXLINE];
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE,
|
||||
"cmd=maxes kvsname_max=%d keylen_max=%d vallen_max=%d\n",
|
||||
MAXKVSNAME, MAXKEYLEN, MAXVALLEN);
|
||||
snprintf(outbuf, PMIU_MAXLINE,
|
||||
"cmd=maxes kvsname_max=%d keylen_max=%d vallen_max=%d\n",
|
||||
MAXKVSNAME, MAXKEYLEN, MAXVALLEN);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
return 0;
|
||||
@@ -840,20 +832,20 @@ static int fPMI_Handle_getbyidx(PMIProcess * pentry)
|
||||
for (p = kvs->pairs; j-- > 0 && p; p = p->nextPair);
|
||||
}
|
||||
if (p) {
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results "
|
||||
"rc=0 nextidx=%d key=%s val=%s\n", jNext, p->key, p->val);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results "
|
||||
"rc=0 nextidx=%d key=%s val=%s\n", jNext, p->key, p->val);
|
||||
kvs->lastIdx = jNext - 1;
|
||||
kvs->lastByIdx = p;
|
||||
} else {
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results rc=-1 "
|
||||
"reason=no_more_keyvals\n");
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results rc=-1 "
|
||||
"reason=no_more_keyvals\n");
|
||||
kvs->lastIdx = -1;
|
||||
kvs->lastByIdx = 0;
|
||||
}
|
||||
} else {
|
||||
rc = -1;
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results rc=-1 "
|
||||
"reason=kvs_%s_not_found\n", kvsname);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=getbyidx_results rc=-1 "
|
||||
"reason=kvs_%s_not_found\n", kvsname);
|
||||
}
|
||||
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
@@ -922,11 +914,11 @@ static int fPMI_Handle_init_port(PMIProcess * pentry)
|
||||
/* simple_pmi wants to see cmd=initack after the initack request before
|
||||
* the other data */
|
||||
PMIWriteLine(pentry->fd, "cmd=initack\n");
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=set size=%d\n", pentry->group->nProcess);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=set size=%d\n", pentry->group->nProcess);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=set rank=%d\n", pentry->pState->wRank);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=set rank=%d\n", pentry->pState->wRank);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=set debug=%d\n", pmidebug);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=set debug=%d\n", pmidebug);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
return 0;
|
||||
}
|
||||
@@ -1183,7 +1175,7 @@ static int fPMI_Handle_spawn(PMIProcess * pentry)
|
||||
MPIE_PrintProcessWorld(stdout, pWorld);
|
||||
}
|
||||
|
||||
MPL_snprintf(outbuf, PMIU_MAXLINE, "cmd=spawn_result rc=%d\n", rc);
|
||||
snprintf(outbuf, PMIU_MAXLINE, "cmd=spawn_result rc=%d\n", rc);
|
||||
PMIWriteLine(pentry->fd, outbuf);
|
||||
DBG_PRINTFCOND(pmidebug, ("%s", outbuf));
|
||||
|
||||
@@ -1257,9 +1249,9 @@ int PMI_InitSingletonConnection(int fd, PMIProcess * pmiprocess)
|
||||
|
||||
/* We start with the singinit command, wait for the singinit from
|
||||
* the client, and then send the singinit_info */
|
||||
MPL_snprintf(buf, PMIU_MAXLINE,
|
||||
"cmd=singinit pmi_version=%d pmi_subversion=%d stdio=no authtype=none\n",
|
||||
PMI_VERSION, PMI_SUBVERSION);
|
||||
snprintf(buf, PMIU_MAXLINE,
|
||||
"cmd=singinit pmi_version=%d pmi_subversion=%d stdio=no authtype=none\n",
|
||||
PMI_VERSION, PMI_SUBVERSION);
|
||||
PMIWriteLine(fd, buf);
|
||||
PMIReadLine(fd, buf, PMIU_MAXLINE);
|
||||
PMIU_parse_keyvals(buf);
|
||||
@@ -1277,9 +1269,9 @@ int PMI_InitSingletonConnection(int fd, PMIProcess * pmiprocess)
|
||||
else
|
||||
rc = -1;
|
||||
|
||||
MPL_snprintf(buf, PMIU_MAXLINE,
|
||||
"cmd=singinit_info versionok=%s stdio=no kvsname=%s\n",
|
||||
(rc == 0) ? "yes" : "no", (char *) (pmiprocess->group->kvs->kvsname));
|
||||
snprintf(buf, PMIU_MAXLINE,
|
||||
"cmd=singinit_info versionok=%s stdio=no kvsname=%s\n",
|
||||
(rc == 0) ? "yes" : "no", (char *) (pmiprocess->group->kvs->kvsname));
|
||||
PMIWriteLine(fd, buf);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -270,24 +270,24 @@ int MPIE_ExecProgram(ProcessState * pState, char *envp[])
|
||||
|
||||
DBG_PRINTF(("Creating pmi env\n"));
|
||||
if (pState->initWithEnv) {
|
||||
MPL_snprintf(env_pmi_rank, MAXNAMELEN, "PMI_RANK=%d", pState->wRank);
|
||||
snprintf(env_pmi_rank, MAXNAMELEN, "PMI_RANK=%d", pState->wRank);
|
||||
client_env[j++] = env_pmi_rank;
|
||||
MPL_snprintf(env_pmi_size, MAXNAMELEN, "PMI_SIZE=%d", app->pWorld->nProcess);
|
||||
snprintf(env_pmi_size, MAXNAMELEN, "PMI_SIZE=%d", app->pWorld->nProcess);
|
||||
client_env[j++] = env_pmi_size;
|
||||
MPL_snprintf(env_pmi_debug, MAXNAMELEN, "PMI_DEBUG=%d", MPIE_Debug);
|
||||
snprintf(env_pmi_debug, MAXNAMELEN, "PMI_DEBUG=%d", MPIE_Debug);
|
||||
client_env[j++] = env_pmi_debug;
|
||||
} else {
|
||||
/* We must also communicate the ID to the process.
|
||||
* This id is saved in the pState so that we can match it
|
||||
* when it comes back to us (it is the same as the rank
|
||||
* in the simple case) */
|
||||
MPL_snprintf(env_pmi_id, sizeof(env_pmi_id), "PMI_ID=%d", pState->id);
|
||||
snprintf(env_pmi_id, sizeof(env_pmi_id), "PMI_ID=%d", pState->id);
|
||||
client_env[j++] = env_pmi_id;
|
||||
}
|
||||
|
||||
MPL_snprintf(env_appnum, MAXNAMELEN, "MPI_APPNUM=%d", app->myAppNum);
|
||||
snprintf(env_appnum, MAXNAMELEN, "MPI_APPNUM=%d", app->myAppNum);
|
||||
client_env[j++] = env_appnum;
|
||||
MPL_snprintf(env_universesize, MAXNAMELEN, "MPI_UNIVERSE_SIZE=%d", pUniv.size);
|
||||
snprintf(env_universesize, MAXNAMELEN, "MPI_UNIVERSE_SIZE=%d", pUniv.size);
|
||||
client_env[j++] = env_universesize;
|
||||
client_env[j] = 0;
|
||||
|
||||
@@ -330,7 +330,7 @@ int MPIE_ExecProgram(ProcessState * pState, char *envp[])
|
||||
/* pathname argument should be used here */
|
||||
if (app->path) {
|
||||
/* Set up the search path */
|
||||
MPL_snprintf(pathstring, sizeof(pathstring) - 1, "PATH=%s", app->path);
|
||||
snprintf(pathstring, sizeof(pathstring) - 1, "PATH=%s", app->path);
|
||||
/* Some systems require that the path include the path to
|
||||
* certain files or libraries, for example cygwin1.dll for
|
||||
* Cygwin */
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ MachineTable *MPIE_ReadMachines(const char *arch, int nNeeded, void *data)
|
||||
|
||||
/* Construct the final path name */
|
||||
if (arch) {
|
||||
MPL_snprintf(machinesfile, PATH_MAX, "%s/machines.%s", dirname, arch);
|
||||
snprintf(machinesfile, PATH_MAX, "%s/machines.%s", dirname, arch);
|
||||
} else {
|
||||
MPL_strncpy(machinesfile, dirname, PATH_MAX);
|
||||
MPL_strnapp(machinesfile, "/machines", PATH_MAX);
|
||||
|
||||
@@ -50,7 +50,7 @@ static char PMIU_print_id[PMIU_IDSIZE] = "unset";
|
||||
|
||||
void PMIU_Set_rank(int PMI_rank)
|
||||
{
|
||||
MPL_snprintf(PMIU_print_id, PMIU_IDSIZE, "cli_%d", PMI_rank);
|
||||
snprintf(PMIU_print_id, PMIU_IDSIZE, "cli_%d", PMI_rank);
|
||||
}
|
||||
|
||||
void PMIU_SetServer(void)
|
||||
@@ -78,7 +78,7 @@ void PMIU_printf(int print_flag, const char *fmt, ...)
|
||||
char filename[1024];
|
||||
p = getenv("PMI_ID");
|
||||
if (p) {
|
||||
MPL_snprintf(filename, sizeof(filename), "testclient-%s.out", p);
|
||||
snprintf(filename, sizeof(filename), "testclient-%s.out", p);
|
||||
logfile = fopen(filename, "w");
|
||||
} else {
|
||||
logfile = fopen("testserver.out", "w");
|
||||
|
||||
@@ -102,11 +102,6 @@ if test "$enable_pmiport" != "no" ; then
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(unistd.h string.h stdlib.h sys/socket.h strings.h assert.h arpa/inet.h)
|
||||
dnl Use snprintf if possible when creating messages
|
||||
AC_CHECK_FUNCS(snprintf)
|
||||
if test "$ac_cv_func_snprintf" = "yes" ; then
|
||||
PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
|
||||
fi
|
||||
AC_CHECK_FUNCS(strncasecmp)
|
||||
|
||||
if test "$enable_pmiport" = "yes" ; then
|
||||
|
||||
@@ -63,7 +63,7 @@ void PMIU_thread_init(void)
|
||||
|
||||
void PMIU_Set_rank(int PMI_rank)
|
||||
{
|
||||
MPL_snprintf(PMIU_print_id, PMIU_IDSIZE, "cli_%d", PMI_rank);
|
||||
snprintf(PMIU_print_id, PMIU_IDSIZE, "cli_%d", PMI_rank);
|
||||
}
|
||||
|
||||
void PMIU_SetServer(void)
|
||||
@@ -91,7 +91,7 @@ void PMIU_printf(int print_flag, const char *fmt, ...)
|
||||
char filename[1024];
|
||||
p = getenv("PMI_ID");
|
||||
if (p) {
|
||||
MPL_snprintf(filename, sizeof(filename), "testclient-%s.out", p);
|
||||
snprintf(filename, sizeof(filename), "testclient-%s.out", p);
|
||||
logfile = fopen(filename, "w");
|
||||
} else {
|
||||
logfile = fopen("testserver.out", "w");
|
||||
|
||||
@@ -351,7 +351,7 @@ PMI_API_PUBLIC int PMI_KVS_Get_my_name(char kvsname[], int length)
|
||||
/* Return a dummy name */
|
||||
/* Upon singinit of server, we'll check and replace "singinit" with
|
||||
* initialized singinit_kvsname */
|
||||
MPL_snprintf(kvsname, length, "singinit");
|
||||
snprintf(kvsname, length, "singinit");
|
||||
goto fn_exit;
|
||||
}
|
||||
|
||||
@@ -849,7 +849,7 @@ static int PMII_singinit(void)
|
||||
MPL_LISTEN_POP; /* back to default: use_loopback=0, max_conn=SOMAXCONN */
|
||||
PMIU_ERR_CHKANDJUMP(rc, pmi_errno, PMI_FAIL, "PMII_singinit: listen failed");
|
||||
|
||||
MPL_snprintf(port_c, sizeof(port_c), "%d", port);
|
||||
snprintf(port_c, sizeof(port_c), "%d", port);
|
||||
|
||||
PMIU_printf(PMIU_verbose, "Starting mpiexec with %s\n", port_c);
|
||||
|
||||
@@ -871,7 +871,7 @@ static int PMII_singinit(void)
|
||||
newargv[i++] = "default_interface"; /* default interface name, for now */
|
||||
newargv[i++] = "default_key"; /* default authentication key, for now */
|
||||
char charpid[8];
|
||||
MPL_snprintf(charpid, 8, "%d", getpid());
|
||||
snprintf(charpid, 8, "%d", getpid());
|
||||
newargv[i++] = charpid;
|
||||
newargv[i++] = NULL;
|
||||
PMIU_Assert(i <= 8);
|
||||
|
||||
@@ -253,7 +253,7 @@ PMI_API_PUBLIC int PMI2_Job_GetId(char jobid[], int jobid_size)
|
||||
|
||||
if (PMI_initialized == SINGLETON_INIT_BUT_NO_PM) {
|
||||
/* Return a dummy name */
|
||||
MPL_snprintf(jobid, jobid_size, "singinit_kvs_%d_0", (int) getpid());
|
||||
snprintf(jobid, jobid_size, "singinit_kvs_%d_0", (int) getpid());
|
||||
goto fn_exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -774,8 +774,7 @@ int PMIU_cmd_output_v1_initack(struct PMIU_cmd *pmicmd, char **buf_out, int *buf
|
||||
if (rank >= 0 && size >= 0) {
|
||||
char *s = *buf_out + (*buflen_out);
|
||||
int len = MAX_TMP_BUF_SIZE - (*buflen_out);
|
||||
MPL_snprintf(s, len, "cmd=set size=%d\ncmd=set rank=%d\ncmd=set debug=%d\n", size, rank,
|
||||
debug);
|
||||
snprintf(s, len, "cmd=set size=%d\ncmd=set rank=%d\ncmd=set debug=%d\n", size, rank, debug);
|
||||
|
||||
*buflen_out += strlen(s);
|
||||
}
|
||||
@@ -807,7 +806,7 @@ int PMIU_cmd_output_v2(struct PMIU_cmd *pmicmd, char **buf_out, int *buflen_out)
|
||||
char *s;
|
||||
s = pmicmd->tmp_buf;
|
||||
|
||||
MPL_snprintf(s, 7, "%6u", buflen - 6);
|
||||
snprintf(s, 7, "%6u", buflen - 6);
|
||||
s += 6;
|
||||
|
||||
strcpy(s, "cmd=");
|
||||
|
||||
@@ -34,7 +34,7 @@ static inline int MPIR_NODEMAP_publish_node_id(int sz, int myrank)
|
||||
/* Put my hostname id */
|
||||
if (sz > 1) {
|
||||
memset(key, 0, key_max_sz);
|
||||
MPL_snprintf(key, key_max_sz, "hostname[%d]", myrank);
|
||||
snprintf(key, key_max_sz, "hostname[%d]", myrank);
|
||||
|
||||
mpi_errno = MPIR_pmi_kvs_put(key, hostname);
|
||||
MPIR_ERR_CHECK(mpi_errno);
|
||||
@@ -99,11 +99,11 @@ static inline int MPIR_NODEMAP_build_nodemap_fallback(int sz, int myrank, int *o
|
||||
"**sock_gethost %s %d",
|
||||
MPIR_Strerror(errno, strerrbuf, MPIR_STRERROR_BUF_SIZE), errno);
|
||||
hostname[MAX_HOSTNAME_LEN - 1] = '\0';
|
||||
MPL_snprintf(node_names[max_node_id + 1], key_max_sz, "%s", hostname);
|
||||
snprintf(node_names[max_node_id + 1], key_max_sz, "%s", hostname);
|
||||
MPL_free(hostname);
|
||||
} else {
|
||||
memset(key, 0, key_max_sz);
|
||||
MPL_snprintf(key, key_max_sz, "hostname[%d]", i);
|
||||
snprintf(key, key_max_sz, "hostname[%d]", i);
|
||||
|
||||
mpi_errno = MPIR_pmi_kvs_get(i, key, node_names[max_node_id + 1], key_max_sz);
|
||||
MPIR_ERR_CHECK(mpi_errno);
|
||||
|
||||
@@ -568,7 +568,7 @@ static int put_ex(const char *key, const void *buf, int bufsize, int is_local)
|
||||
if (bufsize % segsize > 0) {
|
||||
num_segs++;
|
||||
}
|
||||
MPL_snprintf(val, pmi_max_val_size, "segments=%d", num_segs);
|
||||
snprintf(val, pmi_max_val_size, "segments=%d", num_segs);
|
||||
mpi_errno = MPIR_pmi_kvs_put(key, val);
|
||||
MPIR_ERR_CHECK(mpi_errno);
|
||||
for (int i = 0; i < num_segs; i++) {
|
||||
@@ -1508,7 +1508,7 @@ static int hex(unsigned char c)
|
||||
static void encode(int size, const char *src, char *dest)
|
||||
{
|
||||
for (int i = 0; i < size; i++) {
|
||||
MPL_snprintf(dest, 3, "%02X", (unsigned char) *src);
|
||||
snprintf(dest, 3, "%02X", (unsigned char) *src);
|
||||
src++;
|
||||
dest += 2;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ template:
|
||||
#define MPL_malloc(sz,t) malloc(sz)
|
||||
#define MPL_realloc(p,sz,t) realloc(p,sz)
|
||||
#define MPL_free free
|
||||
#define MPL_snprintf snprintf
|
||||
|
||||
[src/mpl/src/mpl_rankmap.c:MPL_rankmap_array_to_str]
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário