Skip to content

Commit

Permalink
Merge pull request #477 from hpc/fix-475
Browse files Browse the repository at this point in the history
Fix for c++ program issue #475.
  • Loading branch information
JulianKunkel authored Feb 16, 2024
2 parents b666c40 + 42bb576 commit bfc922f
Show file tree
Hide file tree
Showing 23 changed files with 71 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/aiori-CEPHFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ior_aiori_t cephfs_aiori = {
.open = CEPHFS_Open,
.xfer = CEPHFS_Xfer,
.close = CEPHFS_Close,
.delete = CEPHFS_Delete,
.remove = CEPHFS_Delete,
.get_options = CEPHFS_options,
.get_version = aiori_get_version,
.xfer_hints = CEPHFS_xfer_hints,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-CHFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ ior_aiori_t chfs_aiori = {
.xfer_hints = CHFS_xfer_hints,
.xfer = CHFS_xfer,
.close = CHFS_close,
.delete = CHFS_delete,
.remove = CHFS_delete,
.get_version = CHFS_version,
.fsync = CHFS_fsync,
.get_file_size = CHFS_get_file_size,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-DFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ ior_aiori_t dfs_aiori = {
.open = DFS_Open,
.xfer = DFS_Xfer,
.close = DFS_Close,
.delete = DFS_Delete,
.remove = DFS_Delete,
.get_version = DFS_GetVersion,
.fsync = DFS_Fsync,
.sync = DFS_Sync,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-DUMMY.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ ior_aiori_t dummy_aiori = {
.open = DUMMY_Open,
.xfer = DUMMY_Xfer,
.close = DUMMY_Close,
.delete = DUMMY_Delete,
.remove = DUMMY_Delete,
.get_version = DUMMY_getVersion,
.fsync = DUMMY_Fsync,
.get_file_size = DUMMY_GetFileSize,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-FINCHFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ ior_aiori_t finchfs_aiori = {
.xfer_hints = FINCHFS_xfer_hints,
.xfer = FINCHFS_xfer,
.close = FINCHFS_close,
.delete = FINCHFS_delete,
.remove = FINCHFS_delete,
.get_version = FINCHFS_version,
.fsync = FINCHFS_fsync,
.get_file_size = FINCHFS_get_file_size,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-Gfarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ ior_aiori_t gfarm_aiori = {
.xfer_hints = Gfarm_xfer_hints,
.xfer = Gfarm_xfer,
.close = Gfarm_close,
.delete = Gfarm_delete,
.remove = Gfarm_delete,
.get_version = Gfarm_version,
.fsync = Gfarm_fsync,
.get_file_size = Gfarm_get_file_size,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-HDF5.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ior_aiori_t hdf5_aiori = {
.open = HDF5_Open,
.xfer = HDF5_Xfer,
.close = HDF5_Close,
.delete = HDF5_Delete,
.remove = HDF5_Delete,
.get_version = HDF5_GetVersion,
.xfer_hints = HDF5_init_xfer_options,
.fsync = HDF5_Fsync,
Expand Down
4 changes: 2 additions & 2 deletions src/aiori-HDFS.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ior_aiori_t hdfs_aiori = {
.open = HDFS_Open,
.xfer = HDFS_Xfer,
.close = HDFS_Close,
.delete = HDFS_Delete,
.remove = HDFS_Delete,
.get_options = HDFS_options,
.get_version = aiori_get_version,
.xfer_hints = hdfs_xfer_hints,
Expand Down Expand Up @@ -632,7 +632,7 @@ static void HDFS_Close(aiori_fd_t * fd, aiori_mod_opt_t * param) {
/*
* Delete a file through the HDFS interface.
*
* NOTE: The signature for ior_aiori.delete doesn't include a parameter to
* NOTE: The signature for ior_aiori.remove doesn't include a parameter to
* select recursive deletes. We'll assume that that is never needed.
*/
static void HDFS_Delete( char *testFileName, aiori_mod_opt_t * param ) {
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-IME.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ior_aiori_t ime_aiori = {
.xfer = IME_Xfer,
.xfer_hints = IME_Xferhints,
.close = IME_Close,
.delete = IME_Delete,
.remove = IME_Delete,
.get_version = IME_GetVersion,
.fsync = IME_Fsync,
.get_file_size = IME_GetFileSize,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-MMAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ior_aiori_t mmap_aiori = {
.open = MMAP_Open,
.xfer = MMAP_Xfer,
.close = MMAP_Close,
.delete = POSIX_Delete,
.remove = POSIX_Delete,
.xfer_hints = MMAP_xfer_hints,
.get_version = aiori_get_version,
.fsync = MMAP_Fsync,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-MPIIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ior_aiori_t mpiio_aiori = {
.open = MPIIO_Open,
.xfer = MPIIO_Xfer,
.close = MPIIO_Close,
.delete = MPIIO_Delete,
.remove = MPIIO_Delete,
.get_version = MPIIO_GetVersion,
.fsync = MPIIO_Fsync,
.get_file_size = MPIIO_GetFileSize,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-NCMPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ior_aiori_t ncmpi_aiori = {
.open = NCMPI_Open,
.xfer = NCMPI_Xfer,
.close = NCMPI_Close,
.delete = NCMPI_Delete,
.remove = NCMPI_Delete,
.get_version = NCMPI_GetVersion,
.fsync = NCMPI_Fsync,
.get_file_size = NCMPI_GetFileSize,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-PMDK.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ior_aiori_t pmdk_aiori = {
.open = PMDK_Open,
.xfer = PMDK_Xfer,
.close = PMDK_Close,
.delete = PMDK_Delete,
.remove = PMDK_Delete,
.get_version = aiori_get_version,
.fsync = PMDK_Fsync,
.xfer_hints = PMDK_xfer_hints,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-POSIX.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ ior_aiori_t posix_aiori = {
.open = POSIX_Open,
.xfer = POSIX_Xfer,
.close = POSIX_Close,
.delete = POSIX_Delete,
.remove = POSIX_Delete,
.xfer_hints = POSIX_xfer_hints,
.get_version = aiori_get_version,
.fsync = POSIX_Fsync,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-RADOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ior_aiori_t rados_aiori = {
.open = RADOS_Open,
.xfer = RADOS_Xfer,
.close = RADOS_Close,
.delete = RADOS_Delete,
.remove = RADOS_Delete,
.get_version = aiori_get_version,
.fsync = RADOS_Fsync,
.get_file_size = RADOS_GetFileSize,
Expand Down
6 changes: 3 additions & 3 deletions src/aiori-S3-4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ ior_aiori_t s3_4c_aiori = {
.xfer = S3_Xfer,
.xfer_hints = S3_xfer_hints,
.close = S3_Close,
.delete = S3_Delete,
.remove = S3_Delete,
.get_version = aiori_get_version,
.fsync = S3_Fsync,
.get_file_size = S3_GetFileSize,
Expand All @@ -203,7 +203,7 @@ ior_aiori_t s3_plus_aiori = {
.open = S3_Open,
.xfer = S3_Xfer,
.close = S3_Close,
.delete = S3_Delete,
.remove = S3_Delete,
.get_version = aiori_get_version,
.fsync = S3_Fsync,
.get_file_size = S3_GetFileSize,
Expand All @@ -220,7 +220,7 @@ ior_aiori_t s3_emc_aiori = {
.open = EMC_Open,
.xfer = EMC_Xfer,
.close = EMC_Close,
.delete = S3_Delete,
.remove = S3_Delete,
.get_version = aiori_get_version,
.fsync = S3_Fsync,
.get_file_size = S3_GetFileSize,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-S3-libs3.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ ior_aiori_t S3_libS3_aiori = {
.open = S3_Open,
.xfer = S3_Xfer,
.close = S3_Close,
.delete = S3_Delete,
.remove = S3_Delete,
.get_version = S3_getVersion,
.fsync = S3_Fsync,
.xfer_hints = s3_xfer_hints,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori-aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ ior_aiori_t aio_aiori = {
.close = aio_Close,
.sync = aio_Sync,
.check_params = aio_check_params,
.delete = POSIX_Delete,
.remove = POSIX_Delete,
.get_version = aiori_get_version,
.get_file_size = POSIX_GetFileSize,
.statfs = aiori_posix_statfs,
Expand Down
2 changes: 1 addition & 1 deletion src/aiori.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct ior_aiori {
IOR_offset_t (*xfer)(int access, aiori_fd_t *, IOR_size_t *,
IOR_offset_t size, IOR_offset_t offset, aiori_mod_opt_t * module_options);
void (*close)(aiori_fd_t *, aiori_mod_opt_t * module_options);
void (*delete)(char *, aiori_mod_opt_t * module_options);
void (*remove)(char *, aiori_mod_opt_t * module_options);
char* (*get_version)(void);
void (*fsync)(aiori_fd_t *, aiori_mod_opt_t * module_options);
IOR_offset_t (*get_file_size)(aiori_mod_opt_t * module_options, char * filename);
Expand Down
4 changes: 2 additions & 2 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ static void RemoveFile(char *testFileName, int filePerProc, IOR_param_t * test)
fprintf(out_logfile, "task %d removing %s\n", rank,
testFileName);
}
backend->delete(testFileName, test->backend_options);
backend->remove(testFileName, test->backend_options);
}
if (test->reorderTasksRandom == TRUE) {
rankOffset = tmpRankOffset;
Expand All @@ -829,7 +829,7 @@ static void RemoveFile(char *testFileName, int filePerProc, IOR_param_t * test)
fprintf(out_logfile, "task %d removing %s\n", rank,
testFileName);
}
backend->delete(testFileName, test->backend_options);
backend->remove(testFileName, test->backend_options);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/md-workbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ void run_benchmark(phase_stat_t * s, int * current_index_p){
}

op_timer = GetTimeStamp();
o.backend->delete(obj_name, o.backend_options);
o.backend->remove(obj_name, o.backend_options);
bench_runtime = add_timed_result(op_timer, s->phase_start_timer, s->time_delete, pos, & s->max_op_time, & op_time);
if(o.relative_waiting_factor > 1e-9) {
mdw_wait(op_time);
Expand Down Expand Up @@ -786,7 +786,7 @@ void run_cleanup(phase_stat_t * s, int start_index){
def_obj_name(obj_name, o.rank, d, f + start_index);

op_timer = GetTimeStamp();
o.backend->delete(obj_name, o.backend_options);
o.backend->remove(obj_name, o.backend_options);
add_timed_result(op_timer, s->phase_start_timer, s->time_delete, pos, & s->max_op_time, & op_time);

if (o.verbosity >= 2){
Expand Down
4 changes: 2 additions & 2 deletions src/mdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static void remove_file (const char *path, uint64_t itemNum) {
sprintf(curr_item, "%s/file.%s"LLU"", path, o.rm_name, itemNum);
VERBOSE(3,5,"create_remove_items_helper (non-dirs remove): curr_item is '%s'", curr_item);
if (!(o.shared_file && rank != 0)) {
o.backend->delete (curr_item, o.backend_options);
o.backend->remove (curr_item, o.backend_options);
}
}

Expand Down Expand Up @@ -492,7 +492,7 @@ void collective_helper(const int dirs, const int create, const char* path, uint6
}
} else if (!(o.shared_file && rank != 0)) {
//remove files
o.backend->delete (curr_item, o.backend_options);
o.backend->remove (curr_item, o.backend_options);
}
if(CHECK_STONE_WALL(progress)){
progress->items_done = i + 1;
Expand Down
43 changes: 43 additions & 0 deletions src/test/lib.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <mpi.h>

// compile with, e.g.: mpic++ -I../ -l../libaiori.a

extern "C"{
#include <ior.h>
#include <mdtest.h>
}

int main(int argc, char ** argv){
int rank;
int ret = 0;

MPI_Init(& argc, & argv);
MPI_Comm_rank(MPI_COMM_WORLD, & rank);

if (rank == 0){
char * param[] = {"./ior", "-a", "DUMMY"};
IOR_test_t * res = ior_run(3, param, MPI_COMM_SELF, stdout);
if (res == NULL)
{
fprintf(stderr, "Could not run ior\n");
ret = 1;
}
else
{
free(res->params.platform);
free(res);
}
}
if (rank == 0){
char * param[] = {"./mdtest", "-a", "DUMMY"};
mdtest_results_t * res = mdtest_run(3, param, MPI_COMM_SELF, stdout);
if (res == NULL)
{
fprintf(stderr, "Could not run mdtest\n");
ret = 1;
}
}
MPI_Finalize();

return ret;
}

0 comments on commit bfc922f

Please sign in to comment.