It's at least 64bits long, and the printf/scanf format is prettier/easier to write.
#include <stdlib.h>
#include "msg/msg.h"
#include "surf/surf_private.h"
-#include "inttypes.h"
int host(int argc, char *argv[]);
XBT_INFO("\tOpen file '%s'",file->fullname);
read = MSG_file_read(file, 10000000); // Read for 10MB
- XBT_INFO("\tHave read %" PRIu64 " on %s",read,file->fullname);
+ XBT_INFO("\tHave read %llu on %s",read,file->fullname);
write = MSG_file_write(file, 100000); // Write for 100KB
- XBT_INFO("\tHave written %" PRIu64 " on %s",write,file->fullname);
+ XBT_INFO("\tHave written %llu on %s",write,file->fullname);
read = MSG_file_read(file, 110000); // Read for 110KB
- XBT_INFO("\tHave read %" PRIu64 " on %s (of size %" PRIu64 ")",read,file->fullname,
+ XBT_INFO("\tHave read %llu on %s (of size %llu)",read,file->fullname,
MSG_file_get_size(file));
XBT_INFO("\tClose file '%s'",file->fullname);
#include <stdlib.h>
#include "msg/msg.h"
#include "surf/surf_private.h"
-#include "inttypes.h"
int host(int argc, char *argv[]);
// Write into the new file
write = MSG_file_write(file,100000); // Write for 100Ko
- XBT_INFO("\tHave written %" PRIu64 " on %s",write,file->fullname);
+ XBT_INFO("\tHave written %llu on %s",write,file->fullname);
// Close the file
XBT_INFO("\tClose file '%s'",file->fullname);
#include "xbt/log.h"
#include "xbt/dict.h"
- /* To use PRIu64 format specifier for printing uint64_t (sg_size_t) */
-#include <inttypes.h>
-
XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation");
static int host(int argc, char *argv[]){
sg_size_t used_size = MSG_storage_get_used_size(mount_name);
sg_size_t size = MSG_storage_get_size(storage);
- XBT_INFO("Total size: %"PRIu64" bytes", size);
- XBT_INFO("Free size: %"PRIu64" bytes", free_size);
- XBT_INFO("Used size: %"PRIu64" bytes", used_size);
+ XBT_INFO("Total size: %llu bytes", size);
+ XBT_INFO("Free size: %llu bytes", free_size);
+ XBT_INFO("Used size: %llu bytes", used_size);
}
xbt_dict_free(&storage_list);
// Open an non-existing file amounts to create it!
file = MSG_file_open(mount, file_name, NULL);
write = MSG_file_write(file, 200000); // Write 200,000 bytes
- XBT_INFO("Create a %"PRIu64" bytes file named '%s' on /sd1", write, file_name);
+ XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, file_name);
MSG_file_dump(file);
// check that sizes have changed
- XBT_INFO("Free size: %"PRIu64" bytes", MSG_storage_get_free_size("/home"));
- XBT_INFO("Used size: %"PRIu64" bytes", MSG_storage_get_used_size("/home"));
+ XBT_INFO("Free size: %llu bytes", MSG_storage_get_free_size("/home"));
+ XBT_INFO("Used size: %llu bytes", MSG_storage_get_used_size("/home"));
// Now retrieve the size of created file and read it completely
file_size = MSG_file_get_size(file);
read = MSG_file_read(file, file_size);
- XBT_INFO("Read %"PRIu64" bytes on %s", read, file_name);
+ XBT_INFO("Read %llu bytes on %s", read, file_name);
// Now write 100,000 more bytes in tmp/data.txt
write = MSG_file_write(file, 100000); // Write 100,000 bytes
- XBT_INFO("Write %"PRIu64" more bytes on %s", write, file_name);
+ XBT_INFO("Write %llu more bytes on %s", write, file_name);
MSG_file_dump(file);
MSG_file_close(file);
xbt_dict_foreach(contents, curs, mountname, content){
XBT_INFO("Print the content of mount point: %s",mountname);
xbt_dict_foreach(content,curs2,path,size){
- XBT_INFO("%s size: %"PRIu64" bytes", path,*((sg_size_t*)size));
+ XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
}
xbt_dict_free(&content);
}
#define SG_PLATF_H
#include <xbt.h>
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
typedef void *sg_routing_link_t; /* FIXME:The actual type is model-dependent so use void* instead*/
typedef struct RoutingEdge *sg_routing_edge_t;
return storage->key;
}
/* Type for any simgrid size size */
-typedef uint64_t sg_size_t;
+typedef unsigned long long sg_size_t;
/*
* Platform creation functions. Instead of passing 123 arguments to the creation functions
#include "msg_private.h"
#include "xbt/log.h"
-#include <inttypes.h>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg,
"Logging specific to MSG (io)");
__MSG_file_get_info(fd);
XBT_INFO("File Descriptor information:\n"
"\t\tFull name: '%s'\n"
- "\t\tSize: %" PRIu64 "\n"
+ "\t\tSize: %llu\n"
"\t\tMount point: '%s'\n"
"\t\tStorage Id: '%s'\n"
"\t\tStorage Type: '%s'\n"
if (stage == 2){
- XBT_DEBUG("mig-stage%d.%d: sent %" PRIu64 " duration %f actual_speed %f (target %f) cpu %f", stage, stage2_round, size, duration, actual_speed, mig_speed, cpu_utilization);}
+ XBT_DEBUG("mig-stage%d.%d: sent %llu duration %f actual_speed %f (target %f) cpu %f", stage, stage2_round, size, duration, actual_speed, mig_speed, cpu_utilization);}
else{
- XBT_DEBUG("mig-stage%d: sent %" PRIu64 " duration %f actual_speed %f (target %f) cpu %f", stage, size, duration, actual_speed, mig_speed, cpu_utilization);
+ XBT_DEBUG("mig-stage%d: sent %llu duration %f actual_speed %f (target %f) cpu %f", stage, size, duration, actual_speed, mig_speed, cpu_utilization);
}
xbt_free(task_name);
while ((read = xbt_getline(&line, &len, file)) != -1) {
if (read){
- if(sscanf(line,"%s %" SCNu64, path, &size) == 2) {
+ if(sscanf(line,"%s %llu", path, &size) == 2) {
*used_size += size;
sg_size_t *psize = xbt_new(sg_size_t, 1);
*psize = size;
while ((read = xbt_getline(&line, &len, file)) != -1) {
if (read){
- if(sscanf(line,"%s %" SCNu64, path, &size) == 2) {
+ if(sscanf(line,"%s %llu", path, &size) == 2) {
m_usedSize += size;
sg_size_t *psize = xbt_new(sg_size_t, 1);
*psize = size;
StorageActionPtr StorageLmm::close(surf_file_t fd)
{
char *filename = fd->name;
- XBT_DEBUG("\tClose file '%s' size '%" PRIu64 "'", filename, fd->size);
+ XBT_DEBUG("\tClose file '%s' size '%llu'", filename, fd->size);
// unref write actions from storage
StorageActionLmmPtr write_action;
unsigned int i;
StorageActionPtr StorageLmm::write(surf_file_t fd, sg_size_t size)
{
char *filename = fd->name;
- XBT_DEBUG("\tWrite file '%s' size '%" PRIu64 "/%" PRIu64 "'",filename,size,fd->size);
+ XBT_DEBUG("\tWrite file '%s' size '%llu/%llu'",filename,size,fd->size);
StorageActionLmmPtr action = new StorageActionLmm(p_model, size, p_stateCurrent != SURF_RESOURCE_ON, this, WRITE);
action->p_file = fd;
if (psize){// src file exists
xbt_dict_remove(p_content, src);
xbt_dict_set(p_content, dest, new_psize,NULL);
- XBT_DEBUG("Change file name from %s to %s, size '%" PRIu64 "'",src, dest, *psize);
+ XBT_DEBUG("Change file name from %s to %s, size '%llu'",src, dest, *psize);
}
else
XBT_DEBUG("File %s doesn't exist",src);
StorageActionLmm::StorageActionLmm(ModelPtr model, double cost, bool failed, StorageLmmPtr storage, e_surf_action_storage_type_t type)
: Action(model, cost, failed), ActionLmm(model, cost, failed), StorageAction(model, cost, failed, storage, type) {
- XBT_IN("(%s,%" PRIu64, storage->m_name, cost);
+ XBT_IN("(%s,%g", storage->m_name, cost);
p_variable = lmm_variable_new(p_model->p_maxminSystem, this, 1.0, -1.0 , 3);
// Must be less than the max bandwidth for all actions
#include "msg/msg.h"
#include "xbt/log.h"
-#include "inttypes.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation");
sg_size_t free_size = MSG_storage_get_free_size(mount_name);
sg_size_t used_size = MSG_storage_get_used_size(mount_name);
- XBT_INFO("Free size: %" PRIu64 " bytes", free_size);
- XBT_INFO("Used size: %" PRIu64 " bytes", used_size);
+ XBT_INFO("Free size: %llu bytes", free_size);
+ XBT_INFO("Used size: %llu bytes", used_size);
storage = MSG_storage_get_by_name(storage_name);
display_storage_properties(storage);
sg_size_t read_size = read_local_file(src);
// Send file
- XBT_INFO("%s sends %" PRIu64 " to %s",MSG_host_get_name(MSG_host_self()),read_size,remote_host);
+ XBT_INFO("%s sends %llu to %s",MSG_host_get_name(MSG_host_self()),read_size,remote_host);
msg_task_t to_execute = MSG_task_create((const char*)"hsm_put", 0, (double) read_size, (void*)dest);
MSG_task_send(to_execute, remote_host);
file_size = MSG_file_get_size(file);
read = MSG_file_read(file, file_size);
- XBT_INFO("%s has read %" PRIu64 " on %s",MSG_host_get_name(MSG_host_self()),read,src);
+ XBT_INFO("%s has read %llu on %s",MSG_host_get_name(MSG_host_self()),read,src);
MSG_file_close(file);
return read;
xbt_dict_t content = MSG_storage_get_content(storage);
if (content){
xbt_dict_foreach(content, cursor, file, psize)
- XBT_INFO("%s size: %" PRIu64 " bytes", file, *psize);
+ XBT_INFO("%s size: %llu bytes", file, *psize);
} else {
XBT_INFO("No content.");
}
prio
prioritarily
PriorityClass
-PRIu
priv
PRN
PRNG