Skip to content

Commit

Permalink
+semver: major
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtsap committed Apr 10, 2022
1 parent dc19ca8 commit 3762582
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Uncertainty Quantification with python (UQpy)
+ + +
| | Promit Chakroborty, Lukáš Novák, Andrew Solanto |
+-----------------------+------------------------------------------------------------------+
| **Contributors:** | Michael Gardner, Ulrich Römer, Julius Schultz |
| **Contributors:** | Michael Gardner |
+-----------------------+------------------------------------------------------------------+

Contact
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ as a set of modules centered around core capabilities in Uncertainty Quantificat
+ + +
| | Promit Chakroborty, Lukáš Novák, Andrew Solanto |
+-----------------------+------------------------------------------------------------------+
| **Contributors:** | Michael Gardner, Ulrich Römer, Julius Schultz |
| **Contributors:** | Michael Gardner |
+-----------------------+------------------------------------------------------------------+

Introduction
Expand Down
23 changes: 2 additions & 21 deletions src/UQpy/run_model/model_execution/ParallelExecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
ranges_list = None
local_ranges = None
local_samples = None
# read model only in the first process
if comm.rank == 0:
n_existing_simulations = int(sys.argv[1])
n_new_simulations = int(sys.argv[2])
Expand All @@ -42,14 +41,12 @@
ranges_list = []
for i in range(comm.size):
start_index = samples_per_process * i
# print(f"Start_index for process {i} is {start_index}")
if start_index > n_samples:
samples_shape[0] = 0
samples_list.append(np.empty(samples_shape))
ranges_list.append(range(start_index, start_index))
continue
end_index = min(n_samples, samples_per_process * (i + 1))
# print(f"End_index for process {i} is {end_index}")
samples_list.append(samples.take(indices=range(start_index, end_index), axis=0))
ranges_list.append(range(start_index, end_index))

Expand All @@ -67,7 +64,6 @@
index_start = local_ranges[0]
print(index_start)
for i in local_ranges:
# print(f"Hello! I'm rank {comm.rank} and my samples are \n {local_samples}")
index = i - local_ranges[0]
sample = model.preprocess_single_sample(i, sample=local_samples[index])

Expand All @@ -81,25 +77,10 @@
result = []
[result.extend(el) for el in qoi]
with open('qoi.pkl', 'wb') as filehandle:
# model = pickle.dump(qoi, filehandle)
model = pickle.dump(result, filehandle)
# if comm.rank != 0:
# print(f"Hello! I'm rank {comm.rank} and qoi exists? {qoi}")
pickle.dump(result, filehandle)

comm.Barrier() # wait for everybody to synchronize _here_

except Exception as e:
print(e)

# from mpi4py import MPI
# import sys
#
# def print_hello(rank, size, name):
# msg = "Hello World! I am process {0} of {1} on {2}.\n"
# sys.stdout.write(msg.format(rank, size, name))
#
# if __name__ == "__main__":
# size = MPI.COMM_WORLD.Get_size()
# rank = MPI.COMM_WORLD.Get_rank()
# name = MPI.Get_processor_name()
#
# print_hello(rank, size, name)

0 comments on commit 3762582

Please sign in to comment.