TEST_BIG_ENDIAN(BIGENDIAN)
include(FindGraphviz)
-include(FindPCRE)
+if(WIN32)
+include(FindPcreWin)
+else(WIN32)
+include(FindPCRE)
+endif(WIN32)
set(HAVE_GTNETS 0)
if(enable_gtnets)
set_target_properties(gras PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libgras_version} OUTPUT_NAME "gras")\r
set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid")\r
\r
-set(GRAS_DEP "ws2_32 -lpthread")\r
-set(SIMGRID_DEP "ws2_32 -lpthread")\r
+# libpthreadGC2.dll\r
+if(ARCH_32_BITS)\r
+ find_library(PATH_PTHREAD_LIB \r
+ NAMES pthreadGC2.dll\r
+ HINTS\r
+ $ENV{PATH}\r
+ PATH_SUFFIXES bin/ c/bin\r
+ )\r
+else(ARCH_32_BITS)\r
+ find_library(PATH_PTHREAD_LIB \r
+ NAMES pthreadGC2-w64.dll\r
+ HINTS\r
+ $ENV{PATH}\r
+ PATH_SUFFIXES bin/ c/bin\r
+ )\r
+endif(ARCH_32_BITS)\r
+\r
+set(GRAS_DEP "ws2_32 ${PATH_PTHREAD_LIB}")\r
+set(SIMGRID_DEP "ws2_32 ${PATH_PCRE_LIB} ${PATH_PTHREAD_LIB}")\r
\r
if(ARCH_32_BITS)\r
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486")\r
else(ARCH_32_BITS)\r
- message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")\r
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")\r
+# message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")
endif(ARCH_32_BITS)\r
\r
target_link_libraries(gras ${GRAS_DEP})\r
-target_link_libraries(simgrid ${SIMGRID_DEP} ${PATH_PCRE_LIB})\r
+target_link_libraries(simgrid ${SIMGRID_DEP})\r
\r
find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)\r
message(STATUS "pexports: ${PEXPORTS_PATH}")\r
/opt/local
/opt/csw
/sw
- /usr)
-
-string(REGEX MATCH ".dll.a" operation "${PATH_PCRE_LIB}")
-
-if(NOT operation)
- if(WIN32)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-DPCRE_STATIC ")
- endif(WIN32)
-endif(NOT operation)
-
+ /usr)
find_path(PATH_PCRE_H "pcre.h"
HINTS
message(STATUS "Looking for lib pcre - not found")
endif(PATH_PCRE_LIB)
-if(WIN32)
- find_path(PATH_PCRE_LICENCE "LICENCE"
- HINTS
- $ENV{SIMGRID_PCRE_LIBRARY_PATH}
- $ENV{LD_LIBRARY_PATH}
- $ENV{PCRE_LIBRARY_PATH}
- PATH_SUFFIXES GnuWin32
- PATHS
- /opt
- /opt/local
- /opt/csw
- /sw
- /usr)
- message(STATUS "Looking for pcre licence")
- if(PATH_PCRE_LICENCE)
- message(STATUS "Looking for pcre licence - found")
- else(PATH_PCRE_LICENCE)
- message(STATUS "Looking for pcre licence - not found")
- endif(PATH_PCRE_LICENCE)
-endif(WIN32)
-
if(PATH_PCRE_LIB AND PATH_PCRE_H)
string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
--- /dev/null
+# LIB libpcre.dll
+find_library(PATH_PCRE_LIB
+ NAMES pcre
+ HINTS
+ $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+ $ENV{PCRE_LIBRARY_PATH}
+ PATH_SUFFIXES bin/ GnuWin32/bin
+ )
+
+find_path(PATH_PCRE_H "pcre.h"
+ HINTS
+ $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+ $ENV{PCRE_LIBRARY_PATH}
+ PATH_SUFFIXES include/ GnuWin32/include
+ )
+
+message(STATUS "Looking for pcre.h")
+if(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - found")
+else(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - not found")
+endif(PATH_PCRE_H)
+
+message(STATUS "Looking for lib pcre")
+if(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - found")
+else(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - not found")
+endif(PATH_PCRE_LIB)
+
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
+ string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+ string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
+ if(NOT operation)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
+ endif(NOT operation)
+else(PATH_PCRE_LIB)
+ message(FATAL_ERROR "Please install the pcre package before using SimGrid.")
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
+
+set(PCRE_LIBRARY_PATH $ENV{PCRE_LIBRARY_PATH})
+
+mark_as_advanced(PATH_PCRE_H)
+mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
file @CMAKE_HOME_DIRECTORY@\examples\msg\masterslave\deployment_masterslave_forwarder.xml\r
file @CMAKE_HOME_DIRECTORY@\examples\msg\msg_platform.xml\r
file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\CMakeLists.txt\r
- file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\FindPCRE.cmake\r
+ file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\FindPcreWin.cmake\r
\r
# create shortcuts in the start menu programs directory\r
CreateDirectory "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\"\r
setOutPath $INSTDIR\GnuWin32\r
file /r "@PCRE_LIBRARY_PATH@\lib"\r
file /r "@PCRE_LIBRARY_PATH@\include"\r
- file /nonfatal /r "@PCRE_LIBRARY_PATH@\bin"\r
- file /nonfatal /r "@PCRE_LIBRARY_PATH@\man"\r
- file /nonfatal /r "@PCRE_LIBRARY_PATH@\share"\r
+ file /r "@PCRE_LIBRARY_PATH@\bin"\r
+ file /r "@PCRE_LIBRARY_PATH@\man"\r
+ file /r "@PCRE_LIBRARY_PATH@\share"\r
SectionEnd\r
\r
Section "Java Bindings" JavaSection \r
###############################
# Test the build dependencies #
###############################
-include(FindPCRE.cmake)
+include(FindPcreWin.cmake)
message(STATUS "Looking for lib Simgrid")
if("$ENV{SIMGRID_ROOT}" STREQUAL "")
message(STATUS "Looking for lib Simgrid - Not found")
+++ /dev/null
-### SET THE LIBRARY EXTENSION AND GCC VERSION
-if(APPLE) #MAC
- set(LIB_EXE "dylib")
-else(APPLE)
- if(WIN32) #WINDOWS
- set(LIB_EXE "a")
- set(BIN_EXE ".exe")
- else(WIN32) #UNIX
- set(LIB_EXE "so")
- endif(WIN32)
-endif(APPLE)
-
-find_library(PATH_PCRE_LIB
- NAMES pcre
- HINTS
- $ENV{SIMGRID_PCRE_LIBRARY_PATH}
- $ENV{LD_LIBRARY_PATH}
- $ENV{PCRE_LIBRARY_PATH}
- PATH_SUFFIXES lib/ GnuWin32/lib
- PATHS
- /opt
- /opt/local
- /opt/csw
- /sw
- /usr)
-
-string(REGEX MATCH ".dll.a" operation "${PATH_PCRE_LIB}")
-
-if(NOT operation)
- if(WIN32)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-DPCRE_STATIC ")
- endif(WIN32)
-endif(NOT operation)
-
-find_path(PATH_PCRE_H "pcre.h"
- HINTS
- $ENV{SIMGRID_PCRE_LIBRARY_PATH}
- $ENV{LD_LIBRARY_PATH}
- $ENV{PCRE_LIBRARY_PATH}
- PATH_SUFFIXES include/ GnuWin32/include
- PATHS
- /opt
- /opt/local
- /opt/csw
- /sw
- /usr)
-
-message(STATUS "Looking for pcre.h")
-if(PATH_PCRE_H)
-message(STATUS "Looking for pcre.h - found")
-else(PATH_PCRE_H)
-message(STATUS "Looking for pcre.h - not found")
-endif(PATH_PCRE_H)
-
-message(STATUS "Looking for lib pcre")
-if(PATH_PCRE_LIB)
-message(STATUS "Looking for lib pcre - found")
-else(PATH_PCRE_LIB)
-message(STATUS "Looking for lib pcre - not found")
-endif(PATH_PCRE_LIB)
-
-if(WIN32)
- find_path(PATH_PCRE_LICENCE "LICENCE"
- HINTS
- $ENV{SIMGRID_PCRE_LIBRARY_PATH}
- $ENV{LD_LIBRARY_PATH}
- $ENV{PCRE_LIBRARY_PATH}
- PATH_SUFFIXES GnuWin32
- PATHS
- /opt
- /opt/local
- /opt/csw
- /sw
- /usr)
- message(STATUS "Looking for pcre licence")
- if(PATH_PCRE_LICENCE)
- message(STATUS "Looking for pcre licence - found")
- else(PATH_PCRE_LICENCE)
- message(STATUS "Looking for pcre licence - not found")
- endif(PATH_PCRE_LICENCE)
-endif(WIN32)
-
-if(PATH_PCRE_LIB AND PATH_PCRE_H)
- string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
- string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
- string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
- if(NOT operation)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
- endif(NOT operation)
- string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
- if(NOT operation)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
- endif(NOT operation)
-else(PATH_PCRE_LIB)
- message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using SimGrid.")
-endif(PATH_PCRE_LIB AND PATH_PCRE_H)
-
-mark_as_advanced(PATH_PCRE_H)
-mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
--- /dev/null
+# LIB libpcre.dll
+find_library(PATH_PCRE_LIB
+ NAMES pcre
+ HINTS
+ $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+ $ENV{PCRE_LIBRARY_PATH}
+ PATH_SUFFIXES bin/ GnuWin32/bin
+ )
+
+find_path(PATH_PCRE_H "pcre.h"
+ HINTS
+ $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+ $ENV{PCRE_LIBRARY_PATH}
+ PATH_SUFFIXES include/ GnuWin32/include
+ )
+
+message(STATUS "Looking for pcre.h")
+if(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - found")
+else(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - not found")
+endif(PATH_PCRE_H)
+
+message(STATUS "Looking for lib pcre")
+if(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - found")
+else(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - not found")
+endif(PATH_PCRE_LIB)
+
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
+ string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+ string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
+ if(NOT operation)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
+ endif(NOT operation)
+else(PATH_PCRE_LIB)
+ message(FATAL_ERROR "Please install the pcre package before using SimGrid.")
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
+
+mark_as_advanced(PATH_PCRE_H)
+mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
case TASK_FIND_SUCCESSOR_ANSWER:
case TASK_GET_PREDECESSOR_ANSWER:
- XBT_DEBUG("Ignoring unexpected task of type %d (%p)", type, task);
+ XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
task_free(task);
break;
}
if (res != MSG_OK) {
XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request (task %p): %d",
- task_sent, res);
+ task_sent, (int)res);
stop = 1;
MSG_comm_destroy(node->comm_receive);
node->comm_receive = NULL;
if (res != MSG_OK) {
XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request (task %p): %d",
- task_sent, res);
+ task_sent, (int)res);
stop = 1;
MSG_comm_destroy(node->comm_receive);
node->comm_receive = NULL;
MSG_HOST_FAILURE = 4, /**< @brief System shutdown. The host on which you are
running has just been rebooted. Free your datastructures and
return now !*/
- MSG_TASK_CANCELED = 8, /**< @brief Canceled task. This task has been canceled by somebody!*/
+ MSG_TASK_CANCELED = 8 /**< @brief Canceled task. This task has been canceled by somebody!*/
} MSG_error_t;
/** @} */
typedef enum {
SD_TASK_NOT_TYPED = 0, /**< @brief no specified type */
SD_TASK_COMM_E2E = 1, /**< @brief end to end communication */
- SD_TASK_COMP_SEQ = 2, /**< @brief sequential computation */
+ SD_TASK_COMP_SEQ = 2 /**< @brief sequential computation */
} e_SD_task_kind_t;
SIMIX_DST_HOST_FAILURE,
SIMIX_SRC_TIMEOUT,
SIMIX_DST_TIMEOUT,
- SIMIX_LINK_FAILURE,
+ SIMIX_LINK_FAILURE
} e_smx_state_t;
/** @} */
request->peer.name = NULL;
request->peer.port = xbt_socket_my_port(measMasterIn);
XBT_DEBUG
- ("Handshaking with %s:%d to connect it back on my %d (bufsize=%ld, msg_size=%ld, msg_amount=%ld)",
+ ("Handshaking with %s:%d to connect it back on my %d (bufsize=%lu, msg_size=%lu, msg_amount=%lu)",
xbt_socket_peer_name(peer), xbt_socket_peer_port(peer),
request->peer.port, request->buf_size, request->msg_size,
request->msg_amount);
xbt_socket_peer_name(peer), request_ack->peer.port);
}
XBT_DEBUG
- ("Got ACK; conduct the experiment (msg_size = %ld, msg_amount=%ld)",
+ ("Got ACK; conduct the experiment (msg_size = %lu, msg_amount=%lu)",
request->msg_size, request->msg_amount);
*sec = 0;
- XBT_DEBUG("Ask for a BW test between %s:%d and %s:%d", from_name, from_port,
+ XBT_DEBUG("Ask for a BW test between %s:%u and %s:%u", from_name, from_port,
to_name, to_port);
gras_msg_rpccall(sock, 20 * 60, "BW request", &request, &result);
if (bw)
*bw = result->bw;
- XBT_VERB("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)",
+ XBT_VERB("BW test (%s:%u -> %s:%u) took %f sec (%f kb/s)",
from_name, from_port, to_name, to_port,
result->sec, ((double) result->bw) / 1024.0);
xbt_socket_t peer, asker;
asker = gras_msg_cb_ctx_from(ctx);
- XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %ld %ld)",
+ XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %lu %lu)",
xbt_socket_peer_name(asker), xbt_socket_peer_port(asker),
request->peer.name, request->peer.port,
request->msg_size, request->msg_amount);
xbt_socket_t sock;
sat_request_t request = xbt_new(s_sat_request_t, 1);
- XBT_VERB("Start from_name %s:%d -> to_name %s:%d",
+ XBT_VERB("Start from_name %s:%u -> to_name %s:%u",
from_name, from_port, to_name, to_port);
sock = gras_socket_client(from_name, from_port);
/* Negociate the saturation with the peer */
sat_request_t request = xbt_new(s_sat_request_t, 1);
- XBT_DEBUG("Begin to saturate to %s:%d", to_name, to_port);
+ XBT_DEBUG("Begin to saturate to %s:%u", to_name, to_port);
memset(&msg_got, 0, sizeof(msg_got));
request->msg_size = msg_size;
1, /* at least one sec */
&sec, &bw);
msg_size = request->msg_size = (int) bw;
- XBT_DEBUG("Saturate with packets of %d bytes", request->msg_size);
+ XBT_DEBUG("Saturate with packets of %u bytes", request->msg_size);
}
/* Launch the saturation */
free(request);
gras_socket_close(peer_cmd);
- XBT_INFO("Saturation(%s:%d->%s:%d) started", gras_os_myname(),
+ XBT_INFO("Saturation(%s:%d->%s:%u) started", gras_os_myname(),
gras_os_myport(), to_name, to_port);
/* Start experiment */
/* Check whether the experiment has to be terminated by now */
elapsed = gras_os_time() - start;
- XBT_DEBUG("elapsed %f duration %f (msg_size=%d)", elapsed, duration,
+ XBT_DEBUG("elapsed %f duration %f (msg_size=%u)", elapsed, duration,
msg_size);
} while (saturate_further && (duration == 0 || elapsed < duration));
bw_res_t answer = xbt_new(s_bw_res_t, 1);
s_gras_msg_cb_ctx_t ctx;
- XBT_INFO("Saturation from %s:%d to %s:%d stopped by %s:%d",
+ XBT_INFO("Saturation from %s:%d to %s:%u stopped by %s:%d",
gras_os_myname(), gras_os_myport(), to_name, to_port,
xbt_socket_peer_name(msg_got.expe),
xbt_socket_peer_port(msg_got.expe));
free(answer);
} else {
XBT_INFO
- ("Saturation from %s:%d to %s:%d elapsed after %f sec (achieving %f kb/s)",
+ ("Saturation from %s:%d to %s:%u elapsed after %f sec (achieving %f kb/s)",
gras_os_myname(), gras_os_myport(), to_name, to_port, elapsed,
bw / 1024.0);
}
{
xbt_socket_t sock = gras_socket_client(from_name, from_port);
bw_res_t answer;
- XBT_VERB("Ask %s:%d to stop the saturation", from_name, from_port);
+ XBT_VERB("Ask %s:%u to stop the saturation", from_name, from_port);
TRY {
gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
}
CATCH_ANONYMOUS {
- RETHROWF("Cannot ask %s:%d to stop saturation: %s", from_name, from_port);
+ RETHROWF("Cannot ask %s:%u to stop saturation: %s", from_name, from_port);
}
gras_socket_close(sock);
if (time)
volatile unsigned int cpt2 = cpt;
if (!ran_ok) {
XBT_DEBUG
- ("Use the callback #%d (@%p) for incomming msg '%s' (payload_size=%d)",
+ ("Use the callback #%u (@%p) for incomming msg '%s' (payload_size=%d)",
cpt + 1, cb, msg.type->name, msg.payl_size);
if (!cb(&ctx, msg.payl)) {
/* cb handled the message */
ran_ok = 1;
} else {
RETHROWF
- ("Callback #%d (@%p) to message '%s' (payload size: %d) raised an exception: %s",
+ ("Callback #%u (@%p) to message '%s' (payload size: %d) raised an exception: %s",
cpt + 1, cb, msg.type->name, msg.payl_size);
}
}
default:
THROWF(unknown_error, 0,
- "Cannot handle messages of kind %d yet", msg.type->kind);
+ "Cannot handle messages of kind %d yet", (int)msg.type->kind);
}
}
}
}
if (!found)
- XBT_VERB("Ignoring removal of unexisting callback to msg id %d",
+ XBT_VERB("Ignoring removal of unexisting callback to msg id %u",
msgtype->code);
}
break;
default:
- THROWF(unknown_error, 0, "Unknown msg kind %d", kind);
+ THROWF(unknown_error, 0, "Unknown msg kind %d", (int)kind);
}
xbt_datadesc_send(sock, string_type, &msgtype->name);
xbt_dynar_foreach(_gras_rpc_cancelled, cursor, rpc_ctx) {
if (msg->ID == rpc_ctx->ID && msg->kind == e_gras_msg_kind_rpcanswer) {
XBT_VERB
- ("Got an answer to the already canceled (timeouted?) RPC %ld. Ignore it (leaking the payload!).",
+ ("Got an answer to the already canceled (timeouted?) RPC %lu. Ignore it (leaking the payload!).",
msg->ID);
xbt_dynar_cursor_rm(_gras_rpc_cancelled, &cursor);
return 1;
_gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx), NULL);
xbt_dynar_push(_gras_rpc_cancelled, &ctx);
XBT_INFO
- ("canceled RPC %ld pushed onto the stack (%s from %s:%d) Reason: %s",
+ ("canceled RPC %lu pushed onto the stack (%s from %s:%d) Reason: %s",
ctx->ID, ctx->msgtype->name,
xbt_socket_peer_name(ctx->expeditor),
xbt_socket_peer_port(ctx->expeditor), e.msg);
memcpy(&e, received.payl, received.payl_size);
free(received.payl);
XBT_VERB("Raise a remote exception cat:%d coming from %s (%s)",
- e.category, e.host, e.msg);
+ (int)e.category, e.host, e.msg);
__xbt_running_ctx_fetch()->exception.msg = e.msg;
__xbt_running_ctx_fetch()->exception.category = e.category;
__xbt_running_ctx_fetch()->exception.value = e.value;
sock_data->rdv_client : sock_data->rdv_server);
xbt_dynar_push(comms, &(sock_data->comm_recv));
}
- XBT_VERB("Wait on %ld 'sockets'", xbt_dynar_length(comms));
+ XBT_VERB("Wait on %lu 'sockets'", xbt_dynar_length(comms));
/* Wait for the end of any of these communications */
got = simcall_comm_waitany(comms);
for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
_xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
if (sock == sock_iter) {
- XBT_DEBUG("remove sock cursor %d dize %lu\n", cursor,
+ XBT_DEBUG("remove sock cursor %u dize %lu\n", cursor,
xbt_dynar_length(sockets));
xbt_dynar_cursor_rm(sockets, &cursor);
if (sock->plugin->socket_close)
{
xbt_assert(sock->outgoing, "Cannot write on client file socket");
- xbt_assert(size >= 0, "Cannot send a negative amount of data");
while (size) {
int status = 0;
xbt_assert(sock, "Cannot recv on an NULL socket");
xbt_assert(sock->incoming, "Cannot recv on client file socket");
- xbt_assert(size >= 0, "Cannot receive a negative amount of data");
if (sock->recvd) {
data[0] = sock->recvd_val;
int status = 0;
status = read(sock->sd, data + got, (long int) size);
- XBT_DEBUG("read(%d, %p, %ld);", sock->sd, data + got, size);
+ XBT_DEBUG("read(%d, %p, %lu);", sock->sd, data + got, size);
if (status < 0) {
THROWF(system_error, 0, "read(%d,%p,%d) failed: %s",
if (sock->incoming && !sock->outgoing && sockdata->server_port >= 0) {
/* server mode socket. Unregister it from 'OS' tables */
xbt_dynar_foreach(hd->ports, cpt, pr) {
- XBT_DEBUG("Check pr %d of %lu", cpt, xbt_dynar_length(hd->ports));
+ XBT_DEBUG("Check pr %u of %lu", cpt, xbt_dynar_length(hd->ports));
if (pr->port == sockdata->server_port) {
xbt_dynar_cursor_rm(hd->ports, &cpt);
XBT_OUT();
xbt_dynar_foreach(_gras_procdata_fabrics, cursor, fab) {
if (cursor + 1 <= xbt_set_length(pd->libdata)) {
- XBT_DEBUG("Skip fabric %d: there is already %ld libdata",
+ XBT_DEBUG("Skip fabric %u: there is already %lu libdata",
cursor, xbt_set_length(pd->libdata));
continue; /* allow to recall this function to get recently added fabrics */
}
- XBT_DEBUG("Go ahead for cursor %d, there is %ld libdata",
+ XBT_DEBUG("Go ahead for cursor %u, there is %lu libdata",
cursor, xbt_set_length(pd->libdata));
- xbt_assert(fab.name, "Name of fabric #%d is NULL!", cursor);
+ xbt_assert(fab.name, "Name of fabric #%u is NULL!", cursor);
XBT_DEBUG("Create the procdata for %s", fab.name);
/* Check for our own errors */
unsigned int cpt;
s_gras_msg_t msg;
XBT_WARN
- ("process %d terminated, but %ld messages are still queued. Message list:",
+ ("process %d terminated, but %lu messages are still queued. Message list:",
gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
XBT_WARN(" Message %s (%s) from %s@%s:%d", msg.type->name,
SG_BEGIN_DECL()
-typedef enum { NONE, DRAND48, RAND, RNGSTREAM } Generator;
+typedef enum { NONE, DRAND48, RAND, RNGSTREAM } e_random_generator_t;
typedef struct random_data_desc {
long int seed;
double max, min;
double mean, std; /* note: mean and standard deviation are normalized */
- Generator generator;
+ e_random_generator_t generator;
} s_random_data_t, *random_data_t;
XBT_PUBLIC_DATA(xbt_dict_t) random_data_list;
XBT_PUBLIC(double) random_generate(random_data_t random);
-XBT_PUBLIC(random_data_t) random_new(Generator generator, long int seed,
+XBT_PUBLIC(random_data_t) random_new(e_random_generator_t generator,
+ long int seed,
double min, double max, double mean,
double stdDeviation);
SURF_NETWORK_ELEMENT_NULL = 0, /* NULL */
SURF_NETWORK_ELEMENT_HOST, /* host type */
SURF_NETWORK_ELEMENT_ROUTER, /* router type */
- SURF_NETWORK_ELEMENT_AS, /* AS type */
+ SURF_NETWORK_ELEMENT_AS /* AS type */
} e_surf_network_element_type_t;
XBT_PUBLIC(e_surf_network_element_type_t)
lmm_system_t system,
double constraint_value,
tmgr_history_t history,
- int state_init,
+ e_surf_resource_state_t state_init,
tmgr_trace_t state_trace,
double metric_peak,
tmgr_trace_t metric_trace)
TYPE_LINK,
TYPE_CONTAINER,
TYPE_STATE,
- TYPE_EVENT,
+ TYPE_EVENT
} e_entity_types;
typedef struct s_type *type_t;
INSTR_AS,
INSTR_SMPI,
INSTR_MSG_PROCESS,
- INSTR_MSG_TASK,
+ INSTR_MSG_TASK
} e_container_types;
typedef struct s_container *container_t;
if (action_fp) { // A unique trace file
while ((evt = action_get_action(argv[0]))) {
- msg_action_fun function = xbt_dict_get(action_funs, evt[1]);
+ msg_action_fun function =
+ (msg_action_fun)xbt_dict_get(action_funs, evt[1]);
function(evt);
free(evt);
}
xbt_replay_trace_reader_t reader = xbt_replay_trace_reader_new(argv[1]);
while ((evt=xbt_replay_trace_reader_get(reader))) {
if (!strcmp(argv[0],evt[0])) {
- msg_action_fun function = xbt_dict_get(action_funs, evt[1]);
+ msg_action_fun function =
+ (msg_action_fun)xbt_dict_get(action_funs, evt[1]);
function(evt);
free(evt);
} else {
static const char **action_get_action(char *name)
{
- ssize_t read;
xbt_dynar_t evt = NULL;
char *evtname = NULL;
}
// Read lines until I reach something for me (which breaks in loop body)
// or end of file reached
- while ((read = getline(&action_line, &action_len, action_fp)) != -1) {
+ while (getline(&action_line, &action_len, action_fp) != -1) {
// cleanup and split the string I just read
char *comment = strchr(action_line, '#');
if (comment != NULL)
simdata->isused=0;
- XBT_DEBUG("Execution task '%s' finished in state %d", task->name, comp_state);
+ XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
if (comp_state == SIMIX_DONE) {
/* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
simdata->computation_amount = 0.0;
comp_state = simcall_host_execution_wait(simdata->compute);
p_simdata->waiting_action = NULL;
- XBT_DEBUG("Finished waiting for execution of action %p, state = %d", simdata->compute, comp_state);
+ XBT_DEBUG("Finished waiting for execution of action %p, state = %d", simdata->compute, (int)comp_state);
simdata->isused=0;
unsigned int cursor;
SD_task_t task;
xbt_dynar_foreach(result, cursor, task) {
- XBT_INFO("Task %d", cursor);
+ XBT_INFO("Task %u", cursor);
SD_task_dump(task);
}
}
xbt_dict_foreach(files, cursor, name, file) {
unsigned int cpt1, cpt2;
- SD_task_t newfile = NULL;
+ SD_task_t newfile;
SD_dependency_t depbefore, depafter;
if (xbt_dynar_is_empty(file->tasks_before)) {
xbt_dynar_foreach(file->tasks_after, cpt2, depafter) {
- SD_task_t newfile =
- SD_task_create_comm_e2e(file->name, NULL, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, root_task, newfile);
SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
#ifdef HAVE_TRACING
}
} else if (xbt_dynar_is_empty(file->tasks_after)) {
xbt_dynar_foreach(file->tasks_before, cpt2, depbefore) {
- SD_task_t newfile =
- SD_task_create_comm_e2e(file->name, NULL, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
SD_task_dependency_add(NULL, NULL, newfile, end_task);
#ifdef HAVE_TRACING
("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
file->name, depbefore->src->name);
}
- newfile =
- SD_task_create_comm_e2e(file->name, NULL, file->amount);
+ newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
#ifdef HAVE_TRACING
}
}
XBT_INFO(" - amount: %.0f", SD_task_get_amount(task));
- XBT_INFO(" - Dependencies to satisfy: %d", task->unsatisfied_dependencies);
+ XBT_INFO(" - Dependencies to satisfy: %u", task->unsatisfied_dependencies);
if (!xbt_dynar_is_empty(task->tasks_before)) {
XBT_INFO(" - pre-dependencies:");
xbt_dynar_foreach(task->tasks_before, counter, dependency) {
xbt_assert(__SD_task_is_runnable_or_in_fifo(task),
"Task '%s' is not runnable or in a fifo! Task state: %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
__SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */
__SD_task_set_state(task, SD_RUNNING);
xbt_assert(__SD_task_is_running(task), "Bad state of task '%s': %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
}
xbt_assert(__SD_task_is_runnable(task),
"Task '%s' is not runnable! Task state: %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
for (i = 0; i < task->workstation_nb; i++) {
}
__SD_task_set_state(task, SD_IN_FIFO);
xbt_assert(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
- SD_task_get_name(task), SD_task_get_state(task));
+ SD_task_get_name(task), (int)SD_task_get_state(task));
XBT_DEBUG("Task '%s' state is now SD_IN_FIFO", SD_task_get_name(task));
} else {
__SD_task_really_run(task);
xbt_assert(__SD_task_is_running(task),
"The task must be running! Task state: %d",
- SD_task_get_state(task));
+ (int)SD_task_get_state(task));
xbt_assert(task->workstation_list != NULL,
"Task '%s': workstation_list is NULL!",
SD_task_get_name(task));
for (i = 0; i < task->workstation_nb; i++) {
workstation = task->workstation_list[i];
XBT_DEBUG("Workstation '%s': access_mode = %d",
- SD_workstation_get_name(workstation), workstation->access_mode);
+ SD_workstation_get_name(workstation), (int)workstation->access_mode);
if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
xbt_assert(workstation->task_fifo != NULL,
"Workstation '%s' has sequential access but no fifo!",
xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
}
XBT_DEBUG("Candidate in fifo: %p", candidate);
xbt_assert(__SD_task_is_in_fifo(candidate),
"Bad state of candidate '%s': %d",
- SD_task_get_name(candidate), SD_task_get_state(candidate));
+ SD_task_get_name(candidate), (int)SD_task_get_state(candidate));
for (j = 0; j < candidate->workstation_nb && can_start; j++) {
workstation = candidate->workstation_list[j];
/* finally execute the task */
XBT_DEBUG("Task '%s' state: %d", SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
__SD_task_really_run(candidate);
XBT_DEBUG
xbt_assert(__SD_task_is_running(candidate),
"Bad state of task '%s': %d",
SD_task_get_name(candidate),
- SD_task_get_state(candidate));
+ (int)SD_task_get_state(candidate));
XBT_DEBUG("Okay, the task is running.");
} /* can start */
);
#elif PROCESSOR_x86_64
__asm__ (
-#if defined(APPLE) || defined(_WIN32)
+#if defined(APPLE)
".text\n"
".globl _raw_makecontext\n"
"_raw_makecontext:\n"
+#elif defined(_WIN32)
+ ".text\n"
+ ".globl raw_makecontext\n"
+ "raw_makecontext:\n"
#else
".text\n"
".globl raw_makecontext\n"
);
__asm__ (
-#if defined(APPLE) || defined(_WIN32)
+#if defined(APPLE)
".text\n"
".globl _raw_swapcontext\n"
"_raw_swapcontext:\n"
+#elif defined(_WIN32)
+ ".text\n"
+ ".globl raw_swapcontext\n"
+ "raw_swapcontext:\n"
#else
".text\n"
".globl raw_swapcontext\n"
xbt_assert(simix_global,
"SIMIX_global_init has to be called before SIMIX_get_registered_function.");
- res = xbt_dict_get_or_null(simix_global->registered_functions, name);
+ res = (xbt_main_func_t)xbt_dict_get_or_null(simix_global->registered_functions, name);
return res ? res : default_function;
}
action_description = "I/O";
break;
}
- XBT_INFO("Process %ld (%s@%s): waiting for %s action %p (%s) in state %d to finish",
+ XBT_INFO("Process %lu (%s@%s): waiting for %s action %p (%s) in state %d to finish",
process->pid, process->name, process->smx_host->name,
action_description, process->waiting_action,
- process->waiting_action->name, process->waiting_action->state);
+ process->waiting_action->name, (int)process->waiting_action->state);
}
else {
- XBT_INFO("Process %ld (%s@%s)", process->pid, process->name, process->smx_host->name);
+ XBT_INFO("Process %lu (%s@%s)", process->pid, process->name, process->smx_host->name);
}
}
}
{
smx_action_t action = simcall->host_execution_wait.execution;
- XBT_DEBUG("Wait for execution of action %p, state %d", action, action->state);
+ XBT_DEBUG("Wait for execution of action %p, state %d", action, (int)action->state);
/* Associate this simcall to the action */
xbt_fifo_push(action->simcalls, simcall);
default:
xbt_die("Internal error in SIMIX_execution_finish: unexpected action state %d",
- action->state);
+ (int)action->state);
}
simcall->issuer->waiting_action = NULL;
simcall->host_execution_wait.result = action->state;
default:
xbt_die("Internal error in SIMIX_io_finish: unexpected action state %d",
- action->state);
+ (int)action->state);
}
simcall->issuer->waiting_action = NULL;
SIMIX_simcall_answer(simcall);
}
XBT_DEBUG("Sorry, communication action %p does not match our needs:"
" its type is %d but we are looking for a comm of type %d",
- action, action->comm.type, type);
+ action, (int)action->comm.type, (int)type);
}
XBT_DEBUG("No matching communication action found");
return NULL;
void SIMIX_comm_destroy(smx_action_t action)
{
XBT_DEBUG("Destroy action %p (refcount: %d), state: %d",
- action, action->comm.refcount, action->state);
+ action, action->comm.refcount, (int)action->state);
if (action->comm.refcount <= 0) {
xbt_backtrace_display_current();
if (action->comm.rdv)
SIMIX_rdv_remove(action->comm.rdv, action);
- XBT_DEBUG("SIMIX_comm_finish: action state = %d", action->state);
+ XBT_DEBUG("SIMIX_comm_finish: action state = %d", (int)action->state);
/* Check out for errors */
switch (action->state) {
break;
default:
- xbt_die("Unexpected action state in SIMIX_comm_finish: %d", action->state);
+ xbt_die("Unexpected action state in SIMIX_comm_finish: %d", (int)action->state);
}
/* if there is an exception during a waitany or a testany, indicate the position of the failed communication */
action->state = SIMIX_DONE;
XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d",
- action, action->state, action->comm.src_proc, action->comm.dst_proc, action->comm.detached);
+ action, (int)action->state, action->comm.src_proc, action->comm.dst_proc, action->comm.detached);
/* destroy the surf actions associated with the Simix communication */
SIMIX_comm_destroy_internal_actions(action);
/**
\brief Executes all the processes to run (in parallel if possible).
*/
-static XBT_INLINE void SIMIX_context_runall()
+static XBT_INLINE void SIMIX_context_runall(void)
{
simix_global->context_factory->runall();
}
if (action->comm.src_proc == process) {
XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p",
- action, action->comm.detached, action->state, action->comm.src_proc, action->comm.dst_proc);
+ action, action->comm.detached, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
action->comm.src_proc = NULL;
if (action->comm.detached) {
}
else if (action->comm.dst_proc == process){
XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p",
- action, action->state, action->comm.src_proc, action->comm.dst_proc);
+ action, (int)action->state, action->comm.src_proc, action->comm.dst_proc);
action->comm.dst_proc = NULL;
if (action->comm.detached && action->comm.refcount == 1
}
}
- SIMIX_context_runall(simix_global->process_to_run);
+ SIMIX_context_runall();
SIMIX_process_empty_trash();
}
default:
xbt_die("Internal error in SIMIX_process_suspend: unexpected action type %d",
- process->waiting_action->type);
+ (int)process->waiting_action->type);
}
}
}
default:
xbt_die("Internal error in SIMIX_process_resume: unexpected action type %d",
- process->waiting_action->type);
+ (int)process->waiting_action->type);
}
}
else {
{
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), self->simcall.call);
+ SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
SIMIX_process_yield(self);
} else {
SIMIX_simcall_pre(&self->simcall, 0);
void SIMIX_simcall_answer(smx_simcall_t simcall)
{
if (simcall->issuer != simix_global->maestro_process){
- XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), simcall->call,
+ XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
simcall->issuer->name, simcall->issuer);
simcall->issuer->simcall.call = SIMCALL_NONE;
xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, simcall->issuer);
/** @brief Initialize a semaphore */
smx_sem_t SIMIX_sem_init(unsigned int value)
{
- XBT_IN("(%d)",value);
+ XBT_IN("(%u)",value);
s_smx_process_t p;
smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
}
static double cpu_share_resources_full(double now) {
- surf_action_cpu_Cas01_t action;
+ s_surf_action_cpu_Cas01_t action;
return generic_maxmin_share_resources(surf_cpu_model->states.running_action_set,
- xbt_swag_offset(*action, generic_lmm_action.variable),
+ xbt_swag_offset(action, generic_lmm_action.variable),
cpu_maxmin_system, lmm_solve);
}
cpu->state_current = SURF_RESOURCE_ON;
else {
lmm_constraint_t cnst = cpu->constraint;
- lmm_variable_t var = NULL;
- lmm_element_t elem = NULL;
cpu->state_current = SURF_RESOURCE_OFF;
}
static void heap_remove(surf_action_network_CM02_t action){
- action->hat = NONE;
+ action->hat = NOTSET;
if(((surf_action_network_CM02_t) action)->index_heap >= 0){
xbt_heap_remove(net_action_heap,action->index_heap);
}
#endif
-static double custom_random(Generator generator, long int *seed)
+static double custom_random(e_random_generator_t generator, long int *seed)
{
switch (generator) {
return X * (random->max - random->min) + random->min;
}
-random_data_t random_new(Generator generator, long int seed,
+random_data_t random_new(e_random_generator_t generator, long int seed,
double min, double max, double mean, double std)
{
random_data_t random = xbt_new0(s_random_data_t, 1);
}
surf_min_index = 0;
+
if (surf_get_nthreads() > 1) {
/* parallel version */
+#ifdef CONTEXT_THREADS
xbt_parmap_apply(surf_parmap, (void_f_pvoid_t) surf_share_resources, model_list);
+#endif
}
else {
/* sequential version */
if (surf_get_nthreads() > 1) {
/* parallel version */
+#ifdef CONTEXT_THREADS
xbt_parmap_apply(surf_parmap, (void_f_pvoid_t) surf_update_actions_state, model_list);
+#endif
}
else {
/* sequential version */
typedef enum {
UM_FULL,
UM_LAZY,
- UM_UNDEFINED,
+ UM_UNDEFINED
} e_UM_t;
/* user-visible parameters */
for (cpt = 0; routing_models[cpt].name; cpt++)
fprintf(stderr, " %s: %s\n", routing_models[cpt].name,
routing_models[cpt].desc);
- xbt_die(NULL);
+ xbt_die("dying");
}
/* make a new routing component */
int start, end;
xbt_dynar_t radical_ends;
- random->generator = A_surfxml_random_generator;
+ switch (A_surfxml_random_generator) {
+ case AU_surfxml_random_generator:
+ case A_surfxml_random_generator_NONE:
+ random->generator = NONE;
+ break;
+ case A_surfxml_random_generator_DRAND48:
+ random->generator = DRAND48;
+ break;
+ case A_surfxml_random_generator_RAND:
+ random->generator = RAND;
+ break;
+ case A_surfxml_random_generator_RNGSTREAM:
+ random->generator = RNGSTREAM;
+ break;
+ default:
+ surf_parse_error("Invalid random generator");
+ break;
+ }
random->seed = seed;
random->min = min;
random->max = max;
XBT_DEBUG
("id = '%s' min = '%f' max = '%f' mean = '%f' std_deviatinon = '%f' generator = '%d' seed = '%ld' radical = '%s'",
random_id, random->min, random->max, random->mean, random->std,
- random->generator, random->seed, random_radical);
+ (int)random->generator, random->seed, random_radical);
if (!random_value)
random_value = xbt_dict_new_homogeneous(free);
/* set the size of table routing */
size_t table_size = xbt_dict_length(rc->to_index);
int *src_id, *dst_id;
- int i,j;
src_id = xbt_dict_get_or_null(rc->to_index, src);
dst_id = xbt_dict_get_or_null(rc->to_index, dst);
if(!as->link_table)
{
+ int i,j;
/* Create Cost, Predecessor and Link tables */
as->cost_table = xbt_new0(double, table_size * table_size); /* link cost from host to host */
as->predecessor_table = xbt_new0(int, table_size * table_size); /* predecessor host numbers */
#define parse_method(type,name) \
void type##Tag_surfxml_##name(void) \
{ surfxml_call_cb_functions(type##Tag_surfxml_##name##_cb_list); }
-parse_method(E, route);
-parse_method(E, link_ctn);
-parse_method(E, process);
-parse_method(E, argument);
-parse_method(E, prop);
-parse_method(E, trace);
-parse_method(E, trace_connect);
-parse_method(E, random);
-parse_method(E, ASroute);
-parse_method(E, bypassRoute);
+parse_method(E, route)
+parse_method(E, link_ctn)
+parse_method(E, process)
+parse_method(E, argument)
+parse_method(E, prop)
+parse_method(E, trace)
+parse_method(E, trace_connect)
+parse_method(E, random)
+parse_method(E, ASroute)
+parse_method(E, bypassRoute)
/* Open and Close parse file */
return power_scale;
}
-double random_min, random_max, random_mean, random_std_deviation,
- random_generator;
+double random_min, random_max, random_mean, random_std_deviation;
+e_random_generator_t random_generator;
char *random_id;
static void init_randomness(void)
random_max = surf_parse_get_double(A_surfxml_random_max);
random_mean = surf_parse_get_double(A_surfxml_random_mean);
random_std_deviation = surf_parse_get_double(A_surfxml_random_std_deviation);
- random_generator = A_surfxml_random_generator;
+ switch (A_surfxml_random_generator) {
+ case AU_surfxml_random_generator:
+ case A_surfxml_random_generator_NONE:
+ random_generator = NONE;
+ break;
+ case A_surfxml_random_generator_DRAND48:
+ random_generator = DRAND48;
+ break;
+ case A_surfxml_random_generator_RAND:
+ random_generator = RAND;
+ break;
+ case A_surfxml_random_generator_RNGSTREAM:
+ random_generator = RNGSTREAM;
+ break;
+ default:
+ surf_parse_error("Invalid random generator");
+ break;
+ }
}
static void add_randomness(void)
static int ws_link_shared(const void *link)
{
- return surf_network_model->extension.network.get_link_latency(link);
+ return surf_network_model->extension.network.link_shared(link);
}
static void ws_finalize(void)
typedef enum {
SURF_WORKSTATION_RESOURCE_CPU,
- SURF_WORKSTATION_RESOURCE_LINK,
+ SURF_WORKSTATION_RESOURCE_LINK
} e_surf_workstation_model_type_t;
/**************************************/
/* to extract the addresses from the backtrace */
char **addrs;
- char buff[256], *p;
+ char buff[256];
/* To read the output of addr2line */
FILE *pipe;
/* build the commandline */
if (stat(xbt_binary_name, &stat_buf)) {
/* Damn. binary not in current dir. We'll have to dig the PATH to find it */
- int i;
-
for (i = 0; environ[i]; i++) {
if (!strncmp("PATH=", environ[i], 5)) {
xbt_dynar_t path = xbt_str_split(environ[i] + 5, ":");
addrs = xbt_new(char *, e->used);
for (i = 0; i < e->used; i++) {
+ char *p;
/* retrieve this address */
XBT_DEBUG("Retrieving address number %d from '%s'", i, backtrace_syms[i]);
snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
*cfg = xbt_cfg_new();
xbt_assert(type >= xbt_cfgelm_int && type <= xbt_cfgelm_peer,
"type of %s not valid (%d should be between %d and %d)",
- name, type, xbt_cfgelm_int, xbt_cfgelm_peer);
+ name, (int)type, xbt_cfgelm_int, xbt_cfgelm_peer);
res = xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
if (res) {
res = xbt_new(s_xbt_cfgelm_t, 1);
XBT_DEBUG("Register cfg elm %s (%s) (%d to %d %s (=%d) @%p in set %p)",
- name, desc, min, max, xbt_cfgelm_type_name[type], type, res,
+ name, desc, min, max, xbt_cfgelm_type_name[type], (int)type, res,
*cfg);
res->desc = xbt_strdup(desc);
break;
default:
- XBT_ERROR("%d is an invalide type code", type);
+ XBT_ERROR("%d is an invalide type code", (int)type);
}
xbt_dict_set((xbt_dict_t) * cfg, name, res, NULL);
"; Should be <name>:<min nb>_to_<max nb>_<type>");
tok++;
- for (type = 0;
+ for (type = (e_xbt_cfgelm_type_t)0;
type < xbt_cfgelm_type_count
&& strcmp(tok, xbt_cfgelm_type_name[type]); type++);
xbt_assert(type < xbt_cfgelm_type_count,
"Can't get the type of '%s' since this variable does not exist",
name);
- XBT_INFO("type in variable = %d", variable->type);
+ XBT_INFO("type in variable = %d", (int)variable->type);
return variable->type;
}
char *str;
int i;
double d;
- e_xbt_cfgelm_type_t type = 0; /* Set a dummy value to make gcc happy. It cannot get uninitialized */
+ e_xbt_cfgelm_type_t type = xbt_cfgelm_any; /* Set a dummy value to make gcc happy. It cannot get uninitialized */
xbt_ex_t e;
break;
default:
- xbt_die("Config element variable %s not valid (type=%d)", name, type);
+ xbt_die("Config element variable %s not valid (type=%d)", name, (int)type);
}
}
variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
XBT_DEBUG("Variable: %d to %d %s (=%d) @%p",
variable->min, variable->max,
- xbt_cfgelm_type_name[variable->type], variable->type, variable);
+ xbt_cfgelm_type_name[variable->type], (int)variable->type, variable);
if (variable->max == 1) {
if (!xbt_dynar_is_empty(variable->content)) {
unsigned int old = *(unsigned int *) data;
unsigned int new = xbt_cbps_i_pop(vars);
- XBT_DEBUG("push %d x %d as a size", old, new);
+ XBT_DEBUG("push %u x %u as a size", old, new);
xbt_cbps_i_push(vars, (int) (old * new));
}
unsigned long int old = *(unsigned long int *) data;
unsigned long int new = xbt_cbps_i_pop(vars);
- XBT_DEBUG("push %ld x %ld as a size", old, new);
+ XBT_DEBUG("push %lu x %lu as a size", old, new);
xbt_cbps_i_push(vars, (int) (old * new));
}
printf(" alignment[");
for (cpt = 0; cpt < xbt_arch_count; cpt++) {
- printf("%s%s%ld%s",
+ printf("%s%s%lu%s",
cpt > 0 ? ", " : "",
cpt == GRAS_THISARCH ? ">" : "",
ddt->alignment[cpt], cpt == GRAS_THISARCH ? "<" : "");
printf(" aligned_size[");
for (cpt = 0; cpt < xbt_arch_count; cpt++) {
- printf("%s%s%ld%s",
+ printf("%s%s%lu%s",
cpt > 0 ? ", " : "",
cpt == GRAS_THISARCH ? ">" : "",
ddt->aligned_size[cpt], cpt == GRAS_THISARCH ? "<" : "");
struct_data = ddt->category.struct_data;
xbt_dynar_foreach(struct_data.fields, cpt, field) {
- printf(">>> Dump field #%d (%s) (offset=%ld)\n",
+ printf(">>> Dump field #%u (%s) (offset=%ld)\n",
cpt, field->name, field->offset[GRAS_THISARCH]);
xbt_datadesc_type_dump(field->type);
- printf("<<< end dump field #%d (%s)\n", cpt, field->name);
+ printf("<<< end dump field #%u (%s)\n", cpt, field->name);
}
}
fflush(stdout);
field->name = (char *) strdup(name);
XBT_DEBUG("----------------");
- XBT_DEBUG("PRE s={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG("PRE s={size=%ld,align=%lu,asize=%lu}",
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
struct_type->aligned_size[GRAS_THISARCH]);
XBT_DEBUG("Push a %s into %s at offset %ld.",
field_type->name, struct_type->name,
field->offset[GRAS_THISARCH]);
- XBT_DEBUG(" f={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG(" f={size=%ld,align=%lu,asize=%lu}",
field_type->size[GRAS_THISARCH],
field_type->alignment[GRAS_THISARCH],
field_type->aligned_size[GRAS_THISARCH]);
- XBT_DEBUG(" s={size=%ld,align=%ld,asize=%ld}",
+ XBT_DEBUG(" s={size=%ld,align=%lu,asize=%lu}",
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
struct_type->aligned_size[GRAS_THISARCH]);
for (arch = 0; arch < xbt_arch_count; arch++) {
struct_type->size[arch] = struct_type->aligned_size[arch];
}
- XBT_DEBUG("structure %s closed. size=%ld,align=%ld,asize=%ld",
+ XBT_DEBUG("structure %s closed. size=%ld,align=%lu,asize=%lu",
struct_type->name,
struct_type->size[GRAS_THISARCH],
struct_type->alignment[GRAS_THISARCH],
}
if (d1->alignment[cpt] != d2->alignment[cpt]) {
- XBT_DEBUG("ddt_cmp: %s->alignment=%ld != %s->alignment=%ld (on %s)",
+ XBT_DEBUG("ddt_cmp: %s->alignment=%lu != %s->alignment=%lu (on %s)",
d1->name, d1->alignment[cpt], d2->name, d2->alignment[cpt],
xbt_arches[cpt].name);
return d1->alignment[cpt] > d2->alignment[cpt] ? 1 : -1;
if (d1->aligned_size[cpt] != d2->aligned_size[cpt]) {
XBT_DEBUG
- ("ddt_cmp: %s->aligned_size=%ld != %s->aligned_size=%ld (on %s)",
+ ("ddt_cmp: %s->aligned_size=%lu != %s->aligned_size=%lu (on %s)",
d1->name, d1->aligned_size[cpt], d2->name,
d2->aligned_size[cpt], xbt_arches[cpt].name);
return d1->aligned_size[cpt] > d2->aligned_size[cpt] ? 1 : -1;
field_desc_2 = field2->type;
ret = xbt_datadesc_type_cmp(field_desc_1, field_desc_2);
if (ret) {
- XBT_DEBUG("%s->field[%d]=%s != %s->field[%d]=%s",
+ XBT_DEBUG("%s->field[%u]=%s != %s->field[%u]=%s",
d1->name, cpt, field1->name, d2->name, cpt, field2->name);
return ret;
}
xbt_assert(int_type);
}
- XBT_DEBUG("send_int(%u)", *i);
+ XBT_DEBUG("send_int(%d)", *i);
xbt_trp_send(sock, (char *) i, int_type->size[GRAS_THISARCH], stable);
}
xbt_dd_convert_elm(int_type, 1, r_arch, ptr, i);
free(ptr);
}
- XBT_DEBUG("recv_int(%u)", *i);
+ XBT_DEBUG("recv_int(%d)", *i);
}
/*
if (XBT_LOG_ISENABLED(xbt_ddt_exchange, xbt_log_priority_verbose)) {
if (sub_type == xbt_datadesc_by_name("unsigned int")) {
- XBT_VERB("Copied value for field '%s': %d (type: unsigned int)",
+ XBT_VERB("Copied value for field '%s': %u (type: unsigned int)",
field->name, *(unsigned int *) field_dst);
} else if (sub_type == xbt_datadesc_by_name("int")) {
XBT_VERB("Copied value for field '%s': %d (type: int)",
} else if (sub_type ==
xbt_datadesc_by_name("unsigned long int")) {
XBT_VERB
- ("Copied value for field '%s': %ld (type: unsigned long int)",
+ ("Copied value for field '%s': %lu (type: unsigned long int)",
field->name, *(unsigned long int *) field_dst);
} else if (sub_type == xbt_datadesc_by_name("long int")) {
XBT_VERB("Copied value for field '%s': %ld (type: long int)",
type->name);
xbt_assert(field_num < xbt_dynar_length(union_data.fields),
- "union field selector of %s returned %d but there is only %lu fields",
+ "union field selector of %s returned %u but there is only %lu fields",
type->name, field_num,
xbt_dynar_length(union_data.fields));
array_count = array_data.fixed_size;
if (array_count == -1)
array_count = subsize;
- if (array_count == -1) {
+ if (array_count == -1)
array_count = array_data.dynamic_size(type, state, src);
- xbt_assert(array_count >= 0,
- "Invalid (negative) array size for type %s",
- type->name);
- }
/* send the content */
sub_type = array_data.type;
elm_size = sub_type->aligned_size[GRAS_THISARCH];
if (sub_type->category_code == e_xbt_datadesc_type_cat_scalar) {
- XBT_VERB("Array of %ld scalars, copy it in one shot", array_count);
+ XBT_VERB("Array of %lu scalars, copy it in one shot", array_count);
memcpy(dst, src,
sub_type->aligned_size[GRAS_THISARCH] * array_count);
count += sub_type->aligned_size[GRAS_THISARCH] * array_count;
&& sub_type->category.array_data.type->category_code ==
e_xbt_datadesc_type_cat_scalar) {
- XBT_VERB("Array of %ld fixed array of scalars, copy it in one shot",
+ XBT_VERB("Array of %lu fixed array of scalars, copy it in one shot",
array_count);
memcpy(dst, src,
sub_type->category.array_data.
* array_count * sub_type->category.array_data.fixed_size;
} else {
- XBT_VERB("Array of %ld stuff, copy it in one after the other",
+ XBT_VERB("Array of %lu stuff, copy it in one after the other",
array_count);
for (cpt = 0; cpt < array_count; cpt++) {
- XBT_VERB("Copy the %dth stuff out of %ld", cpt, array_count);
+ XBT_VERB("Copy the %uth stuff out of %lu", cpt, array_count);
count +=
xbt_datadesc_memcpy_rec(state, refs, sub_type, src_ptr,
dst_ptr, 0, detect_cycle
if (field.tm.is_ref)
PARSE_ERROR
("Not enough XBT_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
- field.name, field.tm.is_ref);
+ field.name, (int)field.tm.is_ref);
XBT_VERB("Append field '%s' to %p", field.name, (void *) struct_type);
xbt_datadesc_struct_append(struct_type, field.name, field.type);
xbt_dictelm_t current, previous = NULL;
xbt_assert(dict);
- XBT_DEBUG("ADD %.*s hash = %d, size = %d, & = %d", key_len, key, hash_code,
+ XBT_DEBUG("ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code,
dict->table_size, hash_code & dict->table_size);
current = dict->table[hash_code & dict->table_size];
while (current != NULL &&
continue;
if (size == 0)
continue;
- printf("%delm x %u cells; ", count, size);
+ printf("%uelm x %u cells; ", count, size);
}
}
printf("\n");
continue;
if (size == 0)
continue;
- printf("%delm x %d cells; ", count, size);
+ printf("%uelm x %d cells; ", count, size);
avg += count * size;
total_count += size;
}
xbt_dict_t head = NULL;
int i, j, k;
char *key;
- void *data;
srand((unsigned int) time(NULL));
xbt_test_add("Search my %d elements 20 times", NB_ELM);
key = xbt_malloc(10);
for (i = 0; i < 20; i++) {
+ void *data;
/* if (i%10) printf("."); else printf("%d",i/10); fflush(stdout); */
for (j = 0; j < NB_ELM; j++) {
}
if((d1->elmsize)!=(d2->elmsize))
{
- XBT_DEBUG("Size of elmsize d1=%ld d2=%ld",d1->elmsize,d2->elmsize);
+ XBT_DEBUG("Size of elmsize d1=%lu d2=%lu",d1->elmsize,d2->elmsize);
xbt_dynar_free(&d2);
return 1; // xbt_die
}
if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
{
- XBT_DEBUG("Size of dynar d1=%ld d2=%ld",xbt_dynar_length(d1),xbt_dynar_length(d2));
+ XBT_DEBUG("Size of dynar d1=%lu d2=%lu",xbt_dynar_length(d1),xbt_dynar_length(d2));
xbt_dynar_free(&d2);
return 1;
}
for (cursor = 0; cursor < NB_ELEM; cursor++) {
iptr = xbt_dynar_get_ptr(d, cursor);
xbt_test_assert(cursor == *iptr,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* 3. Traverse the dynar using the neat macro to that extend */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
/* 3. Traverse the dynar */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
xbt_dynar_set_as(d, cpt, int, cpt);
xbt_dynar_foreach(d, cursor, cpt)
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
for (cpt = 0; cpt < NB_ELEM; cpt++) {
int val;
xbt_dynar_remove_at(d,0,&val);
xbt_test_assert(cpt == val,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
xbt_test_assert(xbt_dynar_is_empty(d),
/* 3. Traverse the dynar */
xbt_dynar_foreach(d, cursor, cpt) {
xbt_test_assert(cursor == cpt,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
/* end_of_traversal */
int val;
xbt_dynar_remove_at(d,xbt_dynar_length(d)-1,&val);
xbt_test_assert(cpt == val,
- "The retrieved value is not the same than the injected one (%d!=%d)",
+ "The retrieved value is not the same than the injected one (%u!=%d)",
cursor, cpt);
}
xbt_test_assert(xbt_dynar_is_empty(d),
}
/* 2. Traverse the dynar with the macro */
xbt_dynar_foreach(d, iter, s1) {
- sprintf(buf, "%d", NB_ELEM - iter - 1);
+ sprintf(buf, "%u", NB_ELEM - iter - 1);
xbt_test_assert(!strcmp(buf, s1),
"The retrieved value is not the same than the injected one (%s!=%s)",
buf, s1);
XBT_TEST_UNIT("variables", test_variables, "variable value preservation")
{
xbt_ex_t ex;
- int r1, r2;
+ int r1;
+ int _XBT_GNUC_UNUSED r2;
volatile int v1, v2;
r1 = r2 = v1 = v2 = 1234;
xbt_dynar_t edges = xbt_graph_get_edges (span);
unsigned int cpt;
xbt_node_t node;
- fprintf (file, "%ld\n", xbt_dynar_length (nodes));
+ fprintf (file, "%lu\n", xbt_dynar_length (nodes));
xbt_dynar_foreach (nodes, cpt, node) {
if (nname){
fprintf (file, "%s\n", nname(node));
fprintf (file, "%p\n", node);
}
}
- fprintf (file, "%ld\n", xbt_dynar_length (edges));
+ fprintf (file, "%lu\n", xbt_dynar_length (edges));
xbt_edge_t edge;
xbt_dynar_foreach (edges, cpt, edge) {
xbt_node_t source = xbt_graph_edge_get_source (edge);
mdp = (struct mdesc *) mtemp.base;
mdp->fd = fd;
if(!mdp->refcount){
- sem_init(&mdp->sem, 1, 1);
+ sem_init(&mdp->sem, 0, 1);
mdp->refcount++;
}
}
if (mdp->fd < 0){
mdp->flags |= MMALLOC_ANONYMOUS;
- sem_init(&mdp->sem, 0, 1);
- }else{
- sem_init(&mdp->sem, 1, 1);
}
+ sem_init(&mdp->sem, 0, 1);
/* If we have not been passed a valid open file descriptor for the file
to map to, then open /dev/zero and use that to map to. */
/* Semaphore locking the access to the heap */
sem_t sem;
- char locked;
/* Number of processes that attached the heap */
unsigned int refcount;
* in a model-checking enabled tree. Without this protection, our malloc
* implementation will not like multi-threading AT ALL.
*/
-#define LOCK(mdp) do { \
- if (0 && mdp->locked) { \
- fprintf(stderr,"panic! deadlock detected because %s is not reintrant.\n",__FUNCTION__); \
- abort(); \
- } \
- sem_wait(&mdp->sem); \
- mdp->locked=1; \
- } while(0)
-
-#define UNLOCK(mdp) do { \
- sem_post(&mdp->sem); \
- mdp->locked=0; \
- } while (0)
+#define LOCK(mdp) sem_wait(&mdp->sem)
+#define UNLOCK(mdp) sem_post(&mdp->sem)
#endif /* __MMPRIVATE_H */
elm->ID = _xbt_set_get_id(set);
xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
xbt_dynar_set(set->dynar, elm->ID, &elm);
- XBT_DEBUG("Insertion of key '%s' (id %d)", elm->name, elm->ID);
+ XBT_DEBUG("Insertion of key '%s' (id %u)", elm->name, elm->ID);
xbt_ex_free(e);
}
if (found) {
if (elm == found_in_dict) {
XBT_DEBUG
- ("Ignoring request to insert the same element twice (key %s ; id %d)",
+ ("Ignoring request to insert the same element twice (key %s ; id %u)",
elm->name, elm->ID);
return;
} else {
elm->ID = found_in_dict->ID;
- XBT_DEBUG("Reinsertion of key %s (id %d)", elm->name, elm->ID);
+ XBT_DEBUG("Reinsertion of key %s (id %u)", elm->name, elm->ID);
xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm,
free_func);
xbt_dynar_set(set->dynar, elm->ID, &elm);
xbt_test_add("Search by name %s", key);
elm = (my_elem_t) xbt_set_get_by_name(head, key);
- xbt_test_log(" Found %s (under ID %d)\n",
+ xbt_test_log(" Found %s (under ID %u)\n",
elm ? elm->data : "(null)", elm ? elm->ID : -1);
if (strcmp(key, elm->name))
THROWF(mismatch_error, 0, "The key (%s) is not the one expected (%s)",
elm ? elm->name : "(null)", elm ? elm->data : "(null)");
if (id != elm->ID)
THROWF(mismatch_error, 0,
- "The found ID (%d) is not the one expected (%d)", elm->ID, id);
+ "The found ID (%u) is not the one expected (%d)", elm->ID, id);
if (strcmp(key, elm->name))
THROWF(mismatch_error, 0, "The key (%s) is not the one expected (%s)",
elm->name, key);
xbt_set_foreach(set, cursor, elm) {
xbt_test_assert(elm, "Dude ! Got a null elm during traversal!");
- xbt_test_log("Id(%d): %s->%s\n", elm->ID, elm->name, elm->data);
+ xbt_test_log("Id(%u): %s->%s\n", elm->ID, elm->name, elm->data);
xbt_test_assert(!strcmp(elm->name, elm->data),
"Key(%s) != value(%s). Abording", elm->name,
elm->data);
debuged_add(set, "12anew", "12anew");
elm = (my_elem_t) xbt_set_get_by_id(set, 1);
- xbt_test_assert(elm->ID == 1, "elm->ID is %d but should be 1", elm->ID);
+ xbt_test_assert(elm->ID == 1, "elm->ID is %u but should be 1", elm->ID);
xbt_set_free(&set);
}
{
unsigned int i, j;
- fprintf(stderr, ">>> Matrix %s dump (%d x %d)\n", name, matrix->lines,
+ fprintf(stderr, ">>> Matrix %s dump (%u x %u)\n", name, matrix->lines,
matrix->rows);
for (i = 0; i < matrix->lines; i++) {
fprintf(stderr, " ");
for (j = 0; j < matrix->rows; j++) {
if (coords)
- fprintf(stderr, " (%d,%d)=", i, j);
+ fprintf(stderr, " (%u,%u)=", i, j);
else
fprintf(stderr, " ");
display_fun(xbt_matrix_get_ptr(matrix, i, j));
unsigned int i, j;
XBT_DEBUG
- ("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
+ ("Copy a %ux%u submatrix from %ux%u(of %ux%u) to %ux%u (of %ux%u)",
lsize, rsize, lpos_src, rpos_src, src->lines, src->rows, lpos_dst,
rpos_dst, dst->lines, dst->rows);
unsigned int i, j, k;
xbt_assert(A->lines == C->lines,
- "A->lines != C->lines (%d vs %d)", A->lines, C->lines);
+ "A->lines != C->lines (%u vs %u)", A->lines, C->lines);
xbt_assert(B->rows == C->rows);
for (i = 0; i < C->lines; i++)
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
XBT_CDEBUG(xbt_trp_meas,
- "Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
+ "Sent %lu msgs of %lu (size of each: %lu) to %s:%d",
sent_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
peer->plugin->raw_send(peer, chunk, msg_size);
}
XBT_CDEBUG(xbt_trp_meas,
- "Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
+ "Sent %lu msgs of %lu (size of each: %lu) to %s:%d", sent_sofar,
msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
XBT_CDEBUG(xbt_trp_meas,
- "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
+ "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
(peer->plugin->raw_recv) (peer, chunk, msg_size);
}
XBT_CDEBUG(xbt_trp_meas,
- "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
+ "Recvd %lu msgs of %lu (size of each: %lu) from %s:%d",
got_sofar, msg_amount, msg_size, xbt_socket_peer_name(peer),
xbt_socket_peer_port(peer));
return;
}
/* Start all workers */
- XBT_DEBUG("Dopar for %ld elements", xbt_dynar_length(datas));
+ XBT_DEBUG("Dopar for %lu elements", xbt_dynar_length(datas));
xbt_dynar_foreach(datas, cursor, data) {
worker_data_t w = xbt_new0(s_worker_data_t, 1);
w->data = datas;
int status = 0;
status = tcp_write(sock->sd, data, (size_t) size);
- XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, size);
+ XBT_DEBUG("write(%d, %p, %lu);", sock->sd, data, size);
if (status < 0) {
#ifdef EWOULDBLOCK
#endif
continue;
- THROWF(system_error, 0, "write(%d,%p,%ld) failed: %s",
+ THROWF(system_error, 0, "write(%d,%p,%lu) failed: %s",
sock->sd, data, size, sock_errstr(sock_errno));
}
while (size > got) {
int status = 0;
- XBT_DEBUG("read(%d, %p, %ld) got %d so far (%s)",
+ XBT_DEBUG("read(%d, %p, %lu) got %d so far (%s)",
sock->sd, data + got, bufsize, got,
hexa_str((unsigned char *) data, got, 0));
status = tcp_read(sock->sd, data + got, (size_t) bufsize);
if (status < 0) {
THROWF(system_error, 0,
- "read(%d,%p,%d) from %s:%d failed: %s; got %d so far",
- sock->sd, data + got, (int) size, xbt_socket_peer_name(sock),
+ "read(%d,%p,%lu) from %s:%d failed: %s; got %d so far",
+ sock->sd, data + got, size, xbt_socket_peer_name(sock),
xbt_socket_peer_port(sock), sock_errstr(sock_errno), got);
}
XBT_DEBUG("Got %d more bytes (%s)", status,
/* size of the chunk to receive in that shot */
long int thissize =
min(size - chunk_pos, data->buffsize - data->out_buf.size);
- XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%ld, ctn=(%s)",
- (int) data->out_buf.size,
- ((int) data->out_buf.size) + thissize - 1, size,
+ XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%lu, ctn=(%s)",
+ data->out_buf.size,
+ data->out_buf.size + thissize - 1, size,
hexa_str((unsigned char *) chunk, thissize, 0));
memcpy(data->out_buf.data + data->out_buf.size, chunk + chunk_pos,
data->out_buf.size += thissize;
chunk_pos += thissize;
- XBT_DEBUG("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
+ XBT_DEBUG("New pos = %d; Still to send = %lu of %lu; ctn sofar=(%s)",
data->out_buf.size, size - chunk_pos, size,
hexa_str((unsigned char *) chunk, chunk_pos, 0));
data->in_buf.pos += thissize;
chunk_pos += thissize;
- XBT_DEBUG("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
+ XBT_DEBUG("New pos = %d; Still to receive = %lu of %lu. Ctn so far=(%s)",
data->in_buf.pos, size - chunk_pos, size,
hexa_str((unsigned char *) chunk, chunk_pos, 0));
}
if (direction == READ || direction == COPY) {
xbt_assert(i->c1 == j->c1);
xbt_assert(i->c2 == j->c2);
- xbt_assert(i->l1 == j->l1, "i->l1(=%ld) != j->l1(=%ld)", i->l1,
+ xbt_assert(i->l1 == j->l1, "i->l1(=%lu) != j->l1(=%lu)", i->l1,
j->l1);
xbt_assert(i->l2 == j->l2);
free(j);
xbt_assert(p->c1 == q->c1);
xbt_assert(p->c2 == q->c2);
xbt_assert(p->l1 == p->l1,
- "for cpt=%d i->l1(=%ld) != j->l1(=%ld)", cpt, p->l1,
+ "for cpt=%d i->l1(=%lu) != j->l1(=%lu)", cpt, p->l1,
q->l1);
xbt_assert(q->l2 == p->l2);
}
typedef enum {
MAXMIN,
LAGRANGE_RENO,
- LAGRANGE_VEGAS,
+ LAGRANGE_VEGAS
} method_t;
static double dichotomy(double func(double), double min, double max,
snprintf(name, sizeof name, "DEFAULT");
break;
default:
- snprintf(name, sizeof name, "UNKNOWN(%d)", mode);
+ snprintf(name, sizeof name, "UNKNOWN(%d)", (int)mode);
break;
}
return name;
return EXIT_FAILURE;
}
if (argc == 3)
- modes = atoi(argv[2]);
+ modes = strtol(argv[2], NULL, 0);
printf("Parmap benchmark with %d workers (modes = %#x)...\n\n",
nthreads, modes);
XBT_INFO("<%s> No output before timeout", rctx->filepos);
XBT_ERROR("Test suite `%s': NOK (<%s> timeout after %d sec)",
testsuite_name, rctx->filepos, timeout_value);
- XBT_DEBUG("<%s> Interrupted = %d", rctx->filepos, rctx->interrupted);
+ XBT_DEBUG("<%s> Interrupted = %d", rctx->filepos, (int)rctx->interrupted);
if (!rctx->interrupted) {
xbt_os_mutex_release(rctx->interruption);
rctx_armageddon(rctx, 3);
if (signals[i].number == got)
return (signals[i].name);
- return bprintf("SIG UNKNOWN (%d)", got);
+ return bprintf("SIG UNKNOWN (%u)", got);
}