Skip to content

Commit 6f4c2e7

Browse files
committed
Lowered memory usage for unit tests
1 parent de3b298 commit 6f4c2e7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

nipype/interfaces/tests/test_runtime_profiler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ def _use_gb_ram(num_gb):
6969

7070
# Spin CPU
7171
ctr = 0
72-
while ctr < 50e6:
72+
while ctr < 30e6:
7373
ctr += 1
7474

7575
# Clear memory
7676
del ctr
7777
del gb_str
7878

7979
# Import packages
80-
from threading import Thread
8180
from multiprocessing import Process
81+
from threading import Thread
8282

8383
# Init variables
8484
num_gb = float(num_gb)
8585

8686
# Build thread list
8787
thread_list = []
8888
for idx in range(num_threads):
89-
thread = Thread(target=_use_gb_ram, args=(num_gb/num_threads,),
89+
thread = Process(target=_use_gb_ram, args=(num_gb/num_threads,),
9090
name=str(idx))
9191
thread_list.append(thread)
9292

@@ -130,11 +130,11 @@ def setUp(self):
130130

131131
# Init parameters
132132
# Input RAM GB to occupy
133-
self.num_gb = 4
133+
self.num_gb = 1.0
134134
# Input number of sub-threads (not including parent threads)
135-
self.num_threads = 4
135+
self.num_threads = 2
136136
# Acceptable percent error for memory profiled against input
137-
self.mem_err_percent = 10
137+
self.mem_err_percent = 25
138138

139139
# ! Only used for benchmarking the profiler over a range of
140140
# ! RAM usage and number of threads

nipype/interfaces/tests/use_resources

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def use_gb_ram(num_gb):
2121

2222
# Spin CPU
2323
ctr = 0
24-
while ctr < 10e6:
24+
while ctr < 30e6:
2525
ctr+= 1
2626

2727
# Clear memory

nipype/utils/draw_gantt_chart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import datetime
1111
import random
1212
from collections import OrderedDict
13-
# Pandas
13+
# Pandas
1414
try:
1515
import pandas as pd
1616
except ImportError:

0 commit comments

Comments
 (0)