Commit 482bd15f authored by Francois Tessier's avatar Francois Tessier

Fix Lustre API issues with a local copy of header files and a patch for C++

parent 48f7d6dc
MPICXX = CC
MPI_CFLAGS = -g -O3 -I./topology/
MPI_CFLAGS += -DXC40 #-DDEBUG -DTIMING
MPI_CFLAGS = -g -O3 -I./topology/ -I./topology/include/
MPI_CFLAGS += -DXC40 -llustreapi #-DDEBUG -DTIMING
INSTALL_PATH = $(HOME)/install
......@@ -5,6 +5,10 @@
#include <stdlib.h>
#include "topology.hpp"
#include <pmi.h>
#include <lustre/lustreapi.h>
#include <lustre/lustre_user.h>
class Topology: public iTopology {
public:
/**********************/
......@@ -26,26 +30,53 @@ public:
int ProcessPerNode () {
return 0;
int ppn, err;
err = PMI_Get_numpes_on_smp ( &ppn );
if ( err != PMI_SUCCESS ) {
fprintf (stderr, "[ERROR] PMI_Get_numpes_on_smp failed!\n");
MPI_Abort (MPI_COMM_WORLD, -1);
}
return ppn;
}
/**********************/
/* |-- Network */
/**********************/
/*
* X : Rank 3 (Optics cables between groups : 12.5 Gbps)
* Y : Rank 2 (Copper cables between 6 backplanes : 14 Gbps)
* Z : Rank 1 (Copper cables between 16 aries routers in a backplane :14 Gbps)
* nid : Node identifier
*
* http://www.nersc.gov/users/computational-systems/edison/configuration/interconnect/
*
*/
int NetworkDimensions () {
return 0;
return 4;
}
/* |---- Coordinates */
void RankToCoordinates ( int rank, int* coord ) {
pmi_mesh_coord_t xyz;
int nid;
/* Hypothesis : PMI_rank == MPI_rank */
PMI_Get_nid(rank, &nid);
PMI_Get_meshcoord((pmi_nid_t) nid, &xyz);
coord[0] = xyz.mesh_x;
coord[1] = xyz.mesh_y;
coord[2] = xyz.mesh_z;
coord[3] = nid;
}
void IONodeCoordinates ( int* coord ) {
}
......
This diff is collapsed.
--- /usr/include/lustre/lustre_user.h 2017-02-17 03:43:53.000000000 +0000
+++ lustre_user.h 2017-03-16 14:55:10.257941000 +0000
@@ -911,7 +911,7 @@
static inline size_t changelog_rec_size(struct changelog_rec *rec)
{
- return changelog_rec_offset(rec->cr_flags);
+ return changelog_rec_offset(static_cast<changelog_rec_flags>(rec->cr_flags));
}
static inline size_t changelog_rec_varsize(struct changelog_rec *rec)
@@ -922,7 +922,7 @@
static inline
struct changelog_ext_rename *changelog_rec_rename(struct changelog_rec *rec)
{
- enum changelog_rec_flags crf = rec->cr_flags & CLF_VERSION;
+ enum changelog_rec_flags crf = static_cast<changelog_rec_flags>(rec->cr_flags & CLF_VERSION);
return (struct changelog_ext_rename *)((char *)rec +
changelog_rec_offset(crf));
@@ -932,8 +932,8 @@
static inline
struct changelog_ext_jobid *changelog_rec_jobid(struct changelog_rec *rec)
{
- enum changelog_rec_flags crf = rec->cr_flags &
- (CLF_VERSION | CLF_RENAME);
+ enum changelog_rec_flags crf = static_cast<changelog_rec_flags>(rec->cr_flags &
+ (CLF_VERSION | CLF_RENAME));
return (struct changelog_ext_jobid *)((char *)rec +
changelog_rec_offset(crf));
@@ -942,8 +942,8 @@
/* The name follows the rename and jobid extensions, if present */
static inline char *changelog_rec_name(struct changelog_rec *rec)
{
- return (char *)rec + changelog_rec_offset(rec->cr_flags &
- CLF_SUPPORTED);
+ return (char *)rec + changelog_rec_offset(static_cast<changelog_rec_flags>(rec->cr_flags &
+ CLF_SUPPORTED));
}
static inline size_t changelog_rec_snamelen(struct changelog_rec *rec)
@@ -983,7 +983,7 @@
char *jid_mov;
char *rnm_mov;
- crf_wanted &= CLF_SUPPORTED;
+ crf_wanted = static_cast<changelog_rec_flags>(crf_wanted & CLF_SUPPORTED);
if ((rec->cr_flags & CLF_SUPPORTED) == crf_wanted)
return;
@@ -994,9 +994,9 @@
/* Locations of jobid and rename extensions in the remapped record */
jid_mov = (char *)rec +
- changelog_rec_offset(crf_wanted & ~CLF_JOBID);
+ changelog_rec_offset(static_cast<changelog_rec_flags>(crf_wanted & ~CLF_JOBID));
rnm_mov = (char *)rec +
- changelog_rec_offset(crf_wanted & ~(CLF_JOBID | CLF_RENAME));
+ changelog_rec_offset(static_cast<changelog_rec_flags>(crf_wanted & ~(CLF_JOBID | CLF_RENAME)));
/* Move the extension fields to the desired positions */
if ((crf_wanted & CLF_JOBID) && (rec->cr_flags & CLF_JOBID))
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment