Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added Extra comments to show where non-parallel code begins and ends and
also where parallel code begins and ends
  • Loading branch information
Tony authored and Tony committed Dec 10, 2015
1 parent a2a29a2 commit cd86205
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 15 deletions.
Binary file not shown.
Binary file modified jOptJSRecover/bin/jopt/js/spi/graph/arc/ForwardCheckArc.class
Binary file not shown.
Binary file not shown.
Binary file modified jOptJSRecover/bin/jopt/js/spi/variable/JsVarFactory.class
Binary file not shown.
Expand Up @@ -207,7 +207,9 @@ public class DiscreteResourceDomain extends ResourceDomain {
}
}

/* int maxValue = 0;
/*
//(Non- Parallel Code Begin)
int maxValue = 0;
for (int i=0; i<indices.size(); i++) {
index = indices.get(i);
int val = worthes.get(i);
Expand Down Expand Up @@ -236,12 +238,12 @@ public class DiscreteResourceDomain extends ResourceDomain {
}
}
}
//(Non-Parallel Code End)
*/


// Modified code for adding in parallel capabilities
// Begin Parallelization Code



int maxValue = 0;
// val_positions will hold indices that have vals that
//are greater than maxValue;
Expand Down Expand Up @@ -305,7 +307,7 @@ public class DiscreteResourceDomain extends ResourceDomain {
maxValue = worthes.get(start_pos);
}

// End Parallelization
// End Parallelization Code



Expand Down
9 changes: 6 additions & 3 deletions jOptJSRecover/src/jopt/js/spi/graph/arc/ForwardCheckArc.java
Expand Up @@ -38,7 +38,8 @@ public class ForwardCheckArc extends SchedulerArc {
Arrays.sort(targetIDs);
this.targets = new ResourceNode[targets.length];
/*
//(Non-parallel implementation) This will ensure that resources are ordered for fast easy access later
//(Non-parallel implementation Code Begins)
//This will ensure that resources are ordered for fast easy access later
for (int i=0; i<targetIDs.length; i++) {
for (int j=0; j<targets.length; j++) {
if (targetIDs[i] == targets[j].getID()) {
Expand All @@ -47,9 +48,11 @@ public class ForwardCheckArc extends SchedulerArc {
}
}
}*/
//(Non-parallel implementation Code Ends)


// Parallelization implementation Begins

// Parallelization implementation Begins
// - Creates an object that will split the task of the above code into separate tasks.


Expand All @@ -60,7 +63,7 @@ public class ForwardCheckArc extends SchedulerArc {
this.targets = target_loop.get_main_vars(); // Will grab the targets object from forking


// Parallelization implementation End
// Parallelization implementation End



Expand Down
Expand Up @@ -37,7 +37,9 @@ public class ForwardCheckReflexArc extends SchedulerArc {
Arrays.sort(sourceIDs);
this.sources= new ResourceNode[sources.length];

/* //(Non-parallel implementation) This will ensure that resources are ordered for fast and easy access later
/*
//(Non-parallel implementation Begins)
//This will ensure that resources are ordered for fast and easy access later
for (int i=0; i<sourceIDs.length; i++) {
for (int j=0; j<sources.length; j++) {
if (sourceIDs[i] == sources[j].getID()) {
Expand All @@ -47,8 +49,10 @@ public class ForwardCheckReflexArc extends SchedulerArc {
}
}
*/
//(Non-parallel implementation Ends)

// Parallelization implementation Code Begins

// Parallelization implementation
// - Creates an object that will split the task of the above code into separate tasks.


Expand All @@ -58,7 +62,7 @@ public class ForwardCheckReflexArc extends SchedulerArc {
this.sources = source_loop.get_main_vars();


// Parallelization end
// Parallelization Implementation End


this.operationID = operationID;
Expand Down
11 changes: 7 additions & 4 deletions jOptJSRecover/src/jopt/js/spi/variable/JsVarFactory.java
Expand Up @@ -115,7 +115,9 @@ public class JsVarFactory extends VarFactory implements JsVariableFactory {

int index = offset;

/* // (Non - Parallel Implementation) //
/*
// (Non - Parallel Implementation Begins) //
for (int i=1; i<capacity.length; i++) {
for (int j=0; j<4; j++) {
if (index<neoCapacity.length) {
Expand All @@ -126,9 +128,10 @@ public class JsVarFactory extends VarFactory implements JsVariableFactory {
}
*/
// (Non - Parallel Implementation Ends)

// Parrallelization Process

// Parallelization Code Begins


ForkSplit_NeoCap neocap_loop = new ForkSplit_NeoCap(index, index + 4*(capacity.length-1),
Expand All @@ -137,7 +140,7 @@ public class JsVarFactory extends VarFactory implements JsVariableFactory {
neocap_join.invoke(neocap_loop);


// End Parrallelization Process
//Parallelization Code Ends



Expand Down

0 comments on commit cd86205

Please sign in to comment.