Commit Graph

3 Commits

Author SHA1 Message Date
Paul Bone
d66a7669da Serialise access to IO in tl_backjump_test.m
After upgrading the collector this test started to fail, but probably not
because of the collector (AFAIK).  I've fixed it by serialising the logging,
so that whole messages are written out and not broken up.

tests/hard_coded/tl_backjump_test.m:
    As above.
2016-09-20 13:51:01 +10:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Julien Fischer
5c49b5dac9 Add support for thread-local backjumping in grades that support concurrency.
Estimated hours taken: 7
Branches: main

Add support for thread-local backjumping in grades that support concurrency.

library/backjump.m:
	Shift the C definition of backjump handlers and choice ids into the
	runtime.  This is needed because MR_Context now refers to them and
	the runtime should not depend on the library.

	Delete the XXX comment regarding pred_is_external/3.  (This has been
	fixed below.)

runtime/mercury_backjump.h:
runtime/mercury_backjump.c:
	New module that defines those parts of the backjumping support that
	the runtime requires access to.

	In high-level C .par grades make the global state required by
	backjumping thread-specific.

	Conform to the usual coding conventions in the runtime in the new
	versions of the data structures that were originally in backjump.m.

	Rename ML_Choice_Id to MR_BackJumpChoiceId, the latter is less
	ambiguous.

runtime/mercury_context.h:
runtime/mercury_context.c:
	In low-level C grades add two extra fields to the MR_Context structure
	to hold the global state required by backjumping.

	In high-level C .par grades initialise the the thread-specific data that
	is used to store the backjump global state at program startup.

	Reformat a function prototype.

runtime/mercury_thread.h:
	Reformat a function prototype.

runtime/Mmakefile:
	Include the new files.

mdbcomp/program_representation.m:
	Update pred_is_external/3 to include backjump.builtin_choice_id/1
	and backjump.builtin_backjump/1.

tests/hard_coded/Mmakefile:
tests/hard_coded/tl_backjump_test.m:
tests/hard_coded/tl_backjump_test.exp:
	Test thread-local backjumping.

tests/hard_coded/tl_backjump_test.exp2:
	Expected output for the above test case for grades in which spawn/3
	does not work.
2008-03-19 05:30:01 +00:00