Skip to content

Commit 8f293d9

Browse files
committed
cleaner libreactant
1 parent aca4040 commit 8f293d9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

deps/ReactantExtra/API.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,17 +2715,18 @@ struct LinkableRuntime {
27152715
auto mpi = getenv("OMPI_COMM_WORLD_RANK");
27162716
device = 0;
27172717
if (mpi) {
2718-
llvm::errs() << " mpi : " << mpi << "\n";
27192718
device = atoi(mpi);
2720-
} else
2721-
llvm::errs() << " mpi: null\n";
2719+
}
2720+
27222721
client = nullptr;
27232722

27242723
if (backend == "xla-tpu") {
27252724
if (device == 0) {
27262725
client = MakeTPUClient(nullptr, &error);
2727-
if (error)
2726+
if (error) {
27282727
llvm::errs() << " error: " << error << "\n";
2728+
exit(1);
2729+
}
27292730
}
27302731
} else if (backend == "xla-gpu") {
27312732
int node_id = 0;
@@ -2740,8 +2741,10 @@ struct LinkableRuntime {
27402741
client = MakeGPUClient(node_id, num_nodes, allowed_devices,
27412742
num_allowed_devices, mem_fraction, gpu_preallocate,
27422743
platform, &refstr, distributed_runtime_client);
2743-
if (!client)
2744+
if (!client) {
27442745
llvm::errs() << " error: " << refstr << "\n";
2746+
exit(1);
2747+
}
27452748
assert(client);
27462749
// Weird stream issue in freeing cuda client.
27472750
shouldFreeClient = false;

0 commit comments

Comments
 (0)