Fix HPL MPI stub header and keep full build logs

This commit is contained in:
Mikhail Chusavitin
2026-04-08 09:45:14 +03:00
parent 0660a40287
commit 4715059ac0

View File

@@ -236,10 +236,9 @@ cd "${SRC_DIR}"
# Write a minimal single-process MPI stub so we don't need an MPI package.
# HPL only needs these functions for single-process execution.
cat > "${BUILD_TMP}/mpi_stub.c" <<'MPISTUB'
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
cat > "${BUILD_TMP}/mpi.h" <<'MPIHEADER'
#ifndef BEE_MPI_STUB_H
#define BEE_MPI_STUB_H
typedef int MPI_Comm;
typedef int MPI_Datatype;
@@ -259,6 +258,32 @@ typedef int MPI_Request;
#define MPI_ANY_TAG -1
#define MPI_STATUS_IGNORE ((MPI_Status*)0)
int MPI_Init(int *argc, char ***argv);
int MPI_Finalize(void);
int MPI_Comm_rank(MPI_Comm c, int *rank);
int MPI_Comm_size(MPI_Comm c, int *size);
int MPI_Bcast(void *b, int n, MPI_Datatype t, int r, MPI_Comm c);
int MPI_Reduce(const void *s, void *r, int n, MPI_Datatype t, MPI_Op op, int root, MPI_Comm c);
int MPI_Allreduce(const void *s, void *r, int n, MPI_Datatype t, MPI_Op op, MPI_Comm c);
int MPI_Send(const void *b, int n, MPI_Datatype t, int d, int tag, MPI_Comm c);
int MPI_Recv(void *b, int n, MPI_Datatype t, int s, int tag, MPI_Comm c, MPI_Status *st);
int MPI_Sendrecv(const void *sb, int sn, MPI_Datatype st2, int dest, int stag,
void *rb, int rn, MPI_Datatype rt, int src, int rtag,
MPI_Comm c, MPI_Status *status);
int MPI_Irecv(void *b, int n, MPI_Datatype t, int s, int tag, MPI_Comm c, MPI_Request *req);
int MPI_Wait(MPI_Request *req, MPI_Status *st);
int MPI_Abort(MPI_Comm c, int code);
double MPI_Wtime(void);
#endif
MPIHEADER
cat > "${BUILD_TMP}/mpi_stub.c" <<'MPISTUB'
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "mpi.h"
int MPI_Init(int *argc, char ***argv) { (void)argc; (void)argv; return MPI_SUCCESS; }
int MPI_Finalize(void) { return MPI_SUCCESS; }
int MPI_Comm_rank(MPI_Comm c, int *rank) { (void)c; *rank = 0; return MPI_SUCCESS; }
@@ -342,7 +367,7 @@ gcc -O2 -c -o "${BUILD_TMP}/mpi_stub.o" "${BUILD_TMP}/mpi_stub.c"
# build HPL
echo "=== building HPL ${HPL_VERSION} ==="
make -j"$(nproc)" arch=bee 2>&1 | tail -20
make -j"$(nproc)" arch=bee
XHPL_BIN="bin/bee/xhpl"
[ -x "${XHPL_BIN}" ] || { echo "ERROR: xhpl not found after build"; exit 1; }