-\begin{minipage}{\textwidth}
-\begin{lstlisting}[frame=tb]
-FOR J:=1 to Some_iterations Do
- -Computations Section.
- -Communications Section.
- IF (J==1) THEN
- -Gather all times of computation and communication
- from each node.
- -Call EPSA with these times.
- -Calculate the new frequency from optimal scale.
- -Set the new frequency to the system.
- ENDIF
-ENDFOR
-\end{lstlisting}
-\end{minipage}
+%\begin{minipage}{\textwidth}
+%\AG{Use the same format as for Algorithm~\ref{EPSA}}
+
+\begin{algorithm}[d]
+ \caption{DVFS}
+ \label{dvfs}
+ \begin{algorithmic}
+ \For {$J:=1$ to $Some_iterations Do$}
+ \State -Computations Section.
+ \State -Communications Section.
+ \If {$(J==1)$}
+ \State -Gather all times of computation and\par
+ \State communication from each node.
+ \State -Call EPSA with these times.
+ \State -Calculate the new frequency from optimal scale.
+ \State -Set the new frequency to the system.
+ \EndIf
+\EndFor
+\end{algorithmic}
+\end{algorithm}
+\clearpage