2017-05-21 5 views
0

make 명령을 실행할 때 코드를 성공적으로 컴파일 할 수 있습니다. 나는이 코드를 실행할 때, :OpenMPI 런타임 오류 : Hello World

mpirun -np 4 test 

이 오류가 생성됩니다

------------------------------------------------------- 
Primary job terminated normally, but 1 process returned 
a non-zero exit code.. Per user-direction, the job has been aborted. 
------------------------------------------------------- 
-------------------------------------------------------------------------- 
mpirun detected that one or more processes exited with non-zero status, thus causing 
the job to be terminated. The first process to do so was: 

    Process name: [[63067,1],2] 
    Exit code: 1 
-------------------------------------------------------------------------- 

나는 더 여러 MPI의 설치가없는 나는 문제가있는 기대가 없습니다.

Hello World OpenMPI 프로그램에 문제가 있습니다. 내 주요 파일은 다음과 같습니다

#include <iostream> 
#include "mpi.h" 

using namespace std; 

int main(int argc, const char * argv[]) { 


    MPI_Init(NULL, NULL); 

    int size, rank; 

    MPI_Comm_size(MPI_COMM_WORLD, &size); 
    MPI_Comm_rank(MPI_COMM_WORLD, &rank); 

    cout << "The number of spawned processes are " << size << "And this is the process " << rank; 

    MPI_Finalize(); 


    return 0; 

} 

내 메이크 파일은 다음과 같습니다

# Compiler 
CXX = mpic++ 

# Compiler flags 
CFLAGS = -Wall -lm 

# Header and Library Paths 
INCLUDE = -I/usr/local/include -I/usr/local/lib -I.. 
LIBRARY_INCLUDE = -L/usr/local/lib 
LIBRARIES = -l mpi 

# the build target executable 
TARGET = test 

all: $(TARGET) 

$(TARGET): main.cpp 
    $(CXX) $(CFLAGS) -o $(TARGET) main.cpp $(INCLUDE) $(LIBRARY_INCLUDE) $(LIBRARIES) 


clean: 
    rm $(TARGET) 

의 출력 : mpic++ --version은 다음과 같습니다

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 8.1.0 (clang-802.0.42) 
Target: x86_64-apple-darwin16.5.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 

그리고 mpirun --version에 대한 즉 :

mpirun (Open MPI) 2.1.1 

Report bugs to http://www.open-mpi.org/community/help/ 

무엇이 될 수 있을까? 문제가 발생 했나요?

답변

0

이제 해결되었습니다. [email protected]

: 내가

mpirun -np 4 ./test 

참고로 실행해야 밝혀