OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | sat4j-dev List | March 2007 Index

    Date Index  -->     Thread Index  -->

Reduced memory experiment


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all,

I created a new branch on CVS with a version of SAT4J with reduced
memory footprint.

Instead of holding an ILits object in each instance of a constraint to
have access to access the information on variables, that reference is
now shared using a common static reference on a new AbstractConstr class.

The first tests seem to confirm that the memory consumption is indeed
smaller.

Note that the new scheme does no longer allow to have two instances of
Solver running on the same JVM, since now some data are shared using
static variables.

For those having huge benchmarks and experiencing memory problems,
please find enclosed an ant build file that will compile the code
available on CVS in the MEMORY_EFFICIENT branch.

just type

ant -f lydie.xml

in an directory containing only that file to build the library.

Your feedback on this code would be much appreciated.

Cheers,

        Daniel
- --
             Daniel Le Berre mailto:leberre@xxxxxxxxxxxxxxxxxxx
             MCF,    CRIL-CNRS FRE 2499,    Universite d'Artois
             http://www.cril.univ-artois.fr/~leberre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFF8UD2qVioN+Yc2ggRArGJAJ9sXHHaTx+SKc1IQcCX47G0YN4IHwCgzgTh
4LxQl2cRCPJqiqBEJK3QDKg=
=rP7R
-----END PGP SIGNATURE-----
<project name="sat4j" default="all">
	<!-- user/password settings for FTP, WWW, local settings -->
	<!-- the property report.dir MUST DE DEFINED here -->
	<!-- other properties -->
	<property name="projname" value="core"/>
	<property name="build" value="bin" />
	<property name="lib" value="${projname}/lib" />
	<property name="doc" value="api" />

	<target name="pseudo">
		<echo>Building Pseudo Boolean Solver</echo>
		<property name="package" value="${projname}"/>
		<property name="src" value="${projname}/src" />
		<property name="jarname" value="sat4jPseudo"/>
		<property name="mainclass" value="org.sat4j.LanceurPseudo2005"/>
		<antcall target="build"/>
	</target>

        <target name="maxsat">
		<echo>Building MAXSAT Solver</echo>
		<property name="package" value="${projname}"/>
		<property name="src" value="${projname}/src" />
		<property name="jarname" value="sat4jMaxsat"/>
		<property name="mainclass" value="org.sat4j.GenericOptLauncher"/>
		<antcall target="build"/>
	</target>

	<target name="csp">
		<echo>Building CSP Solver</echo>
		<property name="package" value="${projname}"/>
		<property name="src" value="${projname}/src" />
		<property name="jarname" value="sat4jCSP"/>
		<property name="mainclass" value="org.sat4j.CSPLauncher"/>
		<antcall target="build"/>
	</target>

	<target name="sat">
		<echo>Building Default SAT Solvers</echo>
		<property name="package" value="${projname}"/>
		<property name="src" value="${projname}/src" />
			<property name="jarname" value="sat4j"/>
			<property name="mainclass" value="org.sat4j.Lanceur"/>
		<antcall target="build"/>
	</target>

	<target name="sudoku" depends="sat">
		<echo>Building Sudoku app ${java.home}</echo>
		<echo>Looking for the latest version of the sudoku source code on ObjectWeb forge</echo>
<!--
		<cvs cvsRoot=":pserver:anonymous@xxxxxxxxxxxxxxxxxxxxxxx/cvsroot/sat4j"
						 package="sudoku"
					   dest="." />
-->
		<antcall target="build">
			<param name="package" value="sudoku"/>
			<param name="src" value="sudoku/src"/>
                        <param name="lib" value="sudoku/lib"/>
			<param name="jarname" value="sudoku"/>
			<param name="mainclass" value="org.sat4j.apps.sudoku.SDApplication"/>
		</antcall>
	</target>

	<target name="prepare">
		<!-- Create the time stamp -->
		<tstamp/>
		<echo>Creating build and doc directories</echo>
		<mkdir dir="${build}" />
		<mkdir dir="${doc}" />
	</target>

	<path id="somePath">
		<pathelement location="${build}"/>
		<fileset dir="${lib}">
			<include name="*.jar"/>
		</fileset>
		<pathelement location="${java.home}/lib/javaws.jar"/> 
	</path>

	<target name="javadoc">
		<echo>Generating Javodoc</echo>
		<javadoc destdir="${doc}" 
				 access="public" 
				 source="1.5" 
				 use="true" 
				 notree="false" 
				 nonavbar="false" 
				 noindex="false" 
				 splitindex="true" 
				 author="true" 
				 version="true" 
				 nodeprecatedlist="false" 
				 nodeprecated="false" 
				 packagenames="org.sat4j.*,org.sat4j.spec.*,org.sat4j.core.*,org.sat4j.minisat.*,org.sat4j.minisat.core.*,org.sat4j.minisat.constraints.*,org.sat4j.minisat.constraints.cnf.*"
				 sourcepath="${src}" 
				 overview="${src}/overview.html" 
				 doctitle="SAT4J: a SATisfiability library for Java">
				 <classpath refid="somePath"/>
		</javadoc>
	</target>

	<target name="build" depends="prepare,getsource">
		<echo>Compiling source code ${src}</echo>
		<javac
		srcdir="${src}"
		destdir="${build}"
		source="1.5"
		target="1.6"
	>
			<classpath refid="somePath"/>
		</javac>
		<copy file="${src}/${jarname}.version" todir="${build}" failonerror="false"/>
		<copy todir="${build}" failonerror="false">
			<fileset dir="${src}">
				<include name="**/*.properties"/>
				<include name="**/*.png"/>
				<include name="**/*.gif"/>
				<include name="**/*.jpg"/> 
				<include name="**/*.js"/>
			</fileset>
		</copy>

		<jar destfile="${jarname}.jar" basedir="${build}">
			<manifest>
				<attribute name="Built-By" value="Daniel Le Berre"/>
				<attribute name="Main-Class" value="${mainclass}"/>
				<attribute name="Specification-Title" value="SAT4J"/>
				<attribute name="Specification-Version" value="1.5+"/>
				<attribute name="Specification-Vendor"
						   value="Daniel Le Berre"
				 />
				<attribute name="Implementation-Title" value="SAT4J"/>
				<attribute name="Implementation-Version" value="NA "/>
				<attribute name="Implementation-Vendor"
						   value="CRIL-CNRS FRE 2499"
				 />
			</manifest>
			<zipgroupfileset dir="${lib}">
                           <include name="commons*.jar"/>
			   <include name="jlf*.jar"/>
			   <include name="csp*.jar"/>
			   <include name="js.jar"/>
                        </zipgroupfileset>
		</jar>
	</target>
		
	<target name="getsource">
		<echo>Looking for the latest version of the source code on ObjectWeb forge</echo>
		<cvs cvsRoot=":pserver:anonymous@xxxxxxxxxxxxxxxxxxxxxxx/cvsroot/sat4j"
			package="${package}" tag="MEMORY_EFFICIENT"
				dest="."
			  />
	</target>
	<target name="all"
				depends="sat,javadoc"
			>
			<echo>
	You just built SAT4J from CVS. 
	The code might not be in a very good shape.
	You should take a look at http://www.sat4j.org/junit/ 
	to check that the functional tests are ok. 
	Use that snapshot at your own risk! :-=)
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Please fill bug reports and feature requests at 
	http://forge.objectweb.org/tracker/?group_id=228
					</echo>
		</target>
	<!--
	<target name="anthill"
			depends="build,javadoc,jdepend,checkstyle,tests,publish"/>
	-->
	<target name="clean">
		<!-- Delete the ${build} and ${dist} directory trees -->
		<delete dir="${build}" />
		<delete dir="${doc}" />
	</target>

</project>


    Date Index  -->     Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.