Skip to content

Commit c748e57

Browse files
committed
can pass all tests other than partial reads and writes and appends so around 74%
1 parent 23cded6 commit c748e57

File tree

10 files changed

+211
-162
lines changed

10 files changed

+211
-162
lines changed

compile_commands.json

Lines changed: 153 additions & 153 deletions
Large diffs are not rendered by default.

complete_rebuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
rm -rf ./build/*
44

55
pushd build
6-
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=$PDC_DIR -DPDC_ENABLE_MPI=ON -DMERCURY_DIR=$MERCURY_DIR -DCMAKE_C_COMPILER=mpicc -DMPI_RUN_CMD=mpiexec ..
6+
cmake ../ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DPDC_SERVER_CACHE=OFF -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DCMAKE_C_COMPILER=mpicc -DCMAKE_POLICY_VERSION_MINIMUM=3.5
77
make -j$(nproc)
88
cp compile_commands.json ..
99
popd

export_vars.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
export DATA=./build/bin/pdc_data
4+
export BIN=./build/bin

run_client.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
./rebuild.sh # Rebuild project
44

55
pushd ./build/bin || exit 1 # Exit if cd fails
6+
export PDC_DEBUG=1
67
"./sandbox"
78
popd
89

run_server.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ echo "deleting existing data"
1111
rm -rf /home/nlewi26/src/work_space/source/pdc/build/bin/pdc_data
1212

1313
pushd ./build/bin
14+
export PDC_DEBUG=1
1415
$1 ./pdc_server.exe
1516
popd

run_test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
./rebuild.sh
6+
7+
echo "killing previous pdc_server.exe"
8+
pkill -f pdc_server.exe || true
9+
10+
echo "deleting existing data"
11+
rm -rf /home/nlewi26/src/work_space/source/pdc/build/bin/pdc_data
12+
13+
pushd ./build
14+
ctest -L serial
15+
popd

src/server/include/pdc_client_server_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ typedef struct data_server_region_t {
337337
void *obj_data_ptr;
338338
// FIXME: (Noah) we should dynamically allocate this number....
339339
char * storage_location[1024]; // save the file location to enable reopening
340+
int original_region_size;
340341
struct data_server_region_t *prev;
341342
struct data_server_region_t *next;
342343
} data_server_region_t;

src/server/pdc_server_region/pdc_server_data.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,27 @@ PDC_Server_clear_obj_region()
332332
{
333333
DL_FOREACH_SAFE(elt->region_storage_head, elt2, tmp2)
334334
{
335-
// DL_DELETE(elt->region_storage_head, elt2);
336-
free(elt2);
335+
if(elt2 == NULL) {
336+
LOG_ERROR("elt2 was NULL\n");
337+
} else {
338+
LOG_INFO("elt2 was NOT NULL\n");
339+
free(elt2);
340+
}
341+
}
342+
if(elt->storage_location == NULL) {
343+
LOG_ERROR("elt->storage_location was NULL\n");
344+
} else {
345+
LOG_INFO("elt->storage_location was NOT NULL\n");
346+
// FIXME: (Noah)
347+
//free(elt->storage_location);
348+
LOG_INFO("elt->storage_location was NOT NULL1\n");
349+
}
350+
if(elt == NULL) {
351+
LOG_ERROR("elt was NULL\n");
352+
} else {
353+
LOG_INFO("elt was NOT NULL\n");
354+
free(elt);
337355
}
338-
free(elt->storage_location);
339-
free(elt);
340356
}
341357
}
342358
FUNC_LEAVE(ret_value);
@@ -364,6 +380,7 @@ PDC_Server_register_obj_region_by_pointer(data_server_region_t **new_obj_reg_ptr
364380
new_obj_reg->close_flag = close_flag;
365381
// FIXME: (Noah)
366382
new_obj_reg->storage_location[region_index] = (char *)malloc(sizeof(char) * ADDR_MAX);
383+
new_obj_reg->original_region_size = -1;
367384
new_obj_reg->fd =
368385
server_open_storage(new_obj_reg->storage_location[region_index], obj_id, region_index);
369386

src/server/pdc_server_region/pdc_server_region_transfer.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ PDC_transfer_request_id_register()
258258
} \
259259
}
260260

261+
static void PDC_Server_io_not_by_region_region_per_file(char* user_specified_path, int is_write) {
262+
263+
}
264+
261265
perr_t
262266
PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *obj_dims,
263267
struct pdc_region_info *region_info, void *buf, size_t unit, int is_write)
@@ -273,7 +277,7 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob
273277

274278
FUNC_ENTER(NULL);
275279

276-
if (io_by_region_g || obj_ndim == 0) {
280+
//if (io_by_region_g || obj_ndim == 0) {
277281
if (is_write) {
278282
// FIXME: (Noah) switching to region per file manually
279283
// PDC_Server_data_write_out(obj_id, region_info, buf, unit);
@@ -284,7 +288,8 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob
284288
PDC_Server_data_read_from_region_per_file(obj_id, region_info, buf, unit);
285289
}
286290
goto done;
287-
}
291+
//}
292+
288293
if (obj_ndim != (int)region_info->ndim) {
289294
LOG_ERROR("Server I/O error: Obj dim does not match obj dim\n");
290295
goto done;
@@ -304,7 +309,9 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob
304309
PDC_get_rank(), PDC_get_rank());
305310
PDC_mkdir(storage_location);
306311

307-
fd = open(storage_location, O_RDWR | O_CREAT, 0666);
312+
PDC_Server_io_not_by_region_region_per_file(storage_location, is_write);
313+
314+
/*fd = open(storage_location, O_RDWR | O_CREAT, 0666);
308315
if (region_info->ndim == 1) {
309316
lseek(fd, region_info->offset[0] * unit, SEEK_SET);
310317
io_size = region_info->size[0] * unit;
@@ -365,7 +372,7 @@ PDC_Server_transfer_request_io(uint64_t obj_id, int obj_ndim, const uint64_t *ob
365372
}
366373
}
367374
}
368-
close(fd);
375+
close(fd);*/
369376

370377
done:
371378
/* PDC_get_time_str(cur_time); */

src/tests/run_test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
# We assume too, that if the library build has enabled MPI, that LD_LIBRARY_PATH is
44
# defined and points to the MPI libraries used by the linker (e.g. -L<path -lmpi)
55

6+
set -x
7+
68
# Cori CI needs srun even for serial tests
79
run_cmd=""
10+
#run_cmd="gdb -batch --args"
811
if [[ "$SUPERCOMPUTER" == "perlmutter" ]]; then
912
run_cmd="srun -n 1 --mem=25600 --cpu_bind=cores --overlap"
1013
fi

0 commit comments

Comments
 (0)