[m-rev.] diff: runtime options for controlling trail seg sizes
Julien Fischer
juliensf at csse.unimelb.edu.au
Wed Sep 10 09:14:22 AEST 2008
Estimated hours taken: 1
Branches: main
Add new runtime options for setting the size of trail segments.
Decouple the segment size from those options used to control the trail size
in grades that use a fixed size trail. This is necessary for users who
require their software to work in both .tr and .trseg grades, since
in the size for the fixed size trial may not be appropriate as a
segment size.
runtime/mercury_wrapper.c:
Add two new runtime options, --trail-segment-size
and --trail-segement-size-kwords, for controlling the size
of trail segments.
Ignore the --trail-size and --trail-size-kwords options
in .trseg grades.
doc/user_guide.texi:
Document the above.
Julien.
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.574
diff -u -r1.574 user_guide.texi
--- doc/user_guide.texi 5 Sep 2008 13:19:35 -0000 1.574
+++ doc/user_guide.texi 9 Sep 2008 23:08:41 -0000
@@ -9646,6 +9646,7 @@
@findex --trail-size
@cindex Trail size
Sets the size of the trail to @var{size} kilobytes.
+This option is ignored in grades that use trail segments.
@sp 1
@item --trail-size-kwords @var{size}
@@ -9653,6 +9654,22 @@
@cindex Trail size
Sets the size of the trail to @var{size} kilobytes
multiplied by the word size in bytes.
+This option is ignored in grades that use trail segments.
+
+ at sp 1
+ at item --trail-segment-size @var{size}
+ at findex --trail-segment-size
+ at cindex Trail size
+Sets the size of each trail segment to be @var{size} kilobytes.
+This option is ignored in grades that do not use trail segments.
+
+ at sp 1
+ at item --trail-segment-size-kwords @var{size}
+ at findex --trail-seggment-size-kwords
+ at cindex Trail size
+Set the size of each trail segment to be @var{size} kilobytes
+multiplied by the words size in bytes.
+This option is ignored in grades that do not use trail segements.
@sp 1
@item --genstack-size @var{size}
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.191
diff -u -r1.191 mercury_wrapper.c
--- runtime/mercury_wrapper.c 15 Jul 2008 07:44:20 -0000 1.191
+++ runtime/mercury_wrapper.c 9 Sep 2008 23:08:42 -0000
@@ -1160,6 +1160,8 @@
MR_SOLUTIONS_HEAP_SIZE_KWORDS,
MR_TRAIL_SIZE,
MR_TRAIL_SIZE_KWORDS,
+ MR_TRAIL_SEGMENT_SIZE,
+ MR_TRAIL_SEGMENT_SIZE_KWORDS,
MR_HEAP_REDZONE_SIZE,
MR_HEAP_REDZONE_SIZE_KWORDS,
MR_DETSTACK_REDZONE_SIZE,
@@ -1241,6 +1243,8 @@
{ "solutions-heap-size-kwords", 1, 0, MR_SOLUTIONS_HEAP_SIZE_KWORDS },
{ "trail-size", 1, 0, MR_TRAIL_SIZE },
{ "trail-size-kwords", 1, 0, MR_TRAIL_SIZE_KWORDS },
+ { "trail-segment-size", 1, 0, MR_TRAIL_SEGMENT_SIZE },
+ { "trail-segment-size-kwords", 1, 0, MR_TRAIL_SEGMENT_SIZE_KWORDS },
{ "heap-redzone-size", 1, 0, MR_HEAP_REDZONE_SIZE },
{ "heap-redzone-size-kwords", 1, 0, MR_HEAP_REDZONE_SIZE_KWORDS },
{ "detstack-redzone-size", 1, 0, MR_DETSTACK_REDZONE_SIZE },
@@ -1435,17 +1439,41 @@
MR_usage();
}
- MR_trail_size = size;
+ #if !defined(MR_TRAIL_SEGMENTS)
+ MR_trail_size = size;
+ #endif
break;
case MR_TRAIL_SIZE_KWORDS:
if (sscanf(MR_optarg, "%lu", &size) != 1) {
MR_usage();
}
+
+ #if !defined(MR_TRAIL_SEGMENTS)
+ MR_trail_size = size * sizeof(MR_Word);
+ #endif
+ break;
+
+ case MR_TRAIL_SEGMENT_SIZE:
+ if (sscanf(MR_optarg, "%lu", &size) != 1) {
+ MR_usage();
+ }
- MR_trail_size = size * sizeof(MR_Word);
+ #if defined(MR_TRAIL_SEGMENTS)
+ MR_trail_size = size;
+ #endif
break;
+ case MR_TRAIL_SEGMENT_SIZE_KWORDS:
+ if (sscanf(MR_optarg, "%lu", &size) != 1) {
+ MR_usage();
+ }
+
+ #if defined(MR_TRAIL_SEGMENTS)
+ MR_trail_size = size * sizeof(MR_Word);
+ #endif
+ break;
+
case MR_HEAP_REDZONE_SIZE:
if (sscanf(MR_optarg, "%lu", &size) != 1) {
MR_usage();
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list