Skip to content

Commit

Permalink
start some work on tmLQCD interface to better target nyom
Browse files Browse the repository at this point in the history
  • Loading branch information
kostrzewa committed Nov 28, 2023
1 parent 782d709 commit fb8741d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
13 changes: 7 additions & 6 deletions include/tmLQCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ int tmLQCD_get_lat_params(tmLQCD_lat_params *params);
int tmLQCD_set_op_params(tmLQCD_op_params const *const params, const int op_id);
int tmLQCD_get_op_params(tmLQCD_op_params *params, const int op_id);

// need interfaces with (double*) pointers for these since we don't want to export
// all of tmLQCDs data types
//// generates a point source at the global coordinates passed via the
//// four element vector global_txyz_src_pos in the ordering {t,x,y,z}
//// the spin index 'is' and the colour index 'ic'
//void full_source_spinor_field_point(spinor * const full_spinor,
// const int is, const int ic,
// const int * const global_txyz_src_pos);
//
void tmLQCD_full_source_spinor_field_point(double * const full_spinor,
const int is, const int ic,
const int * const global_txyz_src_pos);

void tmLQCD_read_spinor(double * full_spinor, const char * fname, int idx);
void tmLQCD_write_spinor(double * const full_spinor, const char * fname, const int append, const int flavours);

//// as full_source_spinor_field_point but with output directly to checkerboarded
//// spinors
//void eo_source_spinor_field_point(spinor * const even_cb_spinor,
Expand Down
24 changes: 24 additions & 0 deletions wrapper/lib_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "measure_gauge_action.h"
#include "linalg/convert_eo_to_lexic.h"
#include "include/tmLQCD.h"
#include "source_generation.h"
#include "fatal_error.h"
#include "misc_types.h"

Expand Down Expand Up @@ -430,6 +431,29 @@ int tmLQCD_set_op_params(tmLQCD_op_params const* const params, const int op_id)
return (0);
}

void tmLQCD_full_source_spinor_field_point(double * const full_spinor,
const int is, const int ic,
const int * const global_txyz_src_pos)
{
full_source_spinor_field_point((spinor* const) full_spinor,
is, ic, global_txyz_src_pos);
}

void tmLQCD_read_spinor(double * const full_spinor, const char * fname, const int idx)
{
read_spinor(g_spinor_field[0], g_spinor_field[1], fname, idx);
convert_eo_to_lexic((spinor*) full_spinor, g_spinor_field[0], g_spinor_field[1]);
}

void tmLQCD_write_spinor(double * const full_spinor, const char * fname, const int append, const int flavours)
{
convert_lexic_to_eo(g_spinor_field[0], g_spinor_field[1], (spinor*) full_spinor);
WRITER *writer = NULL;
construct_writer(&writer, fname, append);
write_spinor(writer, g_spinor_field[0], g_spinor_field[1], flavours, 64);
destruct_writer(writer);
}

#ifdef TM_USE_QPHIX
int tmLQCD_invert_qphix_direct(double * const Odd_out, double * const Odd_in, const int op_id){
static double clover_term_c_sw = -1.0;
Expand Down

0 comments on commit fb8741d

Please sign in to comment.