Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6810b06
Update README.md
mleoking Apr 16, 2015
38b22f6
Update README.md
mleoking Apr 16, 2015
2385994
Update README.md
mleoking Apr 16, 2015
7af6e02
Update README.md
mleoking Apr 16, 2015
0745c4f
Update README.md
mleoking Apr 16, 2015
6dc91af
Update README.md
mleoking Apr 16, 2015
902ce20
Update README.md
mleoking Apr 16, 2015
aa865d4
update introduction
mleoking Apr 17, 2015
82e18cf
Update README.md
mleoking Apr 17, 2015
4c27f85
Update README.md
mleoking Apr 17, 2015
d908b56
Update README.md
mleoking Apr 19, 2015
4a9b510
Update README.md
mleoking Apr 19, 2015
4aac099
1 Modify the roll dice example app to use 90% CPU cores and repeat 2000
mleoking Apr 19, 2015
c01653b
update .gitignore
mleoking Apr 20, 2015
169074b
rolldice.xml
mleoking Apr 20, 2015
4f3bd3c
rolldice.xml
mleoking Apr 20, 2015
6a57cc0
add .gitignore
mleoking Apr 20, 2015
7b0d992
Update README.md
mleoking Apr 21, 2015
edf8956
Update README.md
mleoking Apr 22, 2015
3727bc5
Update README.md
mleoking Apr 24, 2015
3236622
Update README.md
mleoking Apr 24, 2015
de52c4d
Update README.md
mleoking Apr 24, 2015
0a614fc
Update README.md
mleoking Apr 29, 2015
2c529c9
Updated the demo for DelimitedReader
mleoking May 1, 2015
b6dbbf1
Merge remote-tracking branch 'origin/master'
mleoking May 1, 2015
f90cb53
updated .gitignore
mleoking May 15, 2015
fd0cb1a
Update README.md
mleoking Nov 21, 2015
4ed8e25
Add a Bitdeli badge to README
bitdeli-chef Dec 23, 2015
b5e675e
Merge pull request #1 from bitdeli-chef/master
mleoking Dec 23, 2015
7a89669
Simplified the example code.
mleoking Jan 3, 2016
b4f5ea8
Updated the demo for JGnuplot (JavaGnuplotHybrid), added examples for
mleoking Mar 27, 2016
7b9664f
jgnuplot2.xml is not copied from the class path. It is already in the
mleoking Mar 27, 2016
addb119
Update README.md
mleoking Mar 27, 2016
fab3e84
add doc folder and move introduction to the doc.
mleoking Mar 27, 2016
fd51a2a
Update README.md
mleoking Mar 27, 2016
957c340
Update README.md
mleoking Apr 4, 2016
3c3eb07
Update README.md
mleoking Sep 30, 2017
25fb8f2
Update README.md
mleoking Jun 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#LeoTask
# LeoTask

LeoTask is a parallel task running and results aggregation framework. It is a free and open-source project designed to facilitate running computational intensive tasks [1]. The framework implements the MapReduce model, allocating tasks to multi-cores of a computer and aggregating results according to a XML based configuration file. The framework includes mechanisms to automatically recover applications from interruptions caused by accidents (e.g. Power Cut). Applications using the framework can continue running after an interruption without losing its calculated results.
LeoTask is a parallel task running and results aggregation (MapReduce) framework. It is a free and open-source project designed to facilitate running computational intensive tasks [1]. The framework implements the MapReduce model, allocating tasks to multi-cores of a computer and aggregating results according to a XML based configuration file. The framework includes mechanisms to automatically recover applications from interruptions caused by accidents (e.g. Power Cut). Applications using the framework can continue running after an interruption without losing its calculated results.

[**Download the latest version**](leotask/demo/leotask.zip?raw=true)
[**Download**](leotask/demo/leotask.zip?raw=true) | [**Introduction**](leotask/doc/introduction.pdf?raw=true) | [**Applications**](https://github.com/mleoking/LeoTaskApp) | [**Discussion**](http://groups.google.com/forum/#!forum/leotask) | [**Wiki**](https://github.com/mleoking/LeoTask/wiki)

## Features:

* Automatic & parallel parameter space exploration
* Flexible & configuration-based result aggregation
* Programming model focusing only on the key logic
* Reliable & automatic interruption recovery
* ...
* Automatic & parallel parameter space exploration.
* Flexible & configuration-based result aggregation.
* Programming model focusing only on the key logic.
* Reliable & automatic interruption recovery.
* Ultra lightweight ~ 300KB Jar.

## Utilities
* Dynamic & cloneable networks structures: a node, a link, a network, and a network set (within which networks can overlap with each other).
* Integration with Gnuplot
* Network generation according to common network models
* DelimitedReader: a sophisticated reader that explores CSV (Comma-separated values) files like a database
* Fast random number generator based on the Mersenne Twister algorithm
* ...
## Utilities:
* [All dynamic & cloneable networks structures](leotask/src/app/org/leores/demo/NetDemo.java): a node, a link, a network, a network set (within which networks can overlap with each other), multiplex networks.
* [Integration with Gnuplot](leotask/src/app/org/leores/demo/JGnuplotDemo.java): hybrid programming with Gnuplot, output statistic results as Gnuplot scripts.
* [Network generation according to common network models](leotask/src/app/org/leores/demo/ModDemo.java): random networks, scale-free networks, etc.
* [DelimitedReader](leotask/src/app/org/leores/demo/DelimitedReaderDemo.java): a sophisticated reader that explores CSV (Comma-Separated Values) files like a database.
* [Fast random number generator based on the Mersenne Twister algorithm](leotask/src/app/org/leores/demo/RandomUtilDemo.java).
* [Versatile curve fitter and function value optimizer (minimizer)](leotask/src/app/org/leores/demo/MathDemo.java).

## Example Application:

Please refer to [the introduction](https://github.com/mleoking/leotask/blob/master/leotask/introduction.pdf?raw=true) for building an example application using the framework.
Please refer to [the introduction](leotask/doc/introduction.pdf?raw=true) for building an example application using the framework.

### Code (RollDice.java):
```java
Expand All @@ -44,7 +44,7 @@ public class RollDice extends Task {
public boolean step() {
boolean rtn = iStep <= nDice;
if (rtn) {
sum += (int) (rand.nextDouble() * nSide);
sum += (int) (rand.nextDouble() * nSide + 1);
}
return rtn;
}
Expand All @@ -54,33 +54,32 @@ public class RollDice extends Task {
### Configuration (rolldice.xml):
```xml
<Tasks>
<name val="task-rolldice"/><usage val="0.5"/><nRepeats val="5"/><checkInterval val="4"/>
<name val="task-rolldice"/><usage val="0.9"/><nRepeats val="2000"/><checkInterval val="4"/>
<variables class="org.leores.task.app.RollDice">
<nSide val="2;4;6"/>
<nDice val="2:1:5"/><!--from 2 to 5 with a step of 1, i.e. 2;3;4;5 -->
</variables>
<statistics>
<members>
<i><info val="Fig1%pltm+@afterRept@"/><valVar val="sum;#$sum$/$nDice$#"/>
<parVars val="nSide;nDice"/></i>
<i><info val="Fig2%plt+@afterRept@"/><valVar val="sum"/><parVars val="nSide"/></i>
<i><info val="Fig3%plt+@afterRept@"/><valVar val="sum"/><parVars val="nDice"/></i>
<i><info val="afterRept@"/><valVar val="sum;#$sum$/$nDice$#"/><parVars val="nSide;nDice"/></i>
<i><info val="afterRept@"/><valVar val="sum"/><parVars val="nSide"/></i>
<i><info val="afterRept@"/><valVar val="sum"/><parVars val="nDice"/></i>
</members>
</statistics>
</Tasks>
```

Before running the example application, please install [Java](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) and include the the directory of the command _java_ in the system's _PATH_ environment variable.
Before running the example application, please install [Java](http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html) and include the the directory of the command _java_ in the system's _PATH_ environment variable. Windows system users can alternatively download and install (_install.bat_) the all-in-one runtime environment package: [LeoTaskRunEnv](https://github.com/mleoking/LeoTaskApp/releases/download/v1.0.0/LeoTaskRunEnv.zip)

Chang the current directory to the "Demo" folder and then execute the following commnad

java -jar leotask.jar -load=rolldice.xml

If you are using a MS windows system, you can also execute "rolldice.bat".

Additional applications using the framework can be found in [LeoTaskApp](https://github.com/mleoking/LeoTaskApp).

## References:

[1] Changwang Zhang, Shi Zhou, Benjamin M. Chain (January 2015). "[LeoTask: a fast, flexible and reliable framework for computational research](http://arxiv.org/abs/1501.01678)" (arXiv:1501.01678). Cornell University. [(PDF)](http://arxiv-web3.library.cornell.edu/pdf/1501.01678v1)
[1] Changwang Zhang, Shi Zhou, Benjamin M. Chain (2015). "[LeoTask: a fast, flexible and reliable framework for computational research](http://arxiv.org/abs/1501.01678)", arXiv:1501.01678. [(PDF)](http://arxiv-web3.library.cornell.edu/pdf/1501.01678v1)



8 changes: 8 additions & 0 deletions leotask/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/bin/

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini
1 change: 0 additions & 1 deletion leotask/bin/.gitignore

This file was deleted.

64 changes: 38 additions & 26 deletions leotask/demo/dreader.csv
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
Test file for csv reader,,,
----,,,
1,2,3,4
5,6,7,8
data,end,,
---,,,
---,,,
data,start1,,
c1,c2,c3,c4
1,10,100,1000
2,20,200,1100
,,,
data,end,,
data,start2,,
c1,c2,c3,c4
1,30,300,2000
4,40,400,9000
1,50,500
data,start3,,
c1,c2,c3,c4
1,30,300,3000
1,40,400,4000
2,50,500,
2,50,500,
1,30,300,5000
1,40,400,6000
Test file for csv reader,,,,
----,,,,
1,2,3,4,
5,6,7,8,
data,end,,,
---,,,,
---,,,,
data,start1,,,
c1,c2,c3,c4,
1,10,100,1000,
2,20,200,1100,
,,,,
data,end,,,
data,start2,,,
c1,c2,c3,c4,
1,30,300,2000,
4,40,400,9000,
1,50,500,,
data,start3,,,
c1,c2,c3,c4,
1,30,300,3000,
1,40,400,4000,
2,50,500,,
2,50,500,,
1,30,300,5000,
1,40,400,6000,
data,end,,,
,,,,
id,name,age,,
mm1,Leo,25,,
mm2,Emily,18,,
,,,,
id,date,blood pressure,heart rate,mood
mm1,01-Apr,100,50,Happy
mm1,05-Apr,120,60,Sad
mm2,01-Apr,80,40,
mm2,03-Apr,90,,Sad
mm2,05-Apr,,50,Happy
Binary file modified leotask/demo/leotask.jar
Binary file not shown.
Binary file modified leotask/demo/leotask.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion leotask/demo/rolldice#.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Taskss>
<name val="rolldices"/><usage val="0.5"/><nRepeats val="5"/><!--<dataLevels val="SA"/>-->
<name val="rolldices"/><usage val="0.9"/><nRepeats val="2000"/><!--<dataLevels val="SA"/>-->
<sNameToRun val="setX;set1"/><!--<sPatNameToRun val=".*set\d"/>--><!--<bAggregateFile val="false"/>-->
<vMap val="~ls=info=rolldices $id$ nSide:$nSide$ nDice:$nDice$;logInfo=~afterRept@$sum$;}"/>
<members>
Expand Down
2 changes: 1 addition & 1 deletion leotask/demo/rolldice.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Tasks>
<name val="task-rolldice"/><usage val="0.5"/><nRepeats val="5"/><checkInterval val="4"/>
<name val="rolldice"/><usage val="0.9"/><nRepeats val="2000"/><checkInterval val="4"/>
<!--<sTaskMethodEnd val="mDrawPDF"/>--><!-- Uncomment this line if you have installed gnuplot4.6.5 and included its directory in the system variable PATH -->
<variables class="org.leores.task.app.RollDice">
<nSide val="2;4;6"/>
Expand Down
Binary file not shown.
29 changes: 25 additions & 4 deletions leotask/src/app/org/leores/demo/DelimitedReaderDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import org.leores.util.Logger;
import org.leores.util.U;
import org.leores.util.able.Processable1;
import org.leores.util.data.DataTable;

public class DelimitedReaderDemo extends Demo {
String sFile = "dreader.csv";

public void delimitedReader() {
String sFile = "dreader.csv";
String[] rowToStart1 = { "data", "start1" };
String[] columnsToRead = { "c4", "c1" };
String[] rowToEnd = { "data", "end" };
Expand Down Expand Up @@ -90,8 +91,6 @@ public void delimitedReader() {
}

protected void _readRowPatterns(String[] rowPattern, String[] rowToStart, String[] columnsToRead, String[] rowToEnd) {
String sFile = "dreader.csv";

DelimitedReader dr;
String[] row;
List<String[]> lrow;
Expand Down Expand Up @@ -174,10 +173,32 @@ public void readRowPatterns() {
_readRowPatterns(rowPatterns, rowToStartEnd, columnsToRead, rowToStartEnd);
}

public void readRelatedData() {
log("Read from related data:");
try {
DelimitedReader dr = new DelimitedReader(sFile);
dr.prep(null, new String[] { "id", "name" });
dr.setValidRowPattern(new String[] { null, "Emily" });
String[] row = dr.readValidRow();
String id = row[0];
dr.prep(null, new String[] { "id", "date", "mood", "blood pressure", "heart rate" });
dr.setValidRowPattern(new String[] { id });
DataTable dt = dr.readValidDataTable();

log(dt.getColNames());
for (int i = 0, mi = dt.nRows(); i < mi; i++) {
log(dt.getRow(i));
}
} catch (FileNotFoundException e) {
log(e);
}
}

public static void demo() {
DelimitedReaderDemo drd = new DelimitedReaderDemo();
//drd.delimitedReader();
drd.delimitedReader();
drd.readRowPatterns();
drd.readRelatedData();
}

}
4 changes: 2 additions & 2 deletions leotask/src/app/org/leores/demo/Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public static void main(String[] args) {
//DelimitedReaderDemo.demo();
//EpidemicDemo.demo();
//FileUtilDemo.demo();
//JGnuplotDemo.demo();
JGnuplotDemo.demo();
//MathDemo.demo();
//ModDemo.demo();
//NetDemo.demo();
//ObjUtilDemo.demo();
//ProcessableDemo.demo();
//RandomUtilDemo.demo();
TaskDemo.demo();
//TaskDemo.demo();
//UtilDemo.demo();
}
}
Loading