Changeset 6e5b2a7 in sasmodels
- Timestamp:
- Sep 30, 2016 5:31:12 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 2222134
- Parents:
- 0bef47b
- git-author:
- Paul Kienzle <pkienzle@…> (09/30/16 05:31:12)
- git-committer:
- Andrew Jackson <andrew.jackson@…> (09/30/16 05:31:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelcl.py
ra557a99 r6e5b2a7 54 54 import warnings 55 55 import logging 56 import time 56 57 57 58 import numpy as np # type: ignore … … 557 558 #call_details.show(values) 558 559 # Call kernel and retrieve results 559 last_call = None 560 step = 100 560 wait_for = None 561 last_nap = time.clock() 562 step = 1000000//self.q_input.nq + 1 561 563 for start in range(0, call_details.num_eval, step): 562 564 stop = min(start + step, call_details.num_eval) 563 565 #print("queuing",start,stop) 564 566 args[1:3] = [np.int32(start), np.int32(stop)] 565 last_call = [kernel(self.queue, self.q_input.global_size, 566 None, *args, wait_for=last_call)] 567 wait_for = [kernel(self.queue, self.q_input.global_size, None, 568 *args, wait_for=wait_for)] 569 if stop < call_details.num_eval: 570 # Allow other processes to run 571 wait_for[0].wait() 572 current_time = time.clock() 573 if current_time - last_nap > 0.5: 574 time.sleep(0.05) 575 last_nap = current_time 567 576 cl.enqueue_copy(self.queue, self.result, self.result_b) 568 577 #print("result", self.result)
Note: See TracChangeset
for help on using the changeset viewer.