Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling vt::initialize with no arguments silently makes VT fail #1163

Closed
lifflander opened this issue Nov 26, 2020 · 4 comments · Fixed by #1164
Closed

Calling vt::initialize with no arguments silently makes VT fail #1163

lifflander opened this issue Nov 26, 2020 · 4 comments · Fixed by #1164

Comments

@lifflander
Copy link
Collaborator

lifflander commented Nov 26, 2020

Describe the bug
A simple program that just calls vt::initialize() (without passing argc, argv) compiles and seems to do nothing.

@cz4rs
Copy link
Contributor

cz4rs commented Nov 26, 2020

reproduction:

diff --git a/examples/hello_world/hello_world.cc b/examples/hello_world/hello_world.cc
index b3dc561fb..2fde66be8 100644
--- a/examples/hello_world/hello_world.cc
+++ b/examples/hello_world/hello_world.cc
@@ -56,7 +56,7 @@ static void hello_world(HelloMsg* msg) {

 int main(int argc, char** argv) {
-  vt::initialize(argc, argv);
+  vt::initialize(/*argc, argv*/);
 
   vt::NodeType this_node = vt::theContext()->getNode();

output:

vt: [-1] 
vt: [-1]              Reason: MPI must be already initialized in VT interop-mode.
vt: [-1]                Type: vtAbort() Invoked
vt: [-1]                Node: -1
vt: [-1]           Num Nodes: -1
vt: [-1]                File: ../src/vt/runtime/runtime.cc
vt: [-1]                Line: 148
vt: [-1]            Function: Runtime
vt: [-1]                Code: 1
vt: [-1]           Build SHA: 65408f6a37b6c65c8c956a20afb220f381d493c3
vt: [-1]           Build Ref: refs/heads/develop
vt: [-1]         Description: heads/develop-0-g65408f6a37
vt: [-1]            GIT Repo: clean
vt: [-1]            Hostname: rysy
vt: [-1] 

gdb:

(gdb) bt
#0  vt::runtime::Runtime::Runtime (this=0x5555572db480, argc=@0x7fffffffdbcc: 0, argv=@0x7fffffffdbd0: 0x0, in_num_workers=-1, interop_mode=true, in_comm=1140850688, 
    in_instance=vt::runtime::DefaultInstance) at ../src/vt/runtime/runtime.cc:148
#1  0x00005555565101be in std::make_unique<vt::runtime::Runtime, int&, char**&, short const&, bool&, int&> () at /usr/include/c++/9/bits/unique_ptr.h:857
#2  0x000055555650f92e in vt::CollectiveAnyOps<(vt::runtime::eRuntimeInstance)0>::initialize (argc=@0x7fffffffdbcc: 0, argv=@0x7fffffffdbd0: 0x0, num_workers=-1, is_interop=true, comm=0x0)
    at ../src/vt/collective/collective_ops.cc:69
#3  0x0000555556511563 in vt::initialize (comm=0x0) at ../src/vt/collective/startup.cc:69
#4  0x00005555564cb0e3 in main (argc=1, argv=0x7fffffffddb8) at ../examples/hello_world/hello_world.cc:59

@lifflander
Copy link
Collaborator Author

Interesting.. I actually didn't get that assertion because I was in release mode. It just hung

@cz4rs
Copy link
Contributor

cz4rs commented Nov 26, 2020

a66cb35 fixes this (on my machine), but I'm not sure what's the desired behavior here

one minor thing to note: program name will be unknown in this case

vt: Runtime Initializing: mode: single-thread per rank
vt: Program: vt_unknown (vt_unknown)
vt: Running on: 1 node

@cz4rs
Copy link
Contributor

cz4rs commented Nov 26, 2020

it might be worth to look into vtAbortIf/vtAbort to check if it is possible to report something helpful in release mode

cz4rs added a commit that referenced this issue Dec 16, 2020
cz4rs added a commit that referenced this issue Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants