Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Bug fix on new time iterator feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
lelandaisb committed Sep 16, 2020
1 parent a5b9bd5 commit 98ad161
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import fr.cea.nabla.ir.ir.InstructionJob
import fr.cea.nabla.ir.ir.IrModule
import fr.cea.nabla.ir.ir.Job
import fr.cea.nabla.ir.ir.TimeLoop
import fr.cea.nabla.ir.ir.TimeLoopContainer
import fr.cea.nabla.ir.ir.TimeLoopCopyJob
import fr.cea.nabla.ir.ir.TimeLoopJob

Expand Down Expand Up @@ -108,12 +107,9 @@ class JobContentProvider
}
}
private static def String getIndentation(TimeLoopContainer it)
private static def String getIndentation(TimeLoop it)
{
switch it
{
IrModule: ''
TimeLoop: getIndentation(container) + '\t'
}
if (container instanceof IrModule) ''
else getIndentation(container as TimeLoop) + '\t'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import fr.cea.nabla.ir.ir.InstructionJob
import fr.cea.nabla.ir.ir.IrModule
import fr.cea.nabla.ir.ir.Job
import fr.cea.nabla.ir.ir.TimeLoop
import fr.cea.nabla.ir.ir.TimeLoopContainer
import fr.cea.nabla.ir.ir.TimeLoopCopyJob
import fr.cea.nabla.ir.ir.TimeLoopJob
import fr.cea.nabla.javalib.mesh.PvdFileWriter2D
Expand Down Expand Up @@ -164,12 +163,9 @@ class JobInterpreter
}
}

private static def String getIndentation(TimeLoopContainer it)
private static def String getIndentation(TimeLoop it)
{
switch it
{
IrModule: ''
TimeLoop: getIndentation(container) + '\t'
}
if (container instanceof IrModule) ''
else getIndentation(container as TimeLoop) + '\t\t'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void ImplicitHeatEquation::simulate()
executeTimeLoopN();

std::cout << __YELLOW__ << "\n\tDone ! Took " << __MAGENTA__ << __BOLD__ << globalTimer.print() << __RESET__ << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / n << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / cg_info.m_nb_call << std::endl;
}

/******************** Module definition ********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void ImplicitHeatEquation::simulate()
executeTimeLoopN(); // @4.0

std::cout << __YELLOW__ << "\n\tDone ! Took " << __MAGENTA__ << __BOLD__ << globalTimer.print() << __RESET__ << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / n << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / cg_info.m_nb_call << std::endl;
}

/******************** Module definition ********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void ImplicitHeatEquation::simulate()
executeTimeLoopN(); // @4.0

std::cout << __YELLOW__ << "\n\tDone ! Took " << __MAGENTA__ << __BOLD__ << globalTimer.print() << __RESET__ << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / n << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / cg_info.m_nb_call << std::endl;
}

/******************** Module definition ********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void ImplicitHeatEquation::simulate()
executeTimeLoopN(); // @4.0

std::cout << __YELLOW__ << "\n\tDone ! Took " << __MAGENTA__ << __BOLD__ << globalTimer.print() << __RESET__ << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / n << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / cg_info.m_nb_call << std::endl;
}

/******************** Module definition ********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void ImplicitHeatEquation::simulate()
executeTimeLoopN(); // @4.0

std::cout << __YELLOW__ << "\n\tDone ! Took " << __MAGENTA__ << __BOLD__ << globalTimer.print() << __RESET__ << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / n << std::endl;
std::cout << "[CG] average iteration: " << cg_info.m_nb_it / cg_info.m_nb_call << std::endl;
}

/******************** Module definition ********************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class NablaScopeProvider extends AbstractDeclarativeScopeProvider
val iterators = module.iteration.eAllContents.filter(TimeIterator).toList
val iteratorsAndVars = new ArrayList<ArgOrVar>
iteratorsAndVars += module.allVars
iteratorsAndVars += iterators
iteratorsAndVars += subList(iterators, context)
iteratorsAndVars += context
Scopes::scopeFor(iteratorsAndVars)
}
Expand Down

0 comments on commit 98ad161

Please sign in to comment.