X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3203ed1f4fb6f4617e94d5351661ba07e8b8f833..16bbb8a8212497d9c44c81333ed2c0e689e0c5af:/src/smpi/smpi_bench.c diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index 6dbbddb77c..8ed76a50a5 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -154,9 +154,9 @@ void smpi_execute_(double *duration) void smpi_execute_flops(double flops) { smx_synchro_t action; XBT_DEBUG("Handle real computation time: %f flops", flops); - action = simcall_process_execute("computation", flops, 1, 0, 0); + action = simcall_execution_start("computation", flops, 1, 0, 0); simcall_set_category (action, TRACE_internal_smpi_get_category()); - simcall_process_execution_wait(action); + simcall_execution_wait(action); smpi_switch_data_segment(smpi_process_index()); } @@ -622,7 +622,7 @@ void smpi_really_switch_data_segment(int dest) { #ifdef HAVE_PRIVATIZATION int i; if(smpi_loaded_page==-1){//initial switch, do the copy from the real page here - for (i=0; i< SIMIX_process_count(); i++){ + for (i=0; i< smpi_process_count(); i++){ memcpy(smpi_privatisation_regions[i].address, TOPAGE(smpi_start_data_exe), smpi_size_data_exe); } @@ -644,86 +644,11 @@ int smpi_is_privatisation_file(char* file) 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 @@ -741,7 +666,7 @@ void smpi_initialize_global_memory_segments(){ smpi_privatisation_regions = (smpi_privatisation_region_t) malloc( smpi_process_count() * sizeof(struct s_smpi_privatisation_region)); - for (i=0; i< SIMIX_process_count(); i++){ + for (i=0; i< smpi_process_count(); i++){ //create SIMIX_process_count() mappings of this size with the same data inside void *address = NULL; char path[] = "/dev/shm/my-buffer-XXXXXX"; @@ -749,8 +674,8 @@ void smpi_initialize_global_memory_segments(){ int file_descriptor= mkstemp (path); if (file_descriptor < 0) { - if (errno==EMFILE) { - xbt_die("Impossible to create temporary file for memory mapping: %s\n\ + if (errno==EMFILE) { + xbt_die("Impossible to create temporary file for memory mapping: %s\n\ The open() system call failed with the EMFILE error code (too many files). \n\n\ This means that you reached the system limits concerning the amount of files per process. \ This is not a surprise if you are trying to virtualize many processes on top of SMPI. \ @@ -763,9 +688,9 @@ First, check what your limits are:\n\ If one of these values is less than the amount of MPI processes that you try to run, then you got the explanation of this error. \ Ask the Internet about tutorials on how to increase the files limit such as: https://rtcamp.com/tutorials/linux/increase-open-files-limit/", strerror(errno)); - } + } xbt_die("Impossible to create temporary file for memory mapping: %s", - strerror(errno)); + strerror(errno)); } status = unlink (path);