Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
argotk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
argo
argotk
Commits
1fd5b1a9
Commit
1fd5b1a9
authored
Mar 08, 2019
by
Valentin Reis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapM -> for
parent
288bbb1c
Pipeline
#5933
passed with stages
in 2 minutes and 37 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
29 deletions
+48
-29
Makefile
Makefile
+11
-0
share/openmc/settings.xml
share/openmc/settings.xml
+1
-1
src/Argo/Stack.hs
src/Argo/Stack.hs
+20
-14
src/argotk.hs
src/argotk.hs
+16
-14
No files found.
Makefile
0 → 100644
View file @
1fd5b1a9
.PHONY
:
ghcid-tests ghcid-lib
ghcid-lib
:
sh
-c
"while true; do
\
nix-shell
\
--run 'ghcid
\
--command
\"
cabal new-repl argotk
\"
\
--restart=argotk.cabal
\
--restart=default.nix
\
--restart=shell.nix'
\
; done"
share/openmc/settings.xml
View file @
1fd5b1a9
...
...
@@ -2,7 +2,7 @@
<settings>
<run_mode>
eigenvalue
</run_mode>
<particles>
100
</particles>
<batches>
80
0
</batches>
<batches>
6
0
</batches>
<inactive>
1
</inactive>
<source
strength=
"1.0"
>
<space
type=
"fission"
>
...
...
src/Argo/Stack.hs
View file @
1fd5b1a9
...
...
@@ -34,23 +34,29 @@ import Data.Text as T
import
Argo.Utils
import
System.Process
as
P
hiding
(
shell
)
import
Control.Monad
as
CM
import
Control.Monad
(
mapM_
,
filterM
)
import
Data.Foldable
(
for_
)
import
Data.Traversable
(
for
)
import
Data.Maybe
import
Control.Foldl
as
Fold
(
length
)
import
Text.Show.Pretty
cleanLeftovers
::
WorkingDirectory
->
Shell
()
--TODO
cleanLeftovers
(
WorkingDirectory
wd
)
=
do
printInfo
"Cleaning sockets."
CM
.
mapM_
cleanSocket
for_
socklist
cleanSocket
printInfo
"Cleaning output directory."
void
$
shell
(
format
(
"rm -rf "
%
fp
)
wd
)
Turtle
.
empty
where
socklist
=
[
"/tmp/nrm-downstream-in"
,
"/tmp/nrm-downstream-event"
,
"/tmp/nrm-upstream-in"
,
"/tmp/nrm-upstream-event"
]
printInfo
"Cleaning output directory."
void
$
shell
(
format
(
"rm -rf "
%
fp
)
wd
)
Turtle
.
empty
prepareDaemon
::
StdOutLog
...
...
@@ -167,11 +173,13 @@ runStack sa@StackArgs {..} = do
when
(
powercap
/=
None
)
$
do
user
<-
lineToText
<$>
single
(
inproc
"whoami"
[]
empty
)
chownPowercapFiles
user
"/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0"
chownPowercapFiles
user
"/sys/devices/virtual/powercap/intel-rapl/intel-rapl:1"
chownPowercapFiles
user
"/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0"
chownPowercapFiles
user
"/sys/devices/virtual/powercap/intel-rapl/intel-rapl:1"
cleanLeftovers
workingDirectory
CM
.
mapM_
(
$
coerce
workingDirectory
)
[
mktree
,
cd
]
mapM_
(
$
coerce
workingDirectory
)
[
mktree
,
cd
]
iDaemon
<-
case
daemon
of
DontRun
->
return
Nothing
...
...
@@ -202,8 +210,8 @@ runStack sa@StackArgs {..} = do
printInfo
"Starting the following processes:"
liftIO
$
pPrint
ilist
asyncs
<-
liftIO
$
mapM
tupleToAsync
ilist
_
<-
liftIO
$
kbInstallHandler
$
CM
.
mapM_
cancel
asyncs
asyncs
<-
liftIO
$
for
ilist
tupleToAsync
_
<-
liftIO
$
kbInstallHandler
$
for_
asyncs
cancel
when
verbose
$
printInfo
"Processes started."
...
...
@@ -235,10 +243,8 @@ runStack sa@StackArgs {..} = do
chownPowercap
user
fn
=
shell
(
format
(
"sudo chown "
%
s
%
":"
%
s
%
" "
%
s
)
user
user
fn
)
empty
>>=
\
case
ExitSuccess
->
printWarning
$
"changed ownership on "
<>
fn
ExitFailure
_
->
die
$
"Couldn't change ownership on "
<>
fn
ExitSuccess
->
printWarning
$
"changed ownership on "
<>
fn
ExitFailure
_
->
die
$
"Couldn't change ownership on "
<>
fn
chownPowercapFiles
user
p
=
chownPowercap
user
(
p
<>
"/constraint_1_power_limit_uw"
)
...
...
src/argotk.hs
View file @
1fd5b1a9
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module
Main
(
main
)
where
{-|
Module : argotk.hs
Description : argo provisioner/executor
...
...
@@ -10,6 +14,7 @@ Maintainer : fre@freux.fr
-}
import
Data.Coerce
(
coerce
)
import
Data.Foldable
(
for_
)
import
Argo.Stack
import
Argo.Utils
import
Argo.Types
...
...
@@ -320,7 +325,7 @@ opts sa = hsubparser
commandTest
ttype
=
command
(
show
ttype
)
$
info
(
action
ttype
)
(
progDesc
$
T
.
unpack
$
descTest
ttype
)
commandTests
ttypes
cmdStr
descStr
=
command
cmdStr
$
info
(
pure
$
mapM_
(
doTest
sa
)
ttypes
)
(
progDesc
$
T
.
unpack
descStr
)
$
info
(
pure
$
for_
ttypes
(
doTest
sa
)
)
(
progDesc
$
T
.
unpack
descStr
)
doTest
::
StackArgs
->
TestName
->
Shell
()
doTest
stackArgs
ttype
=
doSpec
spec
...
...
@@ -345,17 +350,14 @@ fullStack isTest a@StackArgs {..} = do
case
stackOutput
of
FoundMessage
msg
->
printSuccess
$
"Found string in message:"
<>
repr
msg
FoundTracebacks
tsl
->
do
mapM_
(
\
(
stacki
,
fout
,
ferr
)
->
printError
$
"Found Python Traceback when executing "
<>
repr
stacki
<>
". Files for this command: "
<>
repr
fout
<>
" "
<>
repr
ferr
)
tsl
for_
tsl
$
\
(
stacki
,
fout
,
ferr
)
->
printError
$
"Found Python Traceback when executing "
<>
repr
stacki
<>
". Files for this command: "
<>
repr
fout
<>
" "
<>
repr
ferr
exit
(
ExitFailure
1
)
Died
stacki
errorcode
_
_
tsl
->
case
isTest
of
IsTest
->
do
...
...
@@ -364,7 +366,8 @@ fullStack isTest a@StackArgs {..} = do
<>
" died before a message could be found with error code "
<>
repr
errorcode
)
mapM_
for_
tsl
(
\
(
stacki'
,
fout
,
ferr
)
->
printError
$
"Found Python Traceback when executing "
...
...
@@ -374,7 +377,6 @@ fullStack isTest a@StackArgs {..} = do
<>
" "
<>
repr
ferr
)
tsl
exit
(
ExitFailure
1
)
NotTest
->
exit
ExitSuccess
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment