[Pvfs2-cvs] commit by walt in pvfs2-1/src/server: final-response.sm
get-config.sm pvfs2-server.c rmdirent.sm
CVS commit program
cvs at parl.clemson.edu
Tue Aug 29 16:44:03 EDT 2006
Update of /projects/cvsroot/pvfs2-1/src/server
In directory parlweb1:/tmp/cvs-serv32553/src/server
Modified Files:
Tag: WALT3
final-response.sm get-config.sm pvfs2-server.c rmdirent.sm
Log Message:
updates to parallel state machine code that get a basic test working
This test is still included in get_config.sm and needs to be removed.
Index: final-response.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/final-response.sm,v
diff -p -u -r1.30.4.4 -r1.30.4.5
--- final-response.sm 17 Jul 2006 22:25:39 -0000 1.30.4.4
+++ final-response.sm 29 Aug 2006 20:44:03 -0000 1.30.4.5
@@ -79,8 +79,8 @@ static PINT_sm_action final_response_rel
job_id_t tmp_id;
gossip_debug(GOSSIP_SERVER_DEBUG,
- "(%p) %s (FR sm) state: release: (error_code = %d)\n", s_op,
- PINT_map_server_op_to_string(s_op->req->op),
+ "(s_op %p) %s (FR sm) state: release: (error_code = %d)\n",
+ s_op, PINT_map_server_op_to_string(s_op->req->op),
js_p->error_code);
/* this seems a little odd, but since this is the first state of the
@@ -121,9 +121,8 @@ static PINT_sm_action final_response_sen
gossip_debug(
GOSSIP_SERVER_DEBUG,
- "(%p) %s (FR sm) state: send_resp (status = %d)\n",
- s_op,
- PINT_map_server_op_to_string(s_op->req->op),
+ "(s_op %p) %s (FR sm) state: send_resp (status = %d)\n",
+ s_op, PINT_map_server_op_to_string(s_op->req->op),
s_op->resp.status);
if (js_p->error_code != 0)
@@ -165,7 +164,7 @@ static PINT_sm_action final_response_cle
char status_string[64] = {0};
gossip_debug(GOSSIP_SERVER_DEBUG,
- "(%p) %s (FR sm) state: cleanup\n",
+ "(s_op %p) %s (FR sm) state: cleanup\n",
s_op, PINT_map_server_op_to_string(s_op->req->op));
PVFS_strerror_r(s_op->resp.status, status_string, 64);
Index: get-config.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/get-config.sm,v
diff -p -u -r1.34.4.3 -r1.34.4.4
--- get-config.sm 16 Jul 2006 21:42:58 -0000 1.34.4.3
+++ get-config.sm 29 Aug 2006 20:44:03 -0000 1.34.4.4
@@ -19,17 +19,73 @@ static PINT_sm_action getconfig_cleanup(
static PINT_sm_action getconfig_init(
struct PINT_smcb *smcb, job_status_s *js_p);
+/*******************/
+static PINT_sm_action start_pjmp_action(
+ struct PINT_smcb *smcb, job_status_s *js_p);
+
+static PINT_sm_action end_pjmp_action(
+ struct PINT_smcb *smcb, job_status_s *js_p);
+
+static PINT_sm_action st1_action(
+ struct PINT_smcb *smcb, job_status_s *js_p);
+
+static PINT_sm_action st2_action(
+ struct PINT_smcb *smcb, job_status_s *js_p);
+
+static PINT_sm_action st3_action(
+ struct PINT_smcb *smcb, job_status_s *js_p);
+/*******************/
+ // success => init;
+
%%
-machine pvfs2_get_config_sm(prelude, init, final_response, cleanup)
+machine pvfs2_server_test_pjmp_sm(st1, st2, st3)
+{
+ state st1
+ {
+ run st1_action;
+ default => st2;
+ }
+
+ state st2
+ {
+ run st2_action;
+ default => st3;
+ }
+
+ state st3
+ {
+ run st3_action;
+ default => terminate;
+ }
+
+}
+
+machine pvfs2_get_config_sm(prelude, init, final_response, cleanup
+ ,start_pjmp, end_pjmp)
{
state prelude
{
jump pvfs2_prelude_sm;
- success => init;
+ success => start_pjmp;
default => final_response;
}
+ state start_pjmp
+ {
+ pjmp start_pjmp_action
+ {
+ 1 => pvfs2_server_test_pjmp_sm;
+ }
+ default => end_pjmp;
+ }
+
+ state end_pjmp
+ {
+ run end_pjmp_action;
+ default => init;
+ }
+
state init
{
run getconfig_init;
@@ -51,6 +107,61 @@ machine pvfs2_get_config_sm(prelude, ini
%%
+/*******************/
+static PINT_sm_action start_pjmp_action(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ struct PINT_server_op *s_op = malloc(sizeof(struct PINT_server_op));
+ s_op->op = i; /* used in print to ID task */
+ PINT_sm_push_frame(smcb, 1, s_op);
+ }
+ js_p->error_code = 0;
+ return SM_ACTION_DEFERRED;
+}
+
+static PINT_sm_action end_pjmp_action(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ struct PINT_server_op *s_op = PINT_sm_pop_frame(smcb);
+ free(s_op);
+ }
+ js_p->error_code = 0;
+ return SM_ACTION_COMPLETE;
+}
+
+static PINT_sm_action st1_action(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+ fprintf(stderr,"RUNNING ACTION: ST1 TASK: T%d\n", s_op->op);
+ js_p->error_code = 0;
+ return SM_ACTION_COMPLETE;
+}
+
+static PINT_sm_action st2_action(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+ fprintf(stderr,"RUNNING ACTION: ST2 TASK: T%d\n", s_op->op);
+ js_p->error_code = 0;
+ return SM_ACTION_COMPLETE;
+}
+
+static PINT_sm_action st3_action(
+ struct PINT_smcb *smcb, job_status_s *js_p)
+{
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+ fprintf(stderr,"RUNNING ACTION: ST3 TASK: T%d\n", s_op->op);
+ js_p->error_code = 0;
+ return SM_ACTION_TERMINATE;
+}
+/*******************/
/*
* Function: getconfig_init
Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/pvfs2-server.c,v
diff -p -u -r1.217.2.8 -r1.217.2.9
--- pvfs2-server.c 1 Aug 2006 15:52:02 -0000 1.217.2.8
+++ pvfs2-server.c 29 Aug 2006 20:44:03 -0000 1.217.2.9
@@ -597,6 +597,8 @@ int main(int argc, char **argv)
{
int unexpected_msg = 0;
struct PINT_smcb *smcb = server_completed_job_p_array[i];
+ gossip_debug(GOSSIP_SERVER_DEBUG, "PVFS2 Server: job "
+ "completed smcb %p\n", smcb);
/* Completed jobs might be ongoing, or might be new
* (unexpected) ones. We handle the first step of either
@@ -1853,14 +1855,6 @@ int server_state_machine_complete(PINT_s
free(s_op->unexp_bmi_buff.buffer);
}
- /* free the operation structure itself */
- /* moved to terminate function
- PINT_smcb_free(&smcb);
- */
-
- /* we didn't post an operation, so by returning DEFERRED
- * we will never run again
- */
return SM_ACTION_TERMINATE;
}
Index: rmdirent.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/rmdirent.sm,v
diff -p -u -r1.47.2.4 -r1.47.2.5
--- rmdirent.sm 18 Jul 2006 21:23:53 -0000 1.47.2.4
+++ rmdirent.sm 29 Aug 2006 20:44:03 -0000 1.47.2.5
@@ -41,8 +41,6 @@ extern PINT_server_trove_keys_s Trove_Co
machine pvfs2_rmdirent_sm(
prelude,
verify_parent_metadata_and_read_directory_entry_handle,
- read_directory_entry,
- read_directory_entry_failure,
remove_directory_entry,
remove_directory_entry_failure,
check_for_req_dir_update,
More information about the Pvfs2-cvs
mailing list