/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "internal_config.h"
+#include "src/internal_config.h"
#include "private.h"
#include "xbt/dict.h"
#include "xbt/sysdep.h"
#include "surf/surf.h"
#include "simgrid/sg_config.h"
#include "simgrid/modelchecker.h"
-#include "mc/mc_replay.h"
+#include "src/mc/mc_replay.h"
#ifndef WIN32
#include <sys/mman.h>
return strncmp("/dev/shm/my-buffer-", file, 19) == 0;
}
-void smpi_get_executable_global_size(){
- int size_bss_binary=0;
- int size_data_binary=0;
- FILE *fp;
- char *line = NULL; /* Temporal storage for each line that is readed */
- ssize_t read; /* Number of bytes readed */
- size_t n = 0; /* Amount of bytes to read by xbt_getline */
-
- char *lfields[7];
- int i, found = 0;
-
- char *command = bprintf("objdump --section-headers %s", xbt_binary_name);
-
- fp = popen(command, "r");
-
- if(fp == NULL){
- perror("popen failed");
- xbt_abort();
- }
-
- while ((read = xbt_getline(&line, &n, fp)) != -1 && found != 2) {
-
- if(n == 0)
- continue;
-
- /* Wipeout the new line character */
- line[read - 1] = '\0';
-
- lfields[0] = strtok(line, " ");
-
- if(lfields[0] == NULL)
- continue;
-
- if(strcmp(lfields[0], "Sections:") == 0
- || strcmp(lfields[0], "Idx") == 0
- || strncmp(lfields[0], xbt_binary_name, strlen(xbt_binary_name)) == 0)
- continue;
-
- for (i = 1; i < 7 && lfields[i - 1] != NULL; i++) {
- lfields[i] = strtok(NULL, " ");
- }
-
- /*
- * we are looking for these fields
- 23 .data 02625a20 00000000006013e0 00000000006013e0 000013e0 2**5
- CONTENTS, ALLOC, LOAD, DATA
- 24 .bss 02625a40 0000000002c26e00 0000000002c26e00 02626e00 2**5
- ALLOC
- */
-
- if(i>=6){
- if(strcmp(lfields[1], ".data") == 0){
- size_data_binary = strtoul(lfields[2], NULL, 16);
- smpi_start_data_exe = (char*) strtoul(lfields[4], NULL, 16);
- found++;
- }else if(strcmp(lfields[1], ".bss") == 0){
- //the beginning of bss is not exactly the end of data if not aligned, grow bss reported size accordingly
- //TODO : check if this is OK, as some segments may be inserted between them..
- size_bss_binary = ((char*) strtoul(lfields[4], NULL, 16) - (smpi_start_data_exe + size_data_binary))
- + strtoul(lfields[2], NULL, 16);
- found++;
- }
-
- }
-
- }
-
- smpi_size_data_exe = (unsigned long) smpi_start_data_exe
- - (unsigned long) TOPAGE(smpi_start_data_exe)
- + size_data_binary+size_bss_binary;
- xbt_free(command);
- xbt_free(line);
- pclose(fp);
-
-}
-
void smpi_initialize_global_memory_segments(){
#ifndef HAVE_PRIVATIZATION
smpi_privatize_global_variables=0;
+ xbt_die("You are trying to use privatization on a system that does not support it. Don't.");
return;
#else