A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A few more tiers file and a convenient perl script for the alnem project. I
[simgrid.git]
/
src
/
gras
/
DataDesc
/
ddt_convert.c
diff --git
a/src/gras/DataDesc/ddt_convert.c
b/src/gras/DataDesc/ddt_convert.c
index
99f3390
..
5f1842e
100644
(file)
--- a/
src/gras/DataDesc/ddt_convert.c
+++ b/
src/gras/DataDesc/ddt_convert.c
@@
-2,11
+2,12
@@
/* ddt_remote - Stuff needed to get datadescs about remote hosts */
/* ddt_remote - Stuff needed to get datadescs about remote hosts */
-/* Authors: Olivier Aumage, Martin Quinson */
-/* Copyright (C) 2003, 2004 the GRAS posse. */
+/* Copyright (c) 2003 Olivier Aumage. */
+/* Copyright (c) 2003, 2004 Martin Quinson. */
+/* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* 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. */
+
*
under the terms of the license (GNU LGPL) which comes with this package. */
/************************************************************************/
/* C combines the power of assembler with the portability of assembler. */
/************************************************************************/
/* C combines the power of assembler with the portability of assembler. */
@@
-14,36
+15,53
@@
#include "gras/DataDesc/datadesc_private.h"
#include "gras/DataDesc/datadesc_private.h"
-
GRAS
_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_convert,datadesc,
+
XBT
_LOG_NEW_DEFAULT_SUBCATEGORY(ddt_convert,datadesc,
"Inter-architecture convertions");
/***
*** Table of all known architectures:
***
"Inter-architecture convertions");
/***
*** Table of all known architectures:
***
- *** l C<1/1> I<2/2:4/4:4/4:8/4> P<4/4:4/4> D<4/4:8/4>
- *** l C<1/1> I<2/2:4/4:8/8:8/8> P<4/4:4/4> D<4/4:8/8>
- *** B C<1/1> I<2/2:4/4:4/8:8/8> P<4/4:4/4> D<4/4:8/4>
- *** B C<1/1> I<2/2:4/8:8/8:8/8> P<4/4:4/4> D<4/4:8/4>
- *** B C:1/1: I:2/2:4/4:4/4:8/8: P:4/4:4/4: D:4/4:8/4:
- ***
+ l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:) gras_arch=0; gras_arch_name=little32;;
+ l_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:) gras_arch=1; gras_arch_name=little32_4;;
+
+ l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:) gras_arch=2; gras_arch_name=little64;;
+
+ B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:) gras_arch=3; gras_arch_name=big32;;
+ B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:) gras_arch=4; gras_arch_name=big32_8_4;;
+ B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:) gras_arch=5; gras_arch_name=big32_4;;
+ B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:) gras_arch=6; gras_arch_name=big32_2;;
+
+ B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:) gras_arch=7; gras_arch_name=big64;;
+
***/
const gras_arch_desc_t gras_arches[gras_arch_count] = {
***/
const gras_arch_desc_t gras_arches[gras_arch_count] = {
- {"little32", 0, {1,2,4,4,8, 4,4, 4,8}, // 4},
+ {"little32", 0, {1,2,4,4,8, 4,4, 4,8}, /* win32 */
+ {1,2,4,4,8, 4,4, 4,8}},
+
+ {"little32_4", 0, {1,2,4,4,8, 4,4, 4,8}, /* linux x86 */
{1,2,4,4,4, 4,4, 4,4}},
{1,2,4,4,4, 4,4, 4,4}},
- {"little64",
0, {1,2,4,8,8, 8,8, 4,8}, // 8},
+ {"little64",
0, {1,2,4,8,8, 8,8, 4,8}, /* alpha, ia64 */
{1,2,4,8,8, 8,8, 4,8}},
{1,2,4,8,8, 8,8, 4,8}},
- {"big32",
1, {1,2,4,4,8, 4,4, 4,8}, // 8},
+ {"big32",
1, {1,2,4,4,8, 4,4, 4,8},
{1,2,4,4,8, 4,4, 4,8}},
{1,2,4,4,8, 4,4, 4,8}},
- {"big
64", 1, {1,2,4,8,8, 8,8, 4,8}, // 8}
- {1,2,4,
8,8, 8,8, 4,8
}},
+ {"big
32_8_4", 1, {1,2,4,4,8, 4,4, 4,8}, /* AIX */
+ {1,2,4,
4,8, 4,4, 4,4
}},
- {"
aix", 1, {1,2,4,4,8, 4,4, 4,8}, // 8}
- {1,2,4,4,
8, 4,4, 4,4}}
+ {"
big32_4", 1, {1,2,4,4,8, 4,4, 4,8}, /* G5 */
+ {1,2,4,4,
4, 4,4, 4,4}},
+ {"big32_2", 1, {1,2,4,4,8, 4,4, 4,8}, /* ARM */
+ {1,2,2,2,2, 2,2, 2,2}},
+
+ {"big64", 1, {1,2,4,8,8, 8,8, 4,8}, /* sparc */
+ {1,2,4,8,8, 8,8, 4,8}},
+
+ {"big64_8_4", 1, {1,2,4,8,8, 8,8, 4,8}, /* aix with -maix64 */
+ {1,2,4,8,8, 8,8, 4,4}}
};
const char *gras_datadesc_arch_name(int code) {
};
const char *gras_datadesc_arch_name(int code) {
@@
-52,6
+70,7
@@
const char *gras_datadesc_arch_name(int code) {
return gras_arches[code].name;
}
return gras_arches[code].name;
}
+
/**
* Local function doing the grunt work
*/
/**
* Local function doing the grunt work
*/
@@
-60,7
+79,6
@@
gras_dd_reverse_bytes(void *to,
const void *from,
size_t length);
const void *from,
size_t length);
-
/**
* gras_dd_convert_elm:
*
/**
* gras_dd_convert_elm:
*
@@
-68,8
+86,8
@@
gras_dd_reverse_bytes(void *to,
* The data to be converted is stored in @src, and is to be stored in @dst.
* Both pointers may be the same location if no resizing is needed.
*/
* The data to be converted is stored in @src, and is to be stored in @dst.
* Both pointers may be the same location if no resizing is needed.
*/
-gras_error_t
-gras_dd_convert_elm(gras_datadesc_type_t
*
type, int count,
+void
+gras_dd_convert_elm(gras_datadesc_type_t type, int count,
int r_arch,
void *src, void *dst) {
gras_dd_cat_scalar_t scal = type->category.scalar_data;
int r_arch,
void *src, void *dst) {
gras_dd_cat_scalar_t scal = type->category.scalar_data;
@@
-84,8
+102,8
@@
gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
} tester;
*/
} tester;
*/
-
gras
_assert(type->category_code == e_gras_datadesc_type_cat_scalar);
-
gras
_assert(r_arch != GRAS_THISARCH);
+
xbt
_assert(type->category_code == e_gras_datadesc_type_cat_scalar);
+
xbt
_assert(r_arch != GRAS_THISARCH);
r_size = type->size[r_arch];
l_size = type->size[GRAS_THISARCH];
r_size = type->size[r_arch];
l_size = type->size[GRAS_THISARCH];
@@
-122,7
+140,7
@@
gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
DEBUG5("Resize integer %d from %lu @%p to %lu @%p",
cpt, r_size,r_data, l_size,l_data);
DEBUG5("Resize integer %d from %lu @%p to %lu @%p",
cpt, r_size,r_data, l_size,l_data);
-
gras
_assert0(r_data != l_data, "Impossible to resize in place");
+
xbt
_assert0(r_data != l_data, "Impossible to resize in place");
if(sizeChange < 0) {
DEBUG3("Truncate %d bytes (%s,%s)", -sizeChange,
if(sizeChange < 0) {
DEBUG3("Truncate %d bytes (%s,%s)", -sizeChange,
@@
-203,7
+221,6
@@
gras_dd_convert_elm(gras_datadesc_type_t *type, int count,
}
}
}
}
- return no_error;
}
static void
}
static void